Preload leim-list.el
authorGlenn Morris <rgm@gnu.org>
Tue, 26 Nov 2013 01:06:23 +0000 (20:06 -0500)
committerGlenn Morris <rgm@gnu.org>
Tue, 26 Nov 2013 01:06:23 +0000 (20:06 -0500)
* Makefile.in (abs_builddir): New, set by configure.
(buildlisppath): Add leim/.
(epaths-force-w32): Set BLD.

* lisp/loadup.el: Load leim-list.el when found.

* lisp/startup.el (normal-top-level): Skip re-loading leim/leim-list.el.

* nt/epaths.nt (PATH_DUMPLOADSEARCH): Add leim/.

* src/callproc.c (init_callproc): Don't assume PATH_DUMPLOADSEARCH
is a single directory.

* src/epaths.in (PATH_DUMPLOADSEARCH): Add leim/.

Fixes: debbugs:4789

ChangeLog
Makefile.in
lisp/ChangeLog
lisp/loadup.el
lisp/startup.el
nt/ChangeLog
nt/epaths.nt
src/ChangeLog
src/callproc.c
src/epaths.in

index 0c9dedf..9285cc1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-11-26  Glenn Morris  <rgm@gnu.org>
+
+       Preload leim-list.el.
+       * Makefile.in (abs_builddir): New, set by configure.
+       (buildlisppath): Add leim/.
+       (epaths-force-w32): Set BLD.
+
 2013-11-21  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix some dependency problems that cause unnecessary recompiles.
index 1848c41..969a224 100644 (file)
@@ -164,6 +164,7 @@ bitmapdir=@bitmapdir@
 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
 srcdir=@srcdir@
 abs_srcdir=@abs_srcdir@
+abs_builddir=@abs_builddir@
 # MinGW CPPFLAGS may use this.
 abs_top_srcdir=@abs_top_srcdir@
 
@@ -213,13 +214,16 @@ locallisppath=@locallisppath@
 # The default is ${locallisppath}:${standardlisppath}.
 lisppath=@lisppath@
 
-# Where Emacs will search for its lisp files while
-# building.  This is only used during the process of
-# compiling Emacs, to help Emacs find its lisp files
-# before they've been installed in their final location.
+# Where Emacs will search for its lisp files while building.
+# This is only used during the process of compiling Emacs,
+# to help Emacs find its lisp files before they've been installed
+# in their final location.
 # This should be a colon-separated list of directories.
-# Normally it points to the lisp/ directory in the sources.
-buildlisppath=${abs_srcdir}/lisp
+# Normally it points to the lisp/ directory in the sources and
+# the leim/ directory in the build tree.
+# NB lread.c relies on lisp/ being first here.
+# TODO generate leim in srcdir also, prebuild in tarfiles.
+buildlisppath=${abs_srcdir}/lisp:${abs_builddir}/leim
 
 # Where to install the other architecture-independent
 # data files distributed with Emacs (like the tutorial,
@@ -337,6 +341,7 @@ msys_sed_sh_escape=sed -e 's/[];$$*.^[]/\\\\&/g'
 # '/foo/bar').
 epaths-force-w32: FRC
        @(w32srcdir=`${srcdir}/build-aux/msys-to-w32 "${srcdir}"`; \
+         w32blddir=`${srcdir}/build-aux/msys-to-w32 .`; \
          w32prefix=`${srcdir}/build-aux/msys-to-w32 "${prefix}" N`; \
          w32prefixpattern=`echo "${w32prefix}" | ${msys_sed_sh_escape}` ; \
          w32locallisppath=`${srcdir}/build-aux/msys-to-w32 "${locallisppath}" N ":" "\\;" | ${msys_w32prefix_subst}` ; \
@@ -344,6 +349,7 @@ epaths-force-w32: FRC
          -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "'"$${w32locallisppath}"'";' \
          -e '/^.*#/s/@VER@/${version}/g'                       \
          -e '/^.*#/s/@CFG@/${configuration}/g'                 \
+         -e '/^.*#/s|@BLD@|$${w32blddir}|g'                    \
          -e "/^.*#/s|@SRC@|$${w32srcdir}|g") &&                \
        ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
 
index 6f5519e..fd41ed8 100644 (file)
@@ -1,3 +1,9 @@
+2013-11-26  Glenn Morris  <rgm@gnu.org>
+
+       Preload leim-list.el.  (Bug#4789)
+       * loadup.el: Load leim-list.el when found.
+       * startup.el (normal-top-level): Skip re-loading leim/leim-list.el.
+
 2013-11-25  Bozhidar Batsov  <bozhidar@batsov.com>
 
        * emacs-lisp/bytecomp.el (byte-compile-form): Fix a typo.
index 98e3b87..fe4fe1f 100644 (file)
@@ -1,7 +1,7 @@
 ;;; loadup.el --- load up standardly loaded Lisp files for Emacs
 
-;; Copyright (C) 1985-1986, 1992, 1994, 2001-2013 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992, 1994, 2001-2013
+;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: internal
@@ -98,6 +98,8 @@
 (load "env")
 (load "format")
 (load "bindings")
+;; This sets temporary-file-directory, used by eg
+;; auto-save-file-name-transforms in files.el.
 (load "cus-start")
 (load "window")  ; Needed here for `replace-buffer-in-windows'.
 (setq load-source-file-function 'load-with-code-conversion)
 (load "vc/ediff-hook")
 (if (not (eq system-type 'ms-dos)) (load "tooltip"))
 
-;If you want additional libraries to be preloaded and their
-;doc strings kept in the DOC file rather than in core,
-;you may load them with a "site-load.el" file.
-;But you must also cause them to be scanned when the DOC file
-;is generated.
-;For other systems, you must edit ../src/Makefile.in.
+;; This file doesn't exist when building a development version of Emacs
+;; from the repository.  It is generated just after temacs is built.
+(load "leim-list.el" t)
+
+;; If you want additional libraries to be preloaded and their
+;; doc strings kept in the DOC file rather than in core,
+;; you may load them with a "site-load.el" file.
+;; But you must also cause them to be scanned when the DOC file
+;; is generated.
+;; For other systems, you must edit ../src/Makefile.in.
 (load "site-load" t)
 
 ;; Make sure default-directory is unibyte when dumping.  This is
index 88ec1f3..0b1c55b 100644 (file)
@@ -499,18 +499,23 @@ It is the default value of the variable `top-level'."
     ;; 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))
