--- bookmark.el 2015-03-23 04:52:30.503739608 -0400 +++ bookmark-new.el 2015-03-23 06:08:22.399592029 -0400 @@ -1751,15 +1751,30 @@ (switch-to-buffer-other-window old-buf)))))) + +(defvar bookmark-show-all-annotations-in-org-mode nil +"When not `nil', the command `bookmark-show-all-annotations' will +format its display as an org-mode buffer") + (defun bookmark-show-all-annotations () "Display the annotations for all bookmarks in a buffer." (save-selected-window (pop-to-buffer (get-buffer-create "*Bookmark Annotation*") t) (delete-region (point-min) (point-max)) - (dolist (full-record bookmark-alist) + (unless (null bookmark-show-all-annotations-in-org-mode) + (org-mode)) + (let* ((heading-text "Bookmark annotations for ALL bookmarks") + (heading (if (null bookmark-show-all-annotations-in-org-mode) + (concat "# " heading-text "\n----------------------------------------\n") + (concat "* " heading-text "\n"))) + (prefix (unless (null bookmark-show-all-annotations-in-org-mode) + "** "))) + (insert heading) + + (dolist (full-record (bookmark-maybe-sort-alist)) (let* ((name (bookmark-name-from-full-record full-record)) (ann (bookmark-get-annotation full-record))) - (insert (concat name ":\n")) + (insert (concat prefix name ":\n")) (if (and ann (not (string-equal ann ""))) ;; insert the annotation, indented by 4 spaces. (progn @@ -1769,10 +1784,9 @@ (beginning-of-line) ; paranoia (insert " ") (forward-line) - (end-of-line)))))) + (end-of-line))))))) (goto-char (point-min)))) - (defun bookmark-bmenu-mark () "Mark bookmark on this line to be displayed by \\\\[bookmark-bmenu-select]." (interactive)