1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-10 00:00:39 -08:00

(find-function-search-for-symbol): Strip extension from .emacs.el to

make sure symbol is searched in .emacs too.
This commit is contained in:
Chong Yidong 2008-03-31 22:12:22 +00:00
parent 00aa9ca468
commit 2966eaebc8

View file

@ -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)