Commit adba8116 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* 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.
parent afdceaec
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):
......
......@@ -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")
......
......@@ -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)
......
......@@ -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)
......
......@@ -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
......
......@@ -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")
......
......@@ -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))
......
......@@ -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
......
......@@ -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"
......
......@@ -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
......
......@@ -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)
......
......@@ -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"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment