summaryrefslogtreecommitdiff
path: root/lisp/custom.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2009-09-11 21:25:44 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2009-09-11 21:25:44 +0000
commit790d02708fd44b5a4953a6f155a1e2f07658d7f7 (patch)
tree6d7fb408b1b3cf00f0fa408b3dfde94ea337eca7 /lisp/custom.el
parentb9631bb22da502014c866d1f7c6c3d9cbac1c6f8 (diff)
downloademacs-790d02708fd44b5a4953a6f155a1e2f07658d7f7.tar.gz
* 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).
Diffstat (limited to 'lisp/custom.el')
-rw-r--r--lisp/custom.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/custom.el b/lisp/custom.el
index 07533253d76..c6b8f2950e4 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -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,