(defun bookmark-send-edited-annotation () "Use buffer contents as annotation for a bookmark. Lines beginning with `#' are ignored." (interactive) (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 (looking-at "^#") (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) (return-line (with-current-buffer "*Bookmark List*" (line-number-at-pos))) (return-column (with-current-buffer "*Bookmark List*" (current-column)))) (bookmark-set-annotation bookmark-name annotation) (setq bookmark-alist-modification-count (1+ bookmark-alist-modification-count)) (kill-buffer (current-buffer)) (pop-to-buffer (get-buffer "*Bookmark List*")) (bookmark-bmenu-list) (goto-char (point-min)) (forward-line (1- return-line)) (forward-char return-column)))