summaryrefslogtreecommitdiff
path: root/lisp/help-mode.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2017-12-07 20:30:39 -0500
committerGlenn Morris <rgm@gnu.org>2017-12-07 20:30:39 -0500
commitc0a670a8b5833b81ef82c3f08ba9ddd68412ebe0 (patch)
treee9ab53c962e7e7dba117bef245d087b540e1e432 /lisp/help-mode.el
parent05720162c1616ca76093f5569e3081dc515993a9 (diff)
downloademacs-c0a670a8b5833b81ef82c3f08ba9ddd68412ebe0.tar.gz
* lisp/help-mode.el (help-function-def):
Allow help-make-xrefs to call with one argument. (Bug#29611)
Diffstat (limited to 'lisp/help-mode.el')
-rw-r--r--lisp/help-mode.el38
1 files changed, 18 insertions, 20 deletions
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index a98bce0138b..8bafa46aa97 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -192,20 +192,24 @@ The format is (FUNCTION ARGS...).")
(define-button-type 'help-function-def
:supertype 'help-xref
- 'help-function (lambda (fun file &optional type)
- (require 'find-func)
- (when (eq file 'C-source)
- (setq file
- (help-C-file-name (indirect-function fun) 'fun)))
- ;; Don't use find-function-noselect because it follows
- ;; aliases (which fails for built-in functions).
- (let ((location
- (find-function-search-for-symbol fun type file)))
- (pop-to-buffer (car location))
- (run-hooks 'find-function-after-hook)
- (if (cdr location)
- (goto-char (cdr location))
- (message "Unable to find location in file"))))
+ 'help-function (lambda (fun &optional file type)
+ (or file
+ (setq file (find-lisp-object-file-name fun type)))
+ (if (not file)
+ (message "Unable to find defining file")
+ (require 'find-func)
+ (when (eq file 'C-source)
+ (setq file
+ (help-C-file-name (indirect-function fun) 'fun)))
+ ;; Don't use find-function-noselect because it follows
+ ;; aliases (which fails for built-in functions).
+ (let ((location
+ (find-function-search-for-symbol fun type file)))
+ (pop-to-buffer (car location))
+ (run-hooks 'find-function-after-hook)
+ (if (cdr location)
+ (goto-char (cdr location))
+ (message "Unable to find location in file")))))
'help-echo (purecopy "mouse-2, RET: find function's definition"))
(define-button-type 'help-function-cmacro ; FIXME: Obsolete since 24.4.
@@ -495,12 +499,6 @@ that."
(help-xref-button 8 'help-face sym)))
((match-string 6)) ; nothing for `symbol'
((match-string 7)
- ;; this used:
- ;; #'(lambda (arg)
- ;; (let ((location
- ;; (find-function-noselect arg)))
- ;; (pop-to-buffer (car location))
- ;; (goto-char (cdr location))))
(help-xref-button 8 'help-function-def sym))
((cl-some (lambda (x) (funcall (nth 1 x) sym))
describe-symbol-backends)