]> git.eshelyaron.com Git - emacs.git/commitdiff
* mail/sendmail.el (send-mail-function):
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 13 Sep 2009 00:52:55 +0000 (00:52 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 13 Sep 2009 00:52:55 +0000 (00:52 +0000)
* 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.

12 files changed:
lisp/ChangeLog
lisp/composite.el
lisp/custom.el
lisp/epa-hook.el
lisp/files.el
lisp/font-core.el
lisp/frame.el
lisp/mail/sendmail.el
lisp/rfn-eshadow.el
lisp/simple.el
lisp/startup.el
lisp/tooltip.el

index 22207eec8f95fde5a482b80661b662cf637395cf..0165677e7cc0d592f67273bd9212d3a5991e5a0e 100644 (file)
@@ -1,3 +1,21 @@
+2009-09-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * 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.
+
 2009-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * term/x-win.el (x-initialize-window-system):
index 77eea9cb4ecd4e50f3ee705e531a32cf0fb69f7d..c9f16e2f518ab285da07b0b81858d4a1a5d96813 100644 (file)
@@ -773,8 +773,10 @@ Auto Composition mode in all buffers (this is the default)."
 ;;;###autoload
 (define-global-minor-mode global-auto-composition-mode
   auto-composition-mode turn-on-auto-composition-if-enabled
-  :extra-args (dummy)
-  :initialize 'custom-initialize-safe-default
+  ;; This :extra-args' appears to be the result of a naive copy&paste
+  ;; from global-font-lock-mode.
+  ;; :extra-args (dummy)
+  :initialize 'custom-initialize-delay
   :init-value (not noninteractive)
   :group 'auto-composition
   :version "23.1")
index c6b8f2950e48bf99966927073fe3cfe93a6d28af..f55cd47afc0e590be67747c31994006c5cf970a4 100644 (file)
@@ -74,28 +74,6 @@ if any, or VALUE."
                 (eval (car (get symbol 'saved-value)))
               (eval value)))))
 
-(defun custom-initialize-safe-set (symbol value)
-  "Like `custom-initialize-set', but catches errors.
-If an error occurs during initialization, SYMBOL is set to nil
-and no error is thrown.  This is meant for use in pre-loaded files
-where some variables or functions used to compute VALUE may not yet
-be defined.  You can then re-evaluate VALUE in startup.el, for instance
-using `custom-reevaluate-setting'."
-  (condition-case nil
-      (custom-initialize-set symbol value)
-    (error (set-default symbol nil))))
-
-(defun custom-initialize-safe-default (symbol value)
-  "Like `custom-initialize-default', but catches errors.
-If an error occurs during initialization, SYMBOL is set to nil
-and no error is thrown.  This is meant for use in pre-loaded files
-where some variables or functions used to compute VALUE may not yet
-be defined.  You can then re-evaluate VALUE in startup.el, for instance
-using `custom-reevaluate-setting'."
-  (condition-case nil
-      (custom-initialize-default symbol value)
-    (error (set-default symbol nil))))
-
 (defun custom-initialize-reset (symbol value)
   "Initialize SYMBOL based on VALUE.
 Set 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
 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."
+  ;; Until the var is actually initialized, it is kept unbound.
+  ;; This seemed to be at least as good as setting it to an arbitrary
+  ;; value like nil (evaluating `value' is not an option because it
+  ;; may have undesirable side-effects).
   (push symbol custom-delayed-init-variables))
 
 (defun custom-declare-variable (symbol default doc &rest args)
index 593b5dcf150f9b6625a22bef03ebb76f0d7e4585..0987b2a221d6d614acd1ac73b3ae039e5b69f16a 100644 (file)
@@ -86,6 +86,11 @@ May either be a string or a list of strings.")
 With prefix argument ARG, turn auto encryption on if positive, else off.
 Return the new status of auto encryption (non-nil means on)."
   :global t :init-value t :group 'epa-file :version "23.1"
+  ;; We'd like to use custom-initialize-set here so the setup is done
+  ;; before dumping, but at the point where the defcustom is evaluated,
+  ;; the corresponding function isn't defined yet, so
+  ;; custom-initialize-set signals an error.
+  :initialize 'custom-initialize-delay
   (setq file-name-handler-alist
        (delq epa-file-handler file-name-handler-alist))
   (remove-hook 'find-file-hooks 'epa-file-find-file-hook)
index 5487b10eb2c4b36dca8fd012fc79b5ca7ae1af24..9d6218cc4ebcffa922191cb8457de61121760518 100644 (file)
@@ -195,6 +195,7 @@ If the buffer is visiting a new file, the value is nil.")
          (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "/tmp"))))
   "The directory for writing temporary files."
   :group 'files
