summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2022-07-23 11:11:47 +0300
committerEli Zaretskii <eliz@gnu.org>2022-07-23 11:11:47 +0300
commit7263631dca6145354e994d84c9ff3e09c450739b (patch)
treea40ba7382b95ab7d19abf4d5710709063284f9df
parentba7a75e052bfd24e99b79bbb161b2b0a99e7cce2 (diff)
downloademacs-7263631dca6145354e994d84c9ff3e09c450739b.tar.gz
Fix bookmark support for Help functions in native-compilation builds
* lisp/help.el (describe-key--helper, describe-function--helper): New helper functions. (describe-key): Call 'describe-key--helper' instead of a lambda-function. * lisp/help-fns.el (describe-function): Call 'describe-function--helper' instead of a lambda-function. (Bug#56643)
-rw-r--r--lisp/help-fns.el10
-rw-r--r--lisp/help.el18
2 files changed, 17 insertions, 11 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 6a7951d160e..656e7b7da24 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -251,13 +251,9 @@ handling of autoloaded functions."
(or describe-function-orig-buffer
(current-buffer))))
- (help-setup-xref
- (list (lambda (function buffer)
- (let ((describe-function-orig-buffer
- (if (buffer-live-p buffer) buffer)))
- (describe-function function)))
- function describe-function-orig-buffer)
- (called-interactively-p 'interactive))
+ (help-setup-xref (list #'describe-function--helper
+ function describe-function-orig-buffer)
+ (called-interactively-p 'interactive))
(save-excursion
(with-help-window (help-buffer)
diff --git a/lisp/help.el b/lisp/help.el
index fd331ac0d48..0701bf178aa 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -881,6 +881,19 @@ Describe the following key, mouse click, or menu item: "
(setq yank-menu (copy-sequence saved-yank-menu))
(fset 'yank-menu (cons 'keymap yank-menu))))))
+;; These two are named functions because lambda-functions cannot be
+;; serialized in a native-compilation build, which breaks bookmark
+;; support in help-mode.el.
+(defun describe-key--helper (key-list buf)
+ (describe-key key-list
+ (if (buffer-live-p buf) buf)))
+
+(defvar describe-function-orig-buffer)
+(defun describe-function--helper (func buf)
+ (let ((describe-function-orig-buffer
+ (if (buffer-live-p buf) buf)))
+ (describe-function func)))
+
(defun describe-key (&optional key-list buffer up-event)
"Display documentation of the function invoked by KEY-LIST.
KEY-LIST can be any kind of a key sequence; it can include keyboard events,
@@ -926,10 +939,7 @@ current buffer."
`(,seq ,brief-desc ,defn ,locus)))
key-list))
2)))
- (help-setup-xref (list (lambda (key-list buf)
- (describe-key key-list
- (if (buffer-live-p buf) buf)))
- key-list buf)
+ (help-setup-xref (list #'describe-key--helper key-list buf)
(called-interactively-p 'interactive))
(if (and (<= (length info-list) 1)
(help--binding-undefined-p (nth 2 (car info-list))))