* bookmark.el (bookmark-maybe-load-default-file): Remove redundant
calls to expand-file-name.
(bookmark-relocate): Use abbreviated file names in bookmarks.
(bookmark-load): Use abbreviated file names in messages.
(bookmark-bmenu-marks-width): Bump back to 2, to include annotation marks.
(bookmark-bmenu-hide-filenames): Adjust for above, and put the text
property on the bookmark name, instead of not putting it at all.
(bookmark-bmenu-list): Fix where we put the text property.
(bookmark-bmenu-list): Initialize buffer-modified-p properly.
(bookmark-send-edited-annotation): Mark bookmark-alist as modified.
(with-buffer-modified-unmodified): New macro.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-mark, bookmark-bmenu-unmark, bookmark-bmenu-delete):
Use new macro to preserve the buffer-modified state.
(bookmark-bmenu-ensure-position): New name for
`bookmark-bmenu-check-position'. Just ensure the position;
don't return any meaningful value.
(bookmark-bmenu-header-height, bookmark-bmenu-marks-width): New constants.
(bookmark-bmenu-list): Save name on `bookmark-name-prop' text-prop.
(bookmark-bmenu-show-filenames): Use push.
(bookmark-bmenu-hide-filenames): Use local var instead of
bookmark-bmenu-bookmark-column. Use pop. Don't save window-excursion.
(bookmark-bmenu-bookmark): Use the new `bookmark-name-prop' text-prop.
(bookmark-bmenu-execute-deletions): Don't bother adding/removing the
filenames now that the bookmark names are always available.
(bookmark-search-pattern): Move and leave unbound.
(bookmark-bmenu-mode-map): Change binding.
(bookmark-read-search-input): Simplify.
Don't use text-char-description. Don't error on non-char events.
(bookmark-filtered-alist-by-regexp-only): Remove by folding into the
only caller (i.e. bookmark-bmenu-filter-alist-by-regexp).
(bookmark-bmenu-search): Don't check we're in a bookmark-list buffer.
Use a local var for the timer.
(bookmark-bmenu-cancel-search): Remove by folding into the only caller
(i.e. bookmark-bmenu-search).
(bookmark-search-delay): Shorten doc string to fit in 80 columns.
(bookmark-bmenu-search): Wrap to fit within 80 columns. Minor
grammar and punctuation fixes in doc string.
(bookmark-read-search-input): Adjust to fit within 80 columns.
(bookmark-search-pattern, bookmark-search-timer, bookmark-quit-flag): New vars.
(bookmark-read-search-input, bookmark-filtered-alist-by-regexp-only)
(bookmark-bmenu-filter-alist-by-regexp)
(bookmark-bmenu-goto-bookmark, bookmark-bmenu-cancel-search): New funs.
(bookmark-bmenu-search): New command.
(bookmark-bmenu-mode-map): Bind it.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames):
Don't consider whether the display supports colors.
(bookmark-import-new-list): Use dolist.
(bookmark-bmenu-mode-map): Move initialization into declaration.
(bookmark-bmenu-list): Use dolist, simplify.
(bookmark-show-all-annotations): Use save-selected-window and dolist.
(menu-bar-final-items): Use push.
(bookmark-bmenu-execute-deletions): Don't save here, as bookmark-delete
will now do so if necessary.
Suggested by: Thierry Volpiatto <thierry.volpiatto {_AT_} gmail.com>
(Bug#4348)
don't do anything related to relocating, just return nil.
(bookmark-error-no-filename): New error.
(bookmark-default-handler): Signal `bookmark-error-no-filename' if
bookmark has no file. Don't even attempt to handle things that
are not files; the whole point of custom handlers is to keep that
knowledge elsewhere anyway. Tighten some comments.
(bookmark-file-or-variation-thereof): Remove now-unused function.
(bookmark-location): Doc string fix.
(Bug#4250)
don't use a file dialog, because they usually don't know how to read
a directory target from the user. (Bug#4230)
Also, make sure the prompt can display directories as well as files.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-set-name, bookmark-prop-get, bookmark-prop-set,
bookmark-get-annotation, bookmark-set-annotation, bookmark-get-filename,
bookmark-set-filename, bookmark-get-position, bookmark-set-position,
bookmark-get-front-context-string, bookmark-set-front-context-string,
bookmark-get-rear-context-string, bookmark-set-rear-context-string,
bookmark-location, bookmark-jump, bookmark-jump-other-window,
bookmark-handle-bookmark, bookmark-relocate, bookmark-insert-location,
bookmark-rename, bookmark-insert, bookmark-delete, bookmark-time-to-save-p,
bookmark-edit-annotation-mode, bookmark-edit-annotation): Improve doc
strings to say whether bookmark can be a string or a record or both,
and make other consistency and clarity fixes.
(bookmark-get-handler, bookmark--jump-via, bookmark-write-file,
bookmark-default-annotation-text, bookmark-yank-word,
bookmark-maybe-load-default-file, bookmark-maybe-sort-alist,
bookmark-import-new-list, bookmark-maybe-rename,
bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-bookmark): Give these doc strings.
(bookmark-bmenu-check-position): Give this a doc string, but also
add a FIXME comment about how the function may be pointless.
(bookmark-default-handler): Rework doc string and change a parameter
name, to clarify that this takes a bookmark record not a bookmark name.
(bookmark-set): Change a parameter name to indicate its meaning,
and improve the doc string a bit.
(Bug#4188)
used until now in bookmark.el's code.
(bookmark-get-bookmark): Accept bookmark names or bookmark records.
(bookmark-get-bookmark-record): Allow the 2 slightly different formats
used until now in bookmark.el's code.
(bookmark-set-filename): Remove special code, moved to its only caller.
(bookmark-store): Use the newer format.
(bookmark-make-record-default): Add arg `point-only'.
Rename from bookmark-make-record-for-text-file.
(bookmark--jump-via): New function.
(bookmark-jump, bookmark-jump-other-window, bookmark-bmenu-2-window)
(bookmark-bmenu-other-window, bookmark-bmenu-switch-other-window):
Use it.
(bookmark-jump-noselect, bookmark-default-handler):
Don't return an alist, instead return the data implicitly by changing
current buffer and point. Signal an error if the file doesn't exist.
* info.el (Info-bookmark-make-record):
Use bookmark-make-record-default.
(Info-bookmark-jump): Use bookmark-default-handler.
* image-mode.el (image-bookmark-make-record):
Use bookmark-make-record-default.
(image-bookmark-jump): Use bookmark-default-handler.
* doc-view.el (doc-view-bookmark-make-record):
Use bookmark-make-record-default.
(doc-view-bookmark-jump): Use bookmark-default-handler.