aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2009-09-13 00:52:55 +0000
committerStefan Monnier2009-09-13 00:52:55 +0000
commitadba8116c3a918f2f091600b60ea1700c9ea7362 (patch)
treed687c036e1a97206c146b60f7d210b6802198b30
parentafdceaec7decebe70be60baf5c6515ec3e7d6b1a (diff)
downloademacs-adba8116c3a918f2f091600b60ea1700c9ea7362.tar.gz
emacs-adba8116c3a918f2f091600b60ea1700c9ea7362.zip
* mail/sendmail.el (send-mail-function):
* tooltip.el (tooltip-mode): * simple.el (transient-mark-mode): * rfn-eshadow.el (file-name-shadow-mode): * frame.el (blink-cursor-mode): * font-core.el (global-font-lock-mode): * files.el (temporary-file-directory) (small-temporary-file-directory, auto-save-file-name-transforms): * epa-hook.el (auto-encryption-mode): * composite.el (global-auto-composition-mode): Use custom-initialize-delay. * startup.el (command-line): Don't explicitly call custom-reevaluate-setting for all the above vars. * custom.el (custom-initialize-safe-set) (custom-initialize-safe-default): Delete.
-rw-r--r--lisp/ChangeLog18
-rw-r--r--lisp/composite.el6
-rw-r--r--lisp/custom.el26
-rw-r--r--lisp/epa-hook.el5
-rw-r--r--lisp/files.el3
-rw-r--r--lisp/font-core.el5
-rw-r--r--lisp/frame.el2
-rw-r--r--lisp/mail/sendmail.el1
-rw-r--r--lisp/rfn-eshadow.el5
-rw-r--r--lisp/simple.el1
-rw-r--r--lisp/startup.el16
-rw-r--r--lisp/tooltip.el2
12 files changed, 46 insertions, 44 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 22207eec8f9..0165677e7cc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,21 @@
12009-09-13 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * mail/sendmail.el (send-mail-function):
4 * tooltip.el (tooltip-mode):
5 * simple.el (transient-mark-mode):
6 * rfn-eshadow.el (file-name-shadow-mode):
7 * frame.el (blink-cursor-mode):
8 * font-core.el (global-font-lock-mode):
9 * files.el (temporary-file-directory)
10 (small-temporary-file-directory, auto-save-file-name-transforms):
11 * epa-hook.el (auto-encryption-mode):
12 * composite.el (global-auto-composition-mode):
13 Use custom-initialize-delay.
14 * startup.el (command-line): Don't explicitly call
15 custom-reevaluate-setting for all the above vars.
16 * custom.el (custom-initialize-safe-set)
17 (custom-initialize-safe-default): Delete.
18
12009-09-12 Stefan Monnier <monnier@iro.umontreal.ca> 192009-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2 20
3 * term/x-win.el (x-initialize-window-system): 21 * term/x-win.el (x-initialize-window-system):
diff --git a/lisp/composite.el b/lisp/composite.el
index 77eea9cb4ec..c9f16e2f518 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -773,8 +773,10 @@ Auto Composition mode in all buffers (this is the default)."
773;;;###autoload 773;;;###autoload
774(define-global-minor-mode global-auto-composition-mode 774(define-global-minor-mode global-auto-composition-mode
775 auto-composition-mode turn-on-auto-composition-if-enabled 775 auto-composition-mode turn-on-auto-composition-if-enabled
776 :extra-args (dummy) 776 ;; This :extra-args' appears to be the result of a naive copy&paste
777 :initialize 'custom-initialize-safe-default 777 ;; from global-font-lock-mode.
778 ;; :extra-args (dummy)
779 :initialize 'custom-initialize-delay
778 :init-value (not noninteractive) 780 :init-value (not noninteractive)
779 :group 'auto-composition 781 :group 'auto-composition
780 :version "23.1") 782 :version "23.1")
diff --git a/lisp/custom.el b/lisp/custom.el
index c6b8f2950e4..f55cd47afc0 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -74,28 +74,6 @@ if any, or VALUE."
74 (eval (car (get symbol 'saved-value))) 74 (eval (car (get symbol 'saved-value)))
75 (eval value))))) 75 (eval value)))))
76 76
77(defun custom-initialize-safe-set (symbol value)
78 "Like `custom-initialize-set', but catches errors.
79If an error occurs during initialization, SYMBOL is set to nil
80and no error is thrown. This is meant for use in pre-loaded files
81where some variables or functions used to compute VALUE may not yet
82be defined. You can then re-evaluate VALUE in startup.el, for instance
83using `custom-reevaluate-setting'."
84 (condition-case nil
85 (custom-initialize-set symbol value)
86 (error (set-default symbol nil))))
87
88(defun custom-initialize-safe-default (symbol value)
89 "Like `custom-initialize-default', but catches errors.
90If an error occurs during initialization, SYMBOL is set to nil
91and no error is thrown. This is meant for use in pre-loaded files
92where some variables or functions used to compute VALUE may not yet
93be defined. You can then re-evaluate VALUE in startup.el, for instance
94using `custom-reevaluate-setting'."
95 (condition-case nil
96 (custom-initialize-default symbol value)
97 (error (set-default symbol nil))))
98
99(defun custom-initialize-reset (symbol value) 77(defun custom-initialize-reset (symbol value)
100 "Initialize SYMBOL based on VALUE. 78 "Initialize SYMBOL based on VALUE.
101Set the symbol, using its `:set' function (or `set-default' if it has none). 79Set the symbol, using its `:set' function (or `set-default' if it has none).
@@ -139,6 +117,10 @@ This is used in files that are preloaded, so that the initialization is
139done in the run-time context rather than the build-time context. 117done in the run-time context rather than the build-time context.
140This also has the side-effect that the (delayed) initialization is performed 118This also has the side-effect that the (delayed) initialization is performed
141with the :setter." 119with the :setter."
120 ;; Until the var is actually initialized, it is kept unbound.
121 ;; This seemed to be at least as good as setting it to an arbitrary
122 ;; value like nil (evaluating `value' is not an option because it
123 ;; may have undesirable side-effects).
142 (push symbol custom-delayed-init-variables)) 124 (push symbol custom-delayed-init-variables))
143 125
144(defun custom-declare-variable (symbol default doc &rest args) 126(defun custom-declare-variable (symbol default doc &rest args)
diff --git a/lisp/epa-hook.el b/lisp/epa-hook.el
index 593b5dcf150..0987b2a221d 100644
--- a/lisp/epa-hook.el
+++ b/lisp/epa-hook.el
@@ -86,6 +86,11 @@ May either be a string or a list of strings.")
86With prefix argument ARG, turn auto encryption on if positive, else off. 86With prefix argument ARG, turn auto encryption on if positive, else off.
87Return the new status of auto encryption (non-nil means on)." 87Return the new status of auto encryption (non-nil means on)."
88 :global t :init-value t :group 'epa-file :version "23.1" 88 :global t :init-value t :group 'epa-file :version "23.1"
89 ;; We'd like to use custom-initialize-set here so the setup is done
90 ;; before dumping, but at the point where the defcustom is evaluated,
91 ;; the corresponding function isn't defined yet, so
92 ;; custom-initialize-set signals an error.
93 :initialize 'custom-initialize-delay
89 (setq file-name-handler-alist 94 (setq file-name-handler-alist
90 (delq epa-file-handler file-name-handler-alist)) 95 (delq epa-file-handler file-name-handler-alist))
91 (remove-hook 'find-file-hooks 'epa-file-find-file-hook) 96 (remove-hook 'find-file-hooks 'epa-file-find-file-hook)
diff --git a/lisp/files.el b/lisp/files.el
index 5487b10eb2c..9d6218cc4eb 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -195,6 +195,7 @@ If the buffer is visiting a new file, the value is nil.")
195 (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "/tmp")))) 195 (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "/tmp"))))
196 "The directory for writing temporary files." 196 "The directory for writing temporary files."
197 :group 'files 197 :group 'files
198 :initialize 'custom-initialize-delay
198 :type 'directory) 199 :type 'directory)
199 200
200(defcustom small-temporary-file-directory 201(defcustom small-temporary-file-directory
@@ -204,6 +205,7 @@ If non-nil, this directory is used instead of `temporary-file-directory'
204by programs that create small temporary files. This is for systems that 205by programs that create small temporary files. This is for systems that
205have fast storage with limited space, such as a RAM disk." 206have fast storage with limited space, such as a RAM disk."
206 :group 'files 207 :group 'files
208 :initialize 'custom-initialize-delay
207 :type '(choice (const nil) directory)) 209 :type '(choice (const nil) directory))
208 210
209;; The system null device. (Should reference NULL_DEVICE from C.) 211;; The system null device. (Should reference NULL_DEVICE from C.)
@@ -385,6 +387,7 @@ ignored."
385 :group 'auto-save 387 :group 'auto-save
386 :type '(repeat (list (string :tag "Regexp") (string :tag "Replacement") 388 :type '(repeat (list (string :tag "Regexp") (string :tag "Replacement")
387 (boolean :tag "Uniquify"))) 389 (boolean :tag "Uniquify")))
390 :initialize 'custom-initialize-delay
388 :version "21.1") 391 :version "21.1")
389 392
390(defcustom save-abbrevs t 393(defcustom save-abbrevs t
diff --git a/lisp/font-core.el b/lisp/font-core.el
index 0ba7295cc06..7112b6b227c 100644
--- a/lisp/font-core.el
+++ b/lisp/font-core.el
@@ -299,8 +299,9 @@ means that Font Lock mode is turned on for buffers in C and C++ modes only."
299 299
300(define-globalized-minor-mode global-font-lock-mode 300(define-globalized-minor-mode global-font-lock-mode
301 font-lock-mode turn-on-font-lock-if-desired 301 font-lock-mode turn-on-font-lock-if-desired
302 :extra-args (dummy) 302 ;; What was this :extra-args thingy for? --Stef
303 :initialize 'custom-initialize-safe-default 303 ;; :extra-args (dummy)
304 :initialize 'custom-initialize-delay
304 :init-value (not (or noninteractive emacs-basic-display)) 305 :init-value (not (or noninteractive emacs-basic-display))
305 :group 'font-lock 306 :group 'font-lock
306 :version "22.1") 307 :version "22.1")
diff --git a/lisp/frame.el b/lisp/frame.el
index 35cbbfbe1a2..e5d92fa1df3 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1605,7 +1605,7 @@ cursor display. On a text-only terminal, this is not implemented."
1605 no-blinking-cursor 1605 no-blinking-cursor
1606 (eq system-type 'ms-dos) 1606 (eq system-type 'ms-dos)
1607 (not (memq window-system '(x w32))))) 1607 (not (memq window-system '(x w32)))))
1608 :initialize 'custom-initialize-safe-default 1608 :initialize 'custom-initialize-delay
1609 :group 'cursor 1609 :group 'cursor
1610 :global t 1610 :global t
1611 (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer)) 1611 (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer))
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 7d34aee05eb..955e424cf23 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -168,6 +168,7 @@ This is used by the default mail-sending commands. See also
168 (function-item feedmail-send-it :tag "Use Feedmail package") 168 (function-item feedmail-send-it :tag "Use Feedmail package")
169 (function-item mailclient-send-it :tag "Use Mailclient package") 169 (function-item mailclient-send-it :tag "Use Mailclient package")
170 function) 170 function)
171 :initialize 'custom-initialize-delay
171 :group 'sendmail) 172 :group 'sendmail)
172 173
173;;;###autoload 174;;;###autoload
diff --git a/lisp/rfn-eshadow.el b/lisp/rfn-eshadow.el
index eb54636e105..5788ab7447b 100644
--- a/lisp/rfn-eshadow.el
+++ b/lisp/rfn-eshadow.el
@@ -216,6 +216,11 @@ that portion dim, invisible, or otherwise less visually noticeable.
216With prefix argument ARG, turn on if positive, otherwise off. 216With prefix argument ARG, turn on if positive, otherwise off.
217Returns non-nil if the new state is enabled." 217Returns non-nil if the new state is enabled."
218 :global t 218 :global t
219 ;; We'd like to use custom-initialize-set here so the setup is done
220 ;; before dumping, but at the point where the defcustom is evaluated,
221 ;; the corresponding function isn't defined yet, so
222 ;; custom-initialize-set signals an error.
223 :initialize 'custom-initialize-delay
219 :init-value t 224 :init-value t
220 :group 'minibuffer 225 :group 'minibuffer
221 :version "22.1" 226 :version "22.1"
diff --git a/lisp/simple.el b/lisp/simple.el
index f318d496776..a34d8937cd8 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3898,6 +3898,7 @@ Invoke \\[apropos-documentation] and type \"transient\" or
3898commands which are sensitive to the Transient Mark mode." 3898commands which are sensitive to the Transient Mark mode."
3899 :global t 3899 :global t
3900 :init-value (not noninteractive) 3900 :init-value (not noninteractive)
3901 :initialize 'custom-initialize-delay
3901 :group 'editing-basics) 3902 :group 'editing-basics)
3902 3903
3903;; The variable transient-mark-mode is ugly: it can take on special 3904;; The variable transient-mark-mode is ugly: it can take on special
diff --git a/lisp/startup.el b/lisp/startup.el
index d5133290ba8..14758727c02 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -698,10 +698,6 @@ opening the first frame (e.g. open a connection to an X server).")
698 after-init-time nil 698 after-init-time nil
699 command-line-default-directory default-directory) 699 command-line-default-directory default-directory)
700 700
701 ;; Choose a reasonable location for temporary files.
702 (custom-reevaluate-setting 'temporary-file-directory)
703 (custom-reevaluate-setting 'small-temporary-file-directory)
704 (custom-reevaluate-setting 'auto-save-file-name-transforms)
705 ;; Force recomputation, in case it was computed during the dump. 701 ;; Force recomputation, in case it was computed during the dump.
706 (setq abbreviated-home-dir nil) 702 (setq abbreviated-home-dir nil)
707 703
@@ -914,18 +910,6 @@ opening the first frame (e.g. open a connection to an X server).")
914 ;; are dependencies between them. 910 ;; are dependencies between them.
915 (prog1 (nreverse custom-delayed-init-variables) 911 (prog1 (nreverse custom-delayed-init-variables)
916 (setq custom-delayed-init-variables nil))) 912 (setq custom-delayed-init-variables nil)))
917
918 ;; Can't do this init in defcustom because the relevant variables
919 ;; are not set.
920 (custom-reevaluate-setting 'blink-cursor-mode)
921 (custom-reevaluate-setting 'tooltip-mode)
922 (custom-reevaluate-setting 'global-font-lock-mode)
923 (custom-reevaluate-setting 'file-name-shadow-mode)
924 (custom-reevaluate-setting 'send-mail-function)
925 (custom-reevaluate-setting 'focus-follows-mouse)
926 (custom-reevaluate-setting 'global-auto-composition-mode)
927 (custom-reevaluate-setting 'transient-mark-mode)
928 (custom-reevaluate-setting 'auto-encryption-mode)
929 913
930 (normal-erase-is-backspace-setup-frame) 914 (normal-erase-is-backspace-setup-frame)
931 915
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 6c34e950268..49ecaffd0e6 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -52,7 +52,7 @@ the help text in the echo area, and does not make a pop-up window."
52 ;; Even if we start on a text-only terminal, make this non-nil by 52 ;; Even if we start on a text-only terminal, make this non-nil by
53 ;; default because we can open a graphical frame later (multi-tty). 53 ;; default because we can open a graphical frame later (multi-tty).
54 :init-value t 54 :init-value t
55 :initialize 'custom-initialize-safe-default 55 :initialize 'custom-initialize-delay
56 :group 'tooltip 56 :group 'tooltip
57 (unless (or (null tooltip-mode) (fboundp 'x-show-tip)) 57 (unless (or (null tooltip-mode) (fboundp 'x-show-tip))
58 (error "Sorry, tooltips are not yet available on this system")) 58 (error "Sorry, tooltips are not yet available on this system"))