;; Whether automatically buffer-local.
buffer-local)
(unless (memq :group args)
- (custom-add-to-group (custom-current-group) symbol 'custom-variable))
+ (let ((cg (custom-current-group)))
+ (when cg
+ (custom-add-to-group cg symbol 'custom-variable))))
(while args
(let ((keyword (pop args)))
(unless (symbolp keyword)
"For customization option SYMBOL, handle keyword arguments ARGS.
Third argument TYPE is the custom option type."
(unless (memq :group args)
- (custom-add-to-group (custom-current-group) symbol type))
+ (let ((cg (custom-current-group)))
+ (when cg
+ (custom-add-to-group cg symbol type))))
(while args
(let ((arg (car args)))
(setq args (cdr args))
;; Convert defcustom to less space-consuming data.
((eq car 'defcustom)
- (let ((varname (car-safe (cdr-safe form)))
- (initializer (plist-get (nthcdr 4 form) :initialize))
- (init (car-safe (cdr-safe (cdr-safe form))))
- (doc (car-safe (cdr-safe (cdr-safe (cdr-safe form)))))
- ;; (rest (cdr-safe (cdr-safe (cdr-safe (cdr-safe form)))))
- )
+ (let* ((varname (car-safe (cdr-safe form)))
+ (props (nthcdr 4 form))
+ (initializer (plist-get props :initialize))
+ (init (car-safe (cdr-safe (cdr-safe form))))
+ (doc (car-safe (cdr-safe (cdr-safe (cdr-safe form)))))
+ ;; (rest (cdr-safe (cdr-safe (cdr-safe (cdr-safe form)))))
+ )
`(progn
- ,(if (null initializer)
- `(defvar ,varname ,init ,doc)
- `(progn (defvar ,varname nil ,doc)
- (let ((exp ',init))
- (put ',varname 'standard-value (list exp))
- (,(eval initializer t) ',varname exp))))
+ ,(if (not (member initializer '(nil 'custom-initialize-default
+ #'custom-initialize-default
+ 'custom-initialize-reset
+ #'custom-initialize-reset)))
+ form
+ `(defvar ,varname ,init ,doc))
+ ;; When we include the complete `form', this `custom-autoload'
+ ;; is not indispensable, but it still helps in case the `defcustom'
+ ;; doesn't specify its group explicitly, and probably in a few other
+ ;; corner cases.
(custom-autoload ',varname ,file
,(condition-case nil
- (null (cadr (memq :set form)))
+ (null (plist-get props :set))
(error nil))))))
((eq car 'defgroup)
:version "24.4")
;; This is a defcustom largely so that we can get the benefit
-;; of custom-initialize-delay. Perhaps it would work to make it a
-;; defvar and explicitly give it a standard-value property, and
-;; call custom-initialize-delay on it.
-;; The progn forces the autoloader to include the whole thing, not
-;; just an abbreviated version. The value is initialized at startup
-;; time, when command-line calls custom-reevaluate-setting on all
-;; the defcustoms in custom-delayed-init-variables. This is
-;; somewhat sub-optimal, as ideally this should be done when Info
-;; mode is first invoked.
+;; of `custom-initialize-delay'. Perhaps it would work to make it a
+;; `defvar' and explicitly give it a `standard-value' property, and
+;; call `custom-initialize-delay' on it.
+;; The value is initialized at startup time, when command-line calls
+;; `custom-reevaluate-setting' on all the defcustoms in
+;; `custom-delayed-init-variables'. This is somewhat sub-optimal, as ideally
+;; this should be done when Info mode is first invoked.
;;;###autoload
-(progn
(defcustom Info-default-directory-list
(let* ((config-dir
(file-name-as-directory
Although this is a customizable variable, that is mainly for technical
reasons. Normally, you should either set INFOPATH or customize
`Info-additional-directory-list', rather than changing this variable."
- :initialize 'custom-initialize-delay
- :type '(repeat directory)))
+ :initialize #'custom-initialize-delay
+ :type '(repeat directory))
(defvar Info-directory-list nil
"List of directories to search for Info documentation files.
:group 'rmail
:version "21.1")
-;;;###autoload
-(put 'rmail-spool-directory 'standard-value
- '((cond ((file-exists-p "/var/mail") "/var/mail/")
- ((file-exists-p "/var/spool/mail") "/var/spool/mail/")
- ((memq system-type '(hpux usg-unix-v)) "/usr/mail/")
- (t "/usr/spool/mail/"))))
-
;;;###autoload
(defcustom rmail-spool-directory
(purecopy
(t "/usr/spool/mail/")))
"Name of directory used by system mailer for delivering new mail.
Its name should end with a slash."
- :initialize 'custom-initialize-delay
+ :initialize #'custom-initialize-delay
:type 'directory
:group 'rmail)
-;;;###autoload(custom-initialize-delay 'rmail-spool-directory nil)
-
(defcustom rmail-movemail-program nil
"If non-nil, the file name of the `movemail' program."
:group 'rmail-retrieve