From: Chong Yidong Date: Tue, 21 Dec 2010 06:45:11 +0000 (+0800) Subject: * help-fns.el (find-lisp-object-file-name): Locate .emacs from .emacs.elc (Bug#7530). X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~1322^2~278^2~74 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d78cdcf74eab757f3f06826925df7835efad66dc;p=emacs.git * help-fns.el (find-lisp-object-file-name): Locate .emacs from .emacs.elc (Bug#7530). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b3b9295247f..48cd0058521 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2010-12-21 Chong Yidong + * help-fns.el (find-lisp-object-file-name): Locate .emacs from + .emacs.elc (Bug#7530). + * wid-edit.el (widget-image-find): Remove bogus :ascent spec from image spec (Bug#7480). diff --git a/lisp/help-fns.el b/lisp/help-fns.el index d49b06a16e6..b100a4e471d 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -289,13 +289,19 @@ suitable file is found, return nil." ((not (stringp file-name)) ;; 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. + ((let (fn) + (and (string-equal file-name + (expand-file-name ".emacs.elc" "~")) + (file-readable-p (setq fn (expand-file-name ".emacs" "~"))) + fn))) + ;; When the Elisp source file can be found in the install + ;; directory, return the name of that file. ((let ((lib-name (if (string-match "[.]elc\\'" file-name) (substring-no-properties file-name 0 -1) file-name))) - ;; When the Elisp source file can be found in the install - ;; directory return the name of that file - `file-name' should - ;; have become an absolute file name ny now. (or (and (file-readable-p lib-name) lib-name) ;; The library might be compressed. (and (file-readable-p (concat lib-name ".gz")) lib-name))))