-
Notifications
You must be signed in to change notification settings - Fork 8
Home
Jason May edited this page Dec 18, 2023
·
3 revisions
See https://github.com/alphapapa/org-bookmark-heading/issues/20
If you are using Bookmarks+, the following functions add support for org bookmarks in Bookmarks+ filtering.
(defun bmkp-org-bookmark-p (bookmark)
"Return non-nil if BOOKMARK bookmarks an Org heading."
(eq (bookmark-get-handler bookmark) 'org-bookmark-heading-jump))
(defun bmkp-org-alist-only ()
"`bookmark-alist', but only for Org heading bookmarks.
A new list is returned (no side effects)."
(bookmark-maybe-load-default-file)
(bmkp-remove-if-not #'bmkp-org-bookmark-p bookmark-alist))
(defun bmkp-bmenu-show-only-org-bookmarks (&optional arg)
"Display a list of Org bookmarks (only)."
(interactive)
(bmkp-bmenu-barf-if-not-in-menu-list)
(setq bmkp-bmenu-filter-function 'bmkp-org-alist-only)
(setq bmkp-latest-bookmark-alist (bmkp-org-alist-only))
(setq bmkp-bmenu-title "Org Bookmarks")
(bookmark-bmenu-list 'filteredp)
)
(defun bmkp-bmenu-mark-org-bookmarks (&optional msgp)
"Mark Org bookmarks."
(interactive "p")
(bmkp-bmenu-mark-bookmarks-satisfying 'bmkp-org-bookmark-p nil msgp))
For key bindings, I suggest the following. Capital O
is already taken for Orphaned bookmarks, so I'm suggesting
lower-case o
for org bookmarks.
(define-key bookmark-bmenu-mode-map "o" nil)
(define-key bookmark-bmenu-mode-map "oS" 'bmkp-bmenu-show-only-org-bookmarks)
(define-key bookmark-bmenu-mode-map "oM" 'bmkp-bmenu-mark-org-bookmarks)