-(defvar bookmark-annotation-paragraph nil)
-(defvar bookmark-annotation-name nil)
-(defvar bookmark-annotation-buffer nil)
-(defvar bookmark-annotation-file nil)
-(defvar bookmark-annotation-point nil)
-
-
-(defun bookmark-send-annotation ()
- "Use buffer contents as the annotation for a bookmark.
-Exclude lines that begin with `#'.
-Store the annotation text in the bookmark list with
-the bookmark (and file, and point) specified in buffer local variables."
- (interactive)
- (if (not (eq major-mode 'bookmark-read-annotation-mode))
- (error "Not in bookmark-read-annotation-mode"))
- (goto-char (point-min))
- (while (< (point) (point-max))
- (if (looking-at "^#")
- (bookmark-kill-line t)
- (forward-line 1)))
- (let ((annotation (buffer-string))
- (parg bookmark-annotation-paragraph)
- (bookmark bookmark-annotation-name)
- (pt bookmark-annotation-point)
- (buf bookmark-annotation-buffer))
- ;; for bookmark-make-record-function to work, we need to be
- ;; in the relevant buffer, at the relevant point.
- ;; Actually, the bookmark-make-record-function spec should
- ;; probably be changed to avoid this need. Should I handle the
- ;; error if a buffer is killed between "C-x r m" and a "C-c C-c"
- ;; in the annotation buffer?
- (save-excursion
- (pop-to-buffer buf)
- (goto-char pt)
- (bookmark-make bookmark annotation parg)
- (setq bookmark-current-bookmark bookmark))
- (bookmark-bmenu-surreptitiously-rebuild-list)
- (goto-char bookmark-current-point))
- (kill-buffer (current-buffer)))