Look for leim-list.el files in fewer places at startup
authorGlenn Morris <rgm@gnu.org>
Mon, 9 Apr 2012 06:58:41 +0000 (23:58 -0700)
committerGlenn Morris <rgm@gnu.org>
Mon, 9 Apr 2012 06:58:41 +0000 (23:58 -0700)
* lisp/startup.el (normal-top-level):
Don't look for leim-list.el in places where it will not be found.

Fixes: debbugs:910

etc/NEWS
lisp/ChangeLog
lisp/startup.el

index ae6ba8d..16357f3 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -24,6 +24,11 @@ so we will look at it and add it to the manual.
 * Installation Changes in Emacs 24.2
 \f
 * Startup Changes in Emacs 24.2
+
+** Emacs no longer searches for `leim-list.el' files beneath the standard
+lisp/ directory.  There should not be any there anyway.  If you have
+been adding them there, put them somewhere else, eg site-lisp.
+
 \f
 * Changes in Emacs 24.2
 
index ca2812b..ed4470b 100644 (file)
@@ -1,5 +1,8 @@
 2012-04-09  Glenn Morris  <rgm@gnu.org>
 
+       * startup.el (normal-top-level): Don't look for leim-list.el
+       in places where it will not be found.  (Bug#910)
+
        * international/mule-cmds.el (set-default-coding-systems):
        * files.el (normal-mode):
        Remove guarded calls to ucs-set-table-for-input.  (Bug#9821)
index 37e4f55..518b53c 100644 (file)
@@ -490,13 +490,20 @@ It is the default value of the variable `top-level'."
     ;; of that dir into load-path,
     ;; Look for a leim-list.el file too.  Loading it will register
     ;; available input methods.
-    (let ((tail load-path) dir)
+    (let ((tail load-path)
+          (lispdir (expand-file-name "../lisp" data-directory))
+         ;; For out-of-tree builds, leim-list is generated in the build dir.
+;;;          (leimdir (expand-file-name "../leim" doc-directory))
+          dir)
       (while tail
         (setq dir (car tail))
         (let ((default-directory dir))
           (load (expand-file-name "subdirs.el") t t t))
-        (let ((default-directory dir))
-          (load (expand-file-name "leim-list.el") t t t))
+       ;; Do not scan standard directories that won't contain a leim-list.el.
+       ;; http://lists.gnu.org/archive/html/emacs-devel/2009-10/msg00502.html
+       (or (string-match (concat "\\`" lispdir) dir)
+           (let ((default-directory dir))
+             (load (expand-file-name "leim-list.el") t t t)))
         ;; We don't use a dolist loop and we put this "setq-cdr" command at
         ;; the end, because the subdirs.el files may add elements to the end
         ;; of load-path and we want to take it into account.