Function: bookmark-send-edited-annotation
bookmark-send-edited-annotation is an interactive and byte-compiled
function defined in bookmark.el.gz.
Signature
(bookmark-send-edited-annotation)
Documentation
Use buffer contents as annotation for a bookmark.
Lines beginning with # are ignored.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/bookmark.el.gz
(defun bookmark-send-edited-annotation ()
"Use buffer contents as annotation for a bookmark.
Lines beginning with `#' are ignored."
(interactive nil bookmark-edit-annotation-mode)
(if (not (derived-mode-p 'bookmark-edit-annotation-mode))
(error "Not in bookmark-edit-annotation-mode"))
(goto-char (point-min))
(while (< (point) (point-max))
(if (= (following-char) ?#)
(bookmark-kill-line t)
(forward-line 1)))
;; Take no chances with text properties.
(let ((annotation (buffer-substring-no-properties (point-min) (point-max)))
(bookmark-name bookmark-annotation-name)
(from-bookmark-list bookmark--annotation-from-bookmark-list)
(old-buffer (current-buffer)))
(bookmark-set-annotation bookmark-name annotation)
(setq bookmark-alist-modification-count
(1+ bookmark-alist-modification-count))
(message "Annotation updated for \"%s\"" bookmark-name)
(quit-window)
(bookmark-bmenu-surreptitiously-rebuild-list)
(when from-bookmark-list
(pop-to-buffer (get-buffer bookmark-bmenu-buffer))
(goto-char (point-min))
(bookmark-bmenu-bookmark))
(kill-buffer old-buffer)))