changeset 80408:7f06131fe112

(find-function-search-for-symbol): Strip extension from .emacs.el to make sure symbol is searched in .emacs too.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 31 Mar 2008 22:12:22 +0000
parents 5f25ace3fc90
children 112d6ca71883
files lisp/emacs-lisp/find-func.el
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/find-func.el	Mon Mar 31 22:11:58 2008 +0000
+++ b/lisp/emacs-lisp/find-func.el	Mon Mar 31 22:12:22 2008 +0000
@@ -231,8 +231,12 @@
     (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)