Make the `s' command in *Help* work for Lisp variables defined in C

* 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.
This commit is contained in:
Lars Ingebrigtsen 2021-07-19 18:35:09 +02:00
parent f5640a3bdf
commit 072512414e
2 changed files with 7 additions and 3 deletions

View 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 ")))))

View 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."