]> git.eshelyaron.com Git - emacs.git/commitdiff
* custom.el (custom-delayed-init-variables): New var.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 11 Sep 2009 21:25:44 +0000 (21:25 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 11 Sep 2009 21:25:44 +0000 (21:25 +0000)
(custom-initialize-delay): New function.
* startup.el (command-line): "Re"evaluate all vars in
custom-delayed-init-variables.  Don't reevaluate abbrev-file-name
explicitly any more.
* abbrev.el (abbrev-file-name): Use custom-initialize-delay
to avoid creating a ~/.emacs.d at build-time (bug#4347).

lisp/ChangeLog
lisp/abbrev.el
lisp/custom.el
lisp/startup.el

index 64b3612c7f47fa6a63fb152a02010c8902757528..f2792ed6f1635af0457eb13d81969b0597687060 100644 (file)
@@ -1,6 +1,14 @@
 2009-09-11  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-       * proced.el (proced-mode-map): Prefer "m" for proced-mark.
+       * custom.el (custom-delayed-init-variables): New var.
+       (custom-initialize-delay): New function.
+       * startup.el (command-line): "Re"evaluate all vars in
+       custom-delayed-init-variables.  Don't reevaluate abbrev-file-name
+       explicitly any more.
+       * abbrev.el (abbrev-file-name): Use custom-initialize-delay
+       to avoid creating a ~/.emacs.d at build-time (bug#4347).
+
+       * proced.el (proced-mode-map): Prefer "m" for proced-mark (bug#4362).
 
 2009-09-11  Nick Roberts  <nickrob@snap.net.nz>
 
index 6441381d171e304bd1cf1c03db2bb024dd53fa56..f45f4c1860c3b187d3a364ec335222877c405c6d 100644 (file)
@@ -40,7 +40,8 @@
 
 (defcustom abbrev-file-name
   (locate-user-emacs-file "abbrev_defs" ".abbrev_defs")
-  "Default name of file to read abbrevs from."
+  "Default name of file from which to read abbrevs."
+  :initialize 'custom-initialize-delay
   :type 'file)
 
 (defcustom only-global-abbrevs nil
index 07533253d767586e4a7c9d61146899d3d65d0e19..c6b8f2950e48bf99966927073fe3cfe93a6d28af 100644 (file)
@@ -130,6 +130,17 @@ For the standard setting, use `set-default'."
        (t
         (set-default symbol (eval value)))))
 
+(defvar custom-delayed-init-variables nil
+  "List of variables whose initialization is pending.")
+
+(defun custom-initialize-delay (symbol value)
+  "Delay initialization of SYMBOL to the next Emacs start.
+This is used in files that are preloaded, so that the initialization is
+done in the run-time context rather than the build-time context.
+This also has the side-effect that the (delayed) initialization is performed
+with the :setter."
+  (push symbol custom-delayed-init-variables))
+
 (defun custom-declare-variable (symbol default doc &rest args)
   "Like `defcustom', but SYMBOL and DEFAULT are evaluated as normal arguments.
 DEFAULT should be an expression to evaluate to compute the default value,
index 5802b33b6435d03e4dadcea56032540a89908912..fcb35b95f02100ddadbe9d4aa47d48663bc272b5 100644 (file)
@@ -703,7 +703,6 @@ opening the first frame (e.g. open a connection to an X server).")
   (custom-reevaluate-setting 'temporary-file-directory)
   (custom-reevaluate-setting 'small-temporary-file-directory)
   (custom-reevaluate-setting 'auto-save-file-name-transforms)
-  (custom-reevaluate-setting 'abbrev-file-name)
   ;; Force recomputation, in case it was computed during the dump.
   (setq abbreviated-home-dir nil)
 
@@ -909,6 +908,14 @@ opening the first frame (e.g. open a connection to an X server).")
       ;; Otherwise, enable tool-bar-mode.
       (tool-bar-mode 1)))
 
+  ;; Re-evaluate predefined variables whose initial value depends on
+  ;; the runtime context.
+  (mapc 'custom-reevaluate-setting
+        ;; Initialize them in the same order they were loaded, in case there
+        ;; are dependencies between them.
+        (prog1 (nreverse custom-delayed-init-variables)
+          (setq custom-delayed-init-variables nil)))
+  
   ;; Can't do this init in defcustom because the relevant variables
   ;; are not set.
   (custom-reevaluate-setting 'blink-cursor-mode)