summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-09-06 14:15:41 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-09-06 16:56:54 +0200
commitd5c399b4d41f48193bdef9571ef04d9a0531b905 (patch)
tree804f37a4a9c2f8d6eeb66b62a3bb0a903f68eb5d
parent92bec37d56099940edd07e73bed607765e1c55c6 (diff)
downloademacs-d5c399b4d41f48193bdef9571ef04d9a0531b905.tar.gz
Make C-h S in Customize buffers work more reliably
* lisp/cus-edit.el (custom-unlispify-menu-entry): Put a property on the returned string so that we can determine what the symbol was after the fact. * lisp/info-look.el (info-lookup-guess-default*): Allow lambda forms as rules. (:mode): Use the stored symbol. (info-lookup-guess-custom-symbol): No longer used; mark as obsolete (bug#41905).
-rw-r--r--lisp/cus-edit.el2
-rw-r--r--lisp/info-look.el7
2 files changed, 6 insertions, 3 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 7153ba40e13..3557dce5854 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -561,7 +561,7 @@ value unless you are sure you know what it does."
(unless no-suffix
(goto-char (point-max))
(insert "..."))
- (buffer-string)))))
+ (propertize (buffer-string) 'custom-data symbol)))))
(defcustom custom-unlispify-tag-names t
"Display tag names as words instead of symbols if non-nil."
diff --git a/lisp/info-look.el b/lisp/info-look.el
index 4e379cadef1..40f7f6003e7 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -557,7 +557,7 @@ Return nil if there is nothing appropriate in the buffer near point."
(info-lookup->regexp topic mode)))
(start (point)) end regexp subexp result)
(save-excursion
- (if (symbolp rule)
+ (if (functionp rule)
(setq result (funcall rule))
(if (consp rule)
(setq regexp (car rule)
@@ -610,6 +610,7 @@ Return nil if there is nothing appropriate in the buffer near point."
(defun info-lookup-guess-custom-symbol ()
"Get symbol at point in custom buffers."
+ (declare (obsolete nil "28.1"))
(condition-case nil
(save-excursion
(let ((case-fold-search t)
@@ -1065,7 +1066,9 @@ Return nil if there is nothing appropriate in the buffer near point."
:mode 'Custom-mode
:ignore-case t
:regexp "[^][()`'‘’,:\" \t\n]+"
- :parse-rule 'info-lookup-guess-custom-symbol
+ :parse-rule (lambda ()
+ (when-let ((symbol (get-text-property (point) 'custom-data)))
+ (symbol-name symbol)))
:other-modes '(emacs-lisp-mode))
(info-lookup-maybe-add-help