From 375761b2435915b7b1d3bf10dbbe39b47d370177 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 5 Nov 2013 18:18:00 +0200 Subject: [PATCH] Fix bug #15805 with trying to load Lisp files before load-path is populated. lisp/startup.el (normal-top-level): Load the subdirs.el files before setting the locale environment. --- lisp/ChangeLog | 5 +++++ lisp/startup.el | 49 ++++++++++++++++++++++++++----------------------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6b7f169887c..0a7442d435e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-11-05 Eli Zaretskii + + * startup.el (normal-top-level): Load the subdirs.el files before + setting the locale environment. (Bug#15805) + 2013-11-05 Stefan Monnier * vc/vc-rcs.el (vc-rcs-parse): Make `gather' get e, b, and @-holes diff --git a/lisp/startup.el b/lisp/startup.el index 963ee687a3b..2394c73b879 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -490,6 +490,32 @@ It is the default value of the variable `top-level'." (message "Back to top level.") (setq command-line-processed t) + ;; Look in each dir in load-path for a subdirs.el file. If we + ;; find one, load it, which will add the appropriate subdirs of + ;; that dir into load-path. This needs to be done before setting + ;; the locale environment, because the latter might need to load + ;; some support files. + ;; Look for a leim-list.el file too. Loading it will register + ;; available input methods. + (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)) + ;; 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. + (setq tail (cdr tail)))) + ;; Set the default strings to display in mode line for end-of-line ;; formats that aren't native to this platform. This should be ;; done before calling set-locale-environment, as the latter might @@ -557,29 +583,6 @@ It is the default value of the variable `top-level'." ;; `user-full-name' is now known; reset its standard-value here. (put 'user-full-name 'standard-value (list (default-value 'user-full-name))) - ;; Look in each dir in load-path for a subdirs.el file. - ;; If we find one, load it, which will add the appropriate subdirs - ;; 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) - (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)) - ;; 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. - (setq tail (cdr tail)))) ;; If the PWD environment variable isn't accurate, delete it. (let ((pwd (getenv "PWD"))) (and (stringp pwd) -- 2.39.2