aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2009-09-11 21:25:44 +0000
committerStefan Monnier2009-09-11 21:25:44 +0000
commit790d02708fd44b5a4953a6f155a1e2f07658d7f7 (patch)
tree6d7fb408b1b3cf00f0fa408b3dfde94ea337eca7
parentb9631bb22da502014c866d1f7c6c3d9cbac1c6f8 (diff)
downloademacs-790d02708fd44b5a4953a6f155a1e2f07658d7f7.tar.gz
emacs-790d02708fd44b5a4953a6f155a1e2f07658d7f7.zip
* 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).
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/abbrev.el3
-rw-r--r--lisp/custom.el11
-rw-r--r--lisp/startup.el9
4 files changed, 30 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 64b3612c7f4..f2792ed6f16 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,6 +1,14 @@
12009-09-11 Stefan Monnier <monnier@iro.umontreal.ca> 12009-09-11 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * proced.el (proced-mode-map): Prefer "m" for proced-mark. 3 * custom.el (custom-delayed-init-variables): New var.
4 (custom-initialize-delay): New function.
5 * startup.el (command-line): "Re"evaluate all vars in
6 custom-delayed-init-variables. Don't reevaluate abbrev-file-name
7 explicitly any more.
8 * abbrev.el (abbrev-file-name): Use custom-initialize-delay
9 to avoid creating a ~/.emacs.d at build-time (bug#4347).
10
11 * proced.el (proced-mode-map): Prefer "m" for proced-mark (bug#4362).
4 12
52009-09-11 Nick Roberts <nickrob@snap.net.nz> 132009-09-11 Nick Roberts <nickrob@snap.net.nz>
6 14
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 6441381d171..f45f4c1860c 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -40,7 +40,8 @@
40 40
41(defcustom abbrev-file-name 41(defcustom abbrev-file-name
42 (locate-user-emacs-file "abbrev_defs" ".abbrev_defs") 42 (locate-user-emacs-file "abbrev_defs" ".abbrev_defs")
43 "Default name of file to read abbrevs from." 43 "Default name of file from which to read abbrevs."
44 :initialize 'custom-initialize-delay
44 :type 'file) 45 :type 'file)
45 46
46(defcustom only-global-abbrevs nil 47(defcustom only-global-abbrevs nil
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'."
130 (t 130 (t
131 (set-default symbol (eval value))))) 131 (set-default symbol (eval value)))))
132 132
133(defvar custom-delayed-init-variables nil
134 "List of variables whose initialization is pending.")
135
136(defun custom-initialize-delay (symbol value)
137 "Delay initialization of SYMBOL to the next Emacs start.
138This is used in files that are preloaded, so that the initialization is
139done in the run-time context rather than the build-time context.
140This also has the side-effect that the (delayed) initialization is performed
141with the :setter."
142 (push symbol custom-delayed-init-variables))
143
133(defun custom-declare-variable (symbol default doc &rest args) 144(defun custom-declare-variable (symbol default doc &rest args)
134 "Like `defcustom', but SYMBOL and DEFAULT are evaluated as normal arguments. 145 "Like `defcustom', but SYMBOL and DEFAULT are evaluated as normal arguments.
135DEFAULT should be an expression to evaluate to compute the default value, 146DEFAULT should be an expression to evaluate to compute the default value,
diff --git a/lisp/startup.el b/lisp/startup.el
index 5802b33b643..fcb35b95f02 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -703,7 +703,6 @@ opening the first frame (e.g. open a connection to an X server).")
703 (custom-reevaluate-setting 'temporary-file-directory) 703 (custom-reevaluate-setting 'temporary-file-directory)
704 (custom-reevaluate-setting 'small-temporary-file-directory) 704 (custom-reevaluate-setting 'small-temporary-file-directory)
705 (custom-reevaluate-setting 'auto-save-file-name-transforms) 705 (custom-reevaluate-setting 'auto-save-file-name-transforms)
706 (custom-reevaluate-setting 'abbrev-file-name)
707 ;; Force recomputation, in case it was computed during the dump. 706 ;; Force recomputation, in case it was computed during the dump.
708 (setq abbreviated-home-dir nil) 707 (setq abbreviated-home-dir nil)
709 708
@@ -909,6 +908,14 @@ opening the first frame (e.g. open a connection to an X server).")
909 ;; Otherwise, enable tool-bar-mode. 908 ;; Otherwise, enable tool-bar-mode.
910 (tool-bar-mode 1))) 909 (tool-bar-mode 1)))
911 910
911 ;; Re-evaluate predefined variables whose initial value depends on
912 ;; the runtime context.
913 (mapc 'custom-reevaluate-setting
914 ;; Initialize them in the same order they were loaded, in case there
915 ;; are dependencies between them.
916 (prog1 (nreverse custom-delayed-init-variables)
917 (setq custom-delayed-init-variables nil)))
918
912 ;; Can't do this init in defcustom because the relevant variables 919 ;; Can't do this init in defcustom because the relevant variables
913 ;; are not set. 920 ;; are not set.
914 (custom-reevaluate-setting 'blink-cursor-mode) 921 (custom-reevaluate-setting 'blink-cursor-mode)