this original name from `bookmark-name-from-record' reverting part of
2010-12-08T08:09:27Z!kfogel@red-bean.com / kfogel@red-bean.com-20101208080927-5j9jqnb2xvcw4ogm.
As Drew Adams pointed out, there was no reason to cause churn for
third-party callers.
whether "bookmark" meant a bookmark name or a bookmark record.
Along the way, shorten one function's name for similar reasons.
(Issue #7548)
* lisp/bookmark.el
(bookmark-name-from-record):
New name for `bookmark-name-from-full-record'. All callers changed.
(bookmark-get-bookmark, bookmark-get-bookmark-record,
bookmark-default-annotation-text, 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-get-handler, bookmark-edit-annotation, bookmark--jump-via,
bookmark-handle-bookmark, bookmark-location, bookmark-show-annotation):
Rename `bookmark' parameter to `bookmark-name-or-record', to
clearly show its role, and shorten or adjust doc strings accordingly.
(bookmark-set-name):
Same, and pass the parameter directly to `bookmark-get-bookmark'
instead of redundantly doing the callee's work.
(bookmark-default-annotation-text, bookmark-send-edited-annotation,
bookmark-relocate, bookmark-insert-location, bookmark-insert,
bookmark-delete):
Rename `bookmark' parameter to `bookmark-name', and in some cases
shorten doc string accordingly.
(bookmark-rename):
Change `old' and `new' parameters to `old-name'
and `new-name', and adjust an internal variable to avoid confusion.
(bookmark-jump, bookmark-jump-noselect):
Clarify `bookmark' parameter in doc string.
* lisp/bookmark.el (bookmark-set): Don't set `bookmark-yank-point' and
`bookmark-current-buffer' if they have been already set in another
buffer (e.g gnus-art).
* lisp/gnus/gnus-sum.el (gnus-summary-bookmark-make-record): Set
`bookmark-yank-point' and `bookmark-current-buffer' to allow C-w.
This is also from Thierry Volpiatto's patch in bug #6444. However,
because it was extraneous to the functional change in that patch,
and causes a re-indendation, I am committing it separately.
* bookmark.el (bookmark-location): Use the new field, if present.
(bookmark-insert-location): Undo last change, not needed any more.
* man.el (Man-bookmark-make-record):
* woman.el (woman-bookmark-make-record):
* gnus-sum.el (gnus-summary-bookmark-make-record): Add `location' field.
* gnus-sum.el: Add bookmark declarations to silence the compiler.
(gnus-mark-xrefs-as-read, gnus-summary-limit-to-bodies):
Use with-current-buffer to silence the byte-compiler.
(gnus-summary-bookmark-make-record): Use derived-mode-p and don't
bother to require `gnus'.
(gnus-summary-bookmark-jump): Don't forget to autoload. Simplify.
* woman.el: Add bookmark declarations to silence the compiler.
(bookmark-prop-get): Use `man-args' rather than `filename' as a first
step to compatibility between man and woman bookmarks.
Adjust for Man-default-bookmark-title renaming.
(woman-bookmark-jump): Adjust accordingly. Don't forget to autoload.
* man.el: Add bookmark declarations to silence the compiler.
(Man-name-local-regexp): Make it match NAME as well.
(Man-getpage-in-background): Return the buffer.
(Man-notify-when-ready): Use `case'.
(man-set-default-bookmark-title): Rename to Man-default-bookmark-title.
Don't hardcode "NAME". Simplify.
(Man-bookmark-make-record): Use Man-arguments rather than buffer-name.
Rename from Man-bookmark-make-record.
(Man-bookmark-jump): Rename from man-bookmark-jump. Simplify now that
we have the actual man-args. Use Man-getpage-in-background rather
than `man' since the arg is already processed. Let bookmark.el do the
window handling. Only wait for the relevant process.
Don't forget to autoload.
* bookmark.el (bookmark-default-file): Use locate-user-emacs-file.
* 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.