emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d5c399b 1/2: Make C-h S in Customize buffers work more reliably


From: Lars Ingebrigtsen
Subject: master d5c399b 1/2: Make C-h S in Customize buffers work more reliably
Date: Sun, 6 Sep 2020 10:57:03 -0400 (EDT)

branch: master
commit d5c399b4d41f48193bdef9571ef04d9a0531b905
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/cus-edit.el  | 2 +-
 lisp/info-look.el | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 7153ba4..3557dce 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 4e379ca..40f7f60 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]