summaryrefslogtreecommitdiff
path: root/lisp/help-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2004-04-29 18:43:32 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2004-04-29 18:43:32 +0000
commitc57d9b376db95ee628d803c3745c2acd6c076f06 (patch)
tree8572d9c56202316e51034bc3720f906475642154 /lisp/help-mode.el
parent5037c49784f035a425c0ffb50f916833c243bb4f (diff)
downloademacs-c57d9b376db95ee628d803c3745c2acd6c076f06.tar.gz
(help-function-def, help-variable-def):
Use the new find-function-search-for-symbol functionality. Allow FILE to be `C-source'.
Diffstat (limited to 'lisp/help-mode.el')
-rw-r--r--lisp/help-mode.el17
1 files changed, 7 insertions, 10 deletions
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 4499f5c48cb..1f1b529c8ef 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -147,14 +147,13 @@ The format is (FUNCTION ARGS...).")
:supertype 'help-xref
'help-function (lambda (fun 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
- (cond
- ((bufferp file) (cons file fun))
- ((string-match "\\`src/\\(.*\\.c\\)" file)
- (help-find-C-source fun (match-string 1 file) 'fun))
- (t (find-function-search-for-symbol fun nil file)))))
+ (find-function-search-for-symbol fun nil file)))
(pop-to-buffer (car location))
(goto-char (cdr location))))
'help-echo (purecopy "mouse-2, RET: find function's definition"))
@@ -162,11 +161,9 @@ The format is (FUNCTION ARGS...).")
(define-button-type 'help-variable-def
:supertype 'help-xref
'help-function (lambda (var &optional file)
- (let ((location
- (cond
- ((string-match "\\`src/\\(.*\\.c\\)" file)
- (help-find-C-source var (match-string 1 file) 'var))
- (t (find-variable-noselect var file)))))
+ (when (eq file 'C-source)
+ (setq file (help-C-file-name var 'var)))
+ (let ((location (find-variable-noselect var file)))
(pop-to-buffer (car location))
(goto-char (cdr location))))
'help-echo (purecopy"mouse-2, RET: find variable's definition"))