diff options
| author | Glenn Morris | 2017-12-07 20:30:39 -0500 |
|---|---|---|
| committer | Glenn Morris | 2017-12-07 20:30:39 -0500 |
| commit | c0a670a8b5833b81ef82c3f08ba9ddd68412ebe0 (patch) | |
| tree | e9ab53c962e7e7dba117bef245d087b540e1e432 | |
| parent | 05720162c1616ca76093f5569e3081dc515993a9 (diff) | |
| download | emacs-c0a670a8b5833b81ef82c3f08ba9ddd68412ebe0.tar.gz emacs-c0a670a8b5833b81ef82c3f08ba9ddd68412ebe0.zip | |
* lisp/help-mode.el (help-function-def):
Allow help-make-xrefs to call with one argument. (Bug#29611)
| -rw-r--r-- | lisp/help-mode.el | 38 |
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...).") | |||
| 192 | 192 | ||
| 193 | (define-button-type 'help-function-def | 193 | (define-button-type 'help-function-def |
| 194 | :supertype 'help-xref | 194 | :supertype 'help-xref |
| 195 | 'help-function (lambda (fun file &optional type) | 195 | 'help-function (lambda (fun &optional file type) |
| 196 | (require 'find-func) | 196 | (or file |
| 197 | (when (eq file 'C-source) | 197 | (setq file (find-lisp-object-file-name fun type))) |
| 198 | (setq file | 198 | (if (not file) |
| 199 | (help-C-file-name (indirect-function fun) 'fun))) | 199 | (message "Unable to find defining file") |
| 200 | ;; Don't use find-function-noselect because it follows | 200 | (require 'find-func) |
| 201 | ;; aliases (which fails for built-in functions). | 201 | (when (eq file 'C-source) |
| 202 | (let ((location | 202 | (setq file |
| 203 | (find-function-search-for-symbol fun type file))) | 203 | (help-C-file-name (indirect-function fun) 'fun))) |
| 204 | (pop-to-buffer (car location)) | 204 | ;; Don't use find-function-noselect because it follows |
| 205 | (run-hooks 'find-function-after-hook) | 205 | ;; aliases (which fails for built-in functions). |
| 206 | (if (cdr location) | 206 | (let ((location |
| 207 | (goto-char (cdr location)) | 207 | (find-function-search-for-symbol fun type file))) |
| 208 | (message "Unable to find location in file")))) | 208 | (pop-to-buffer (car location)) |
| 209 | (run-hooks 'find-function-after-hook) | ||
| 210 | (if (cdr location) | ||
| 211 | (goto-char (cdr location)) | ||
| 212 | (message "Unable to find location in file"))))) | ||
| 209 | 'help-echo (purecopy "mouse-2, RET: find function's definition")) | 213 | 'help-echo (purecopy "mouse-2, RET: find function's definition")) |
| 210 | 214 | ||
| 211 | (define-button-type 'help-function-cmacro ; FIXME: Obsolete since 24.4. | 215 | (define-button-type 'help-function-cmacro ; FIXME: Obsolete since 24.4. |
| @@ -495,12 +499,6 @@ that." | |||
| 495 | (help-xref-button 8 'help-face sym))) | 499 | (help-xref-button 8 'help-face sym))) |
| 496 | ((match-string 6)) ; nothing for `symbol' | 500 | ((match-string 6)) ; nothing for `symbol' |
| 497 | ((match-string 7) | 501 | ((match-string 7) |
| 498 | ;; this used: | ||
| 499 | ;; #'(lambda (arg) | ||
| 500 | ;; (let ((location | ||
| 501 | ;; (find-function-noselect arg))) | ||
| 502 | ;; (pop-to-buffer (car location)) | ||
| 503 | ;; (goto-char (cdr location)))) | ||
| 504 | (help-xref-button 8 'help-function-def sym)) | 502 | (help-xref-button 8 'help-function-def sym)) |
| 505 | ((cl-some (lambda (x) (funcall (nth 1 x) sym)) | 503 | ((cl-some (lambda (x) (funcall (nth 1 x) sym)) |
| 506 | describe-symbol-backends) | 504 | describe-symbol-backends) |