* help-fns.el (find-lisp-object-file-name): Give special treatment

to all ~/.foo.elc files, not just ~/.emacs.

Fixes: debbugs:9007
This commit is contained in:
Glenn Morris 2013-02-14 00:05:26 -08:00
parent 3ca2c0150d
commit 6a378d89c5
2 changed files with 13 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2013-02-14 Glenn Morris <rgm@gnu.org>
* help-fns.el (find-lisp-object-file-name): Give special treatment
to all ~/.foo.elc files, not just ~/.emacs. (Bug#9007)
2013-02-14 David Biesack <sasdjb@d72933.na.sas.com> (tiny change)
* net/quickurl.el (quickurl-save-urls):

View file

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