diff options
author | JSDurand <mmemmew@gmail.com> | 2023-01-08 22:38:52 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2023-01-08 22:38:52 +0800 |
commit | 9329125383e2329ac75432a62f5a81d50db4d78b (patch) | |
tree | 61be9ad004effc31964a8c4eeb78e81c91c8ddb9 /bookmark-conf.el | |
parent | d9fba24319ad36994671846e5e29e1c40ae137a5 (diff) |
bookmark: add types to handlers and use that for grouping
* bookmark-conf.el ("durand"): Use types of bookmark handlers as group
headings.
(pdf-view-bookmark-jump-handler): Give it the type "PDF".
(durand-external-jump): Give it the type "External".
* eww-conf.el: Give the handler for EWW the type "EWW".
Diffstat (limited to 'bookmark-conf.el')
-rw-r--r-- | bookmark-conf.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bookmark-conf.el b/bookmark-conf.el index d2750b3..508fae3 100644 --- a/bookmark-conf.el +++ b/bookmark-conf.el @@ -100,6 +100,10 @@ (save-match-data (let* ((handler (bookmark-get-handler element)) (handler-name (and handler (format "%S" handler))) + (handler-type + (cond + ((functionp #'bookmark-type-from-full-record) + (bookmark-type-from-full-record element)))) (location (bookmark-location element)) (capitalize-p t)) ;; replace repeating parts @@ -151,6 +155,7 @@ (setq handler-name (match-string 1 new-location))) ((setq handler-name nil))))))) (cond + (handler-type) (handler-name (cond ((<= (length handler-name) 3) (upcase handler-name)) @@ -191,6 +196,10 @@ (eq (bookmark-get-handler bookmark) 'pdf-view-bookmark-jump-handler)) +;; This is added in Emacs 29. + +(put 'pdf-view-bookmark-jump-handler 'bookmark-handler-type "PDF") + ;;;; Org group (defvar org-directory) @@ -314,6 +323,10 @@ This will be opened by the function `browse-url-default-browser'." (autoload 'browse-url-default-browser "browse-url") +;; This is added in Emacs 29. + +(put 'durand-external-jump 'bookmark-handler-type "External") + (defun durand-external-jump (bookmark) "Jump to the external BOOKMARK. BOOKMARK should be set by `durand-set-external-bookmark'." |