+  :initialize 'custom-initialize-delay
   :type 'directory)
 
 (defcustom small-temporary-file-directory
@@ -204,6 +205,7 @@ If non-nil, this directory is used instead of `temporary-file-directory'
 by programs that create small temporary files.  This is for systems that
 have fast storage with limited space, such as a RAM disk."
   :group 'files
+  :initialize 'custom-initialize-delay
   :type '(choice (const nil) directory))
 
 ;; The system null device. (Should reference NULL_DEVICE from C.)
@@ -385,6 +387,7 @@ ignored."
   :group 'auto-save
   :type '(repeat (list (string :tag "Regexp") (string :tag "Replacement")
                                           (boolean :tag "Uniquify")))
+  :initialize 'custom-initialize-delay
   :version "21.1")
 
 (defcustom save-abbrevs t
index 0ba7295cc06a83d93a7a50a6b5a4552e30f0b9b9..7112b6b227c95c85e93a087d807b7dcbd5c46a76 100644 (file)
@@ -299,8 +299,9 @@ means that Font Lock mode is turned on for buffers in C and C++ modes only."
 
 (define-globalized-minor-mode global-font-lock-mode
   font-lock-mode turn-on-font-lock-if-desired
-  :extra-args (dummy)
-  :initialize 'custom-initialize-safe-default
+  ;; What was this :extra-args thingy for?  --Stef
+  ;; :extra-args (dummy)
+  :initialize 'custom-initialize-delay
   :init-value (not (or noninteractive emacs-basic-display))
   :group 'font-lock
   :version "22.1")
index 35cbbfbe1a215966f862351f0a337b70a29cd232..e5d92fa1df3b33c517ff918cd621df8a4f9942c4 100644 (file)
@@ -1605,7 +1605,7 @@ cursor display.  On a text-only terminal, this is not implemented."
                       no-blinking-cursor
                       (eq system-type 'ms-dos)
                       (not (memq window-system '(x w32)))))
-  :initialize 'custom-initialize-safe-default
+  :initialize 'custom-initialize-delay
   :group 'cursor
   :global t
   (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer))
index 7d34aee05eba68285b23c16f6b09bdcd27608e1d..955e424cf231cd1b652c5e2d0dfb43a43d21b7b3 100644 (file)
@@ -168,6 +168,7 @@ This is used by the default mail-sending commands.  See also
                (function-item feedmail-send-it :tag "Use Feedmail package")
                (function-item mailclient-send-it :tag "Use Mailclient package")
                function)
+  :initialize 'custom-initialize-delay
   :group 'sendmail)
 
 ;;;###autoload
index eb54636e1053bb71e9c6be7327f7f905b77122eb..5788ab7447b5fb79a2eae8b14e9ed2ee2b785447 100644 (file)
@@ -216,6 +216,11 @@ that portion dim, invisible, or otherwise less visually noticeable.
 With prefix argument ARG, turn on if positive, otherwise off.
 Returns non-nil if the new state is enabled."
   :global t
+  ;; We'd like to use custom-initialize-set here so the setup is done
+  ;; before dumping, but at the point where the defcustom is evaluated,
+  ;; the corresponding function isn't defined yet, so
+  ;; custom-initialize-set signals an error.
+  :initialize 'custom-initialize-delay
   :init-value t
   :group 'minibuffer
   :version "22.1"
index f318d496776ce6c2b3b6fcf33803ec8f97ac0226..a34d8937cd8a27c5e9added705f173a727796533 100644 (file)
@@ -3898,6 +3898,7 @@ Invoke \\[apropos-documentation] and type \"transient\" or
 commands which are sensitive to the Transient Mark mode."
   :global t
   :init-value (not noninteractive)
+  :initialize 'custom-initialize-delay
   :group 'editing-basics)
 
 ;; The variable transient-mark-mode is ugly: it can take on special
index d5133290ba828b46e4f0d9c31094f2e8e5a2acaa..14758727c0266e7b29324d01728f0ca0711a8d61 100644 (file)
@@ -698,10 +698,6 @@ opening the first frame (e.g. open a connection to an X server).")
        after-init-time nil
         command-line-default-directory default-directory)
 
-  ;; Choose a reasonable location for temporary files.
-  (custom-reevaluate-setting 'temporary-file-directory)
-  (custom-reevaluate-setting 'small-temporary-file-directory)
-  (custom-reevaluate-setting 'auto-save-file-name-transforms)
   ;; Force recomputation, in case it was computed during the dump.
   (setq abbreviated-home-dir nil)
 
@@ -914,18 +910,6 @@ opening the first frame (e.g. open a connection to an X server).")
         ;; 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)
-  (custom-reevaluate-setting 'tooltip-mode)
-  (custom-reevaluate-setting 'global-font-lock-mode)
-  (custom-reevaluate-setting 'file-name-shadow-mode)
-  (custom-reevaluate-setting 'send-mail-function)
-  (custom-reevaluate-setting 'focus-follows-mouse)
-  (custom-reevaluate-setting 'global-auto-composition-mode)
-  (custom-reevaluate-setting 'transient-mark-mode)
-  (custom-reevaluate-setting 'auto-encryption-mode)
 
   (normal-erase-is-backspace-setup-frame)
 
index 6c34e950268b32b0618998b21d360582ee95adfc..49ecaffd0e64a116213617b6a7d76477c090e5bd 100644 (file)
@@ -52,7 +52,7 @@ the help text in the echo area, and does not make a pop-up window."
   ;; Even if we start on a text-only terminal, make this non-nil by
   ;; default because we can open a graphical frame later (multi-tty).
   :init-value t
-  :initialize 'custom-initialize-safe-default
+  :initialize 'custom-initialize-delay
   :group 'tooltip
   (unless (or (null tooltip-mode) (fboundp 'x-show-tip))
     (error "Sorry, tooltips are not yet available on this system"))