emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111779: * help-fns.el (find-lisp-obj


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111779: * help-fns.el (find-lisp-object-file-name): Give special treatment
Date: Thu, 14 Feb 2013 00:05:26 -0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111779
fixes bug: http://debbugs.gnu.org/9007
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Thu 2013-02-14 00:05:26 -0800
message:
  * help-fns.el (find-lisp-object-file-name): Give special treatment
  to all ~/.foo.elc files, not just ~/.emacs.
modified:
  lisp/ChangeLog
  lisp/help-fns.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-02-14 07:50:57 +0000
+++ b/lisp/ChangeLog    2013-02-14 08:05:26 +0000
@@ -1,3 +1,8 @@
+2013-02-14  Glenn Morris  <address@hidden>
+
+       * 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  <address@hidden>  (tiny change)
 
        * net/quickurl.el (quickurl-save-urls):

=== modified file 'lisp/help-fns.el'
--- a/lisp/help-fns.el  2013-02-01 15:56:22 +0000
+++ b/lisp/help-fns.el  2013-02-14 08:05:26 +0000
@@ -336,11 +336,15 @@
       ;; 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]