summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAugusto Stoffel <arstoffel@gmail.com>2025-10-12 16:37:30 +0200
committerAugusto Stoffel <arstoffel@gmail.com>2025-10-12 16:37:30 +0200
commita0a40cc7b0a4ed37bd146cd03737fb426863787c (patch)
tree1b18686786ea8b97e5b7ce017a99e9a682212735
parent87102d9f20b442a0e36b6af9e0207500b903cad5 (diff)
Simplify definition of bookmarks entries
Also, make handler a named function due to Emacs bug#79618.
-rw-r--r--devdocs.el30
1 files changed, 18 insertions, 12 deletions
diff --git a/devdocs.el b/devdocs.el
index fc90fbf..34e932c 100644
--- a/devdocs.el
+++ b/devdocs.el
@@ -495,20 +495,26 @@ Interactively, read a page name with completion."
:active (car devdocs--forward-stack)
:help "Return from a previously displayed documentation entry"]))
+(defun devdocs--bookmark-handler (bm)
+ "Display DevDocs location of bookmark BM."
+ (declare-function bookmark-prop-get "bookmark")
+ (pop-to-buffer
+ (devdocs-goto-page
+ (bookmark-prop-get bm 'devdocs-doc)
+ (bookmark-prop-get bm 'devdocs-path))))
+
(defun devdocs--make-bookmark ()
"This implements the `bookmark-make-record-function' type for a devdocs page."
- (let-alist (or (car devdocs--stack) (user-error "Not in a DevDocs buffer"))
- (let* ((title (concat .doc.slug "/" .path)))
- (cons (concat "devdocs/" title)
- `((defaults . (,title))
- (devdocs-doc . ,.doc)
- (devdocs-path . ,.path)
- (buf . "*devdocs*")
- (handler . ,(lambda (bmk)
- (pop-to-buffer
- (devdocs-goto-page
- (bookmark-prop-get bmk 'devdocs-doc)
- (bookmark-prop-get bmk 'devdocs-path))))))))))
+ (let-alist (or (car devdocs--stack)
+ (user-error "Not in a DevDocs buffer"))
+ `((defaults ,(concat .doc.slug "/" .path))
+ (devdocs-doc . ,.doc)
+ (devdocs-path . ,.path)
+ (filename . ,(format-mode-line devdocs-header-line
+ nil nil
+ (current-buffer)))
+ (buf . "*devdocs*")
+ (handler . devdocs--bookmark-handler))))
;;; HTML rendering