diff options
author | Glenn Morris <rgm@gnu.org> | 2013-02-14 00:05:26 -0800 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2013-02-14 00:05:26 -0800 |
commit | 6a378d89c52530744c24bc92342904347331b758 (patch) | |
tree | b802c85b669d39bd125742bf085ce9abbf153de4 /lisp/help-fns.el | |
parent | 3ca2c0150d5e482b62d368cf1633ff1587af6ce0 (diff) | |
download | emacs-6a378d89c52530744c24bc92342904347331b758.tar.gz |
* help-fns.el (find-lisp-object-file-name): Give special treatment
to all ~/.foo.elc files, not just ~/.emacs.
Fixes: debbugs:9007
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r-- | lisp/help-fns.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 178096d1024..bdf86016844 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -336,11 +336,15 @@ suitable file is found, return nil." ;; If we don't have a file-name string by now, we lost. nil) ;; Now, `file-name' should have become an absolute file name. - ;; For files loaded from ~/.emacs.elc, try ~/.emacs. + ;; For files loaded from ~/.foo.elc, try ~/.foo. + ;; This applies to config files like ~/.emacs, + ;; which people sometimes compile. ((let (fn) - (and (string-equal file-name - (expand-file-name ".emacs.elc" "~")) - (file-readable-p (setq fn (expand-file-name ".emacs" "~"))) + (and (string-match "\\`\\..*\\.elc\\'" + (file-name-nondirectory file-name)) + (string-equal (file-name-directory file-name) + (file-name-as-directory (expand-file-name "~"))) + (file-readable-p (setq fn (file-name-sans-extension file-name))) fn))) ;; When the Elisp source file can be found in the install ;; directory, return the name of that file. |