+          ;; 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)))
+        ;; 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
+        ;; Also skip leim/leim-list.el, since we preloaded that one.
+        (or (string-prefix-p lispdir dir)
+            ;; Not supposed to be subdirs.el in leim, but someone
+            ;; might have added one and be keeping their own leim-list
+            ;; files in subdirs of leim.
+            (string-equal leimdir 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.
index 1b766f0..61a8499 100644 (file)
@@ -1,3 +1,7 @@
+2013-11-26  Glenn Morris  <rgm@gnu.org>
+
+       * epaths.nt (PATH_DUMPLOADSEARCH): Add leim/.
+
 2013-11-12  Dani Moncayo  <dmoncayo@gmail.com>
 
        * msysconfig.sh: Remove.
index 6e29747..553d80c 100644 (file)
@@ -12,8 +12,7 @@
    the host system (e.g., i686-pc-mingw32), and @SRC@ by the root of
    the Emacs source tree used to build Emacs.  */
 /*
-Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software
-Foundation, Inc.
+Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -51,10 +50,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #define PATH_SITELOADSEARCH "%emacs_dir%/share/emacs/@VER@/site-lisp;%emacs_dir%/share/emacs/site-lisp"
 
 /* Like PATH_LOADSEARCH, but used only during the build process
-   when Emacs is dumping.  Configure (using "make epaths-force") sets
-   this to $buildlisppath, which normally has the value: <srcdir>/lisp.
+   when Emacs is dumping.  Configure (using "make epaths-force-w32") sets
+   this to $buildlisppath, which normally has the value:
+   <srcdir>/lisp;<builddir>/leim.
 */
-#define PATH_DUMPLOADSEARCH "@SRC@/lisp"
+#define PATH_DUMPLOADSEARCH "@SRC@/lisp;@BLD@/leim"
 
 /* The extra search path for programs to invoke.  This is appended to
    whatever the PATH environment variable says to set the Lisp
index bf4392d..9a32c17 100644 (file)
@@ -1,3 +1,10 @@
+2013-11-26  Glenn Morris  <rgm@gnu.org>
+
+       Preload leim-list.el.
+       * epaths.in (PATH_DUMPLOADSEARCH): Add leim/.
+       * callproc.c (init_callproc): Don't assume PATH_DUMPLOADSEARCH
+       is a single directory.
+
 2013-11-25  Paul Eggert  <eggert@cs.ucla.edu>
 
        bool-vector-subsetp is now the normal direction (Bug#15912).
index dfe315a..b44f680 100644 (file)
@@ -1607,16 +1607,16 @@ init_callproc (void)
   if (data_dir == 0)
     {
       Lisp_Object tem, tem1, srcdir;
+      Lisp_Object lispdir = Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH, 0));
+
+      srcdir = Fexpand_file_name (build_string ("../src/"), lispdir);
 
-      srcdir = Fexpand_file_name (build_string ("../src/"),
-                                 build_unibyte_string (PATH_DUMPLOADSEARCH));
       tem = Fexpand_file_name (build_string ("GNU"), Vdata_directory);
       tem1 = Ffile_exists_p (tem);
       if (!NILP (Fequal (srcdir, Vinvocation_directory)) || NILP (tem1))
        {
          Lisp_Object newdir;
-         newdir = Fexpand_file_name (build_string ("../etc/"),
-                                     build_unibyte_string (PATH_DUMPLOADSEARCH));
+         newdir = Fexpand_file_name (build_string ("../etc/"), lispdir);
          tem = Fexpand_file_name (build_string ("GNU"), newdir);
          tem1 = Ffile_exists_p (tem);
          if (!NILP (tem1))
index 1f5701e..02e7559 100644 (file)
@@ -1,7 +1,6 @@
 /* Hey Emacs, this is -*- C -*- code!  */
 /*
-Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software
-Foundation, Inc.
+Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -42,9 +41,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* Like PATH_LOADSEARCH, but used only during the build process
    when Emacs is dumping.  Configure (using "make epaths-force") sets
-   this to $buildlisppath, which normally has the value: <srcdir>/lisp.
+   this to $buildlisppath, which normally has the value:
+   <srcdir>/lisp:<builddir>/leim.
 */
-#define PATH_DUMPLOADSEARCH "../lisp"
+#define PATH_DUMPLOADSEARCH "../lisp:../leim"
 
 /* The extra search path for programs to invoke.  This is appended to
    whatever the PATH environment variable says to set the Lisp