summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2008-03-31 22:12:22 +0000
committerChong Yidong <cyd@stupidchicken.com>2008-03-31 22:12:22 +0000
commit2966eaebc8ee7de693cd5abbf4a5edfc08a59fb9 (patch)
tree11955890681e9a2b30a81f6bcd8b095459353d14 /lisp/emacs-lisp
parent00aa9ca4683ba2d0be7ce11e0cc35d14050c62d6 (diff)
downloademacs-2966eaebc8ee7de693cd5abbf4a5edfc08a59fb9.tar.gz
emacs-2966eaebc8ee7de693cd5abbf4a5edfc08a59fb9.tar.bz2
emacs-2966eaebc8ee7de693cd5abbf4a5edfc08a59fb9.zip
(find-function-search-for-symbol): Strip extension from .emacs.el to
make sure symbol is searched in .emacs too.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/find-func.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 9fe700d9b7f..2022d3ab7d4 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -231,8 +231,12 @@ The search is done in the source for library LIBRARY."
(setq symbol (get symbol 'definition-name)))
(if (string-match "\\`src/\\(.*\\.c\\)\\'" library)
(find-function-C-source symbol (match-string 1 library) type)
- (if (string-match "\\.el\\(c\\)\\'" library)
- (setq library (substring library 0 (match-beginning 1))))
+ (when (string-match "\\.el\\(c\\)\\'" library)
+ (setq library (substring library 0 (match-beginning 1))))
+ ;; Strip extension from .emacs.el to make sure symbol is searched in
+ ;; .emacs too.
+ (when (string-match "\\.emacs\\(.el\\)" library)
+ (setq library (substring library 0 (match-beginning 1))))
(let* ((filename (find-library-name library))
(regexp-symbol (cdr (assq type find-function-regexp-alist))))
(with-current-buffer (find-file-noselect filename)