aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2010-12-21 14:45:11 +0800
committerChong Yidong2010-12-21 14:45:11 +0800
commitd78cdcf74eab757f3f06826925df7835efad66dc (patch)
treea0f3c2b05f0a743087d0de710de35f7d7027f836
parent6bfa51ba88183f82128a5d06e86e640c27b4707f (diff)
downloademacs-d78cdcf74eab757f3f06826925df7835efad66dc.tar.gz
emacs-d78cdcf74eab757f3f06826925df7835efad66dc.zip
* help-fns.el (find-lisp-object-file-name): Locate .emacs from .emacs.elc (Bug#7530).
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/help-fns.el12
2 files changed, 12 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b3b9295247f..48cd0058521 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12010-12-21 Chong Yidong <cyd@stupidchicken.com> 12010-12-21 Chong Yidong <cyd@stupidchicken.com>
2 2
3 * help-fns.el (find-lisp-object-file-name): Locate .emacs from
4 .emacs.elc (Bug#7530).
5
3 * wid-edit.el (widget-image-find): Remove bogus :ascent spec from 6 * wid-edit.el (widget-image-find): Remove bogus :ascent spec from
4 image spec (Bug#7480). 7 image spec (Bug#7480).
5 8
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."
289 ((not (stringp file-name)) 289 ((not (stringp file-name))
290 ;; If we don't have a file-name string by now, we lost. 290 ;; If we don't have a file-name string by now, we lost.
291 nil) 291 nil)
292 ;; Now, `file-name' should have become an absolute file name.
293 ;; For files loaded from ~/.emacs.elc, try ~/.emacs.
294 ((let (fn)
295 (and (string-equal file-name
296 (expand-file-name ".emacs.elc" "~"))
297 (file-readable-p (setq fn (expand-file-name ".emacs" "~")))
298 fn)))
299 ;; When the Elisp source file can be found in the install
300 ;; directory, return the name of that file.
292 ((let ((lib-name 301 ((let ((lib-name
293 (if (string-match "[.]elc\\'" file-name) 302 (if (string-match "[.]elc\\'" file-name)
294 (substring-no-properties file-name 0 -1) 303 (substring-no-properties file-name 0 -1)
295 file-name))) 304 file-name)))
296 ;; When the Elisp source file can be found in the install
297 ;; directory return the name of that file - `file-name' should
298 ;; have become an absolute file name ny now.
299 (or (and (file-readable-p lib-name) lib-name) 305 (or (and (file-readable-p lib-name) lib-name)
300 ;; The library might be compressed. 306 ;; The library might be compressed.
301 (and (file-readable-p (concat lib-name ".gz")) lib-name)))) 307 (and (file-readable-p (concat lib-name ".gz")) lib-name))))