]> git.eshelyaron.com Git - emacs.git/commitdiff
Make the `s' command in *Help* work for Lisp variables defined in C
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 19 Jul 2021 16:35:09 +0000 (18:35 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 19 Jul 2021 16:35:12 +0000 (18:35 +0200)
* lisp/help-fns.el (describe-variable): Store the type.
* lisp/help-mode.el (help-view-source): Use the type.  This fixes
the problem when looking for a variable defined in a C file.

lisp/help-fns.el
lisp/help-mode.el

index 81d7f23fe3c5e880382eb890c6d98f02d377d695..7641774615d178f97341116c5a2a0342ea1c47e0 100644 (file)
@@ -1078,6 +1078,7 @@ it is displayed along with the global value."
                           (with-current-buffer standard-output
                              (setq help-mode--current-data
                                    (list :symbol variable
+                                         :type 'variable
                                          :file file-name))
                              (save-excursion
                               (re-search-backward (substitute-command-keys
@@ -1089,7 +1090,8 @@ it is displayed along with the global value."
                               "It is void as a variable."
                              "Its "))
                       (with-current-buffer standard-output
-                         (setq help-mode--current-data (list :symbol variable)))
+                         (setq help-mode--current-data (list :symbol variable
+                                                             :type 'variable)))
                        (if valvoid
                           " is void as a variable."
                          (substitute-command-keys "'s ")))))
index 4e73551cfb31d5956f008fe53e8b8e3029ee7090..3976a9ac4e5b21728453a4d2a7e9829916944ad3 100644 (file)
@@ -738,8 +738,10 @@ See `help-make-xrefs'."
   (interactive nil help-mode)
   (unless (plist-get help-mode--current-data :file)
     (error "Source file for the current help item is not defined"))
-  (help-function-def--button-function (plist-get help-mode--current-data :symbol)
-                                      (plist-get help-mode--current-data :file)))
+  (help-function-def--button-function
+   (plist-get help-mode--current-data :symbol)
+   (plist-get help-mode--current-data :file)
+   (plist-get help-mode--current-data :type)))
 
 (defun help-goto-info ()
   "View the *info* node of the current help item."