(enable-recursive-minibuffers t)
val)
(setq val (completing-read
- (if default (format "Customize option (default %s): " default)
- "Customize option: ")
+ (if default (format "Customize variable (default %s): " default)
+ "Customize variable: ")
obarray 'custom-variable-p t nil nil default))
(list (if (equal val "")
(if (symbolp v) v nil)
(if description
(widget-insert description))
(widget-insert (format ".
-%s show active fields; type RET or click mouse-1
-on an active field to invoke its action. Editing an option value
-changes only the text in the buffer. Invoke the State button to set or
-save the option value. Saving an option normally edits your init file.
-Invoke "
+%s indicate buttons; type RET or click mouse-1 to actuate one.
+Editing a setting changes only the text in the buffer.
+Use the setting's State button to set it or save changes in it.
+Saving a change normally works by editing your Emacs init file.
+See "
(if custom-raised-buttons
"`Raised' buttons"
"Square brackets")))
:tag "Custom file"
"(emacs)Saving Customizations")
(widget-insert
- " for information on how to save in a different file.
-Invoke ")
+ " for information on how to save in a different file.\n
+See ")
(widget-create 'info-link
:tag "Help"
:help-echo "Read the online help."
"(emacs)Easy Customization")
- (widget-insert " for general information.\n\n")
+ (widget-insert " for more information.\n\n")
(widget-insert "Operate on everything in this buffer:\n "))
(widget-insert " "))
(widget-create 'push-button
Make your editing in this buffer take effect for this session."
:action (lambda (widget &optional event)
(Custom-set)))
- (widget-insert " ")
- (widget-create 'push-button
- :tag "Save for Future Sessions"
- :help-echo "\
+ (when (or custom-file user-init-file)
+ (widget-insert " ")
+ (widget-create 'push-button
+ :tag "Save for Future Sessions"
+ :help-echo "\
Make your editing in this buffer take effect for future Emacs sessions.
This updates your Emacs initialization file or creates a new one."
- :action (lambda (widget &optional event)
- (Custom-save)))
+ :action (lambda (widget &optional event)
+ (Custom-save))))
(if custom-reset-button-menu
(progn
(widget-insert " ")
(widget-create 'push-button
:tag "Reset to Saved"
:help-echo "\
-Reset all values in this buffer to their saved settings."
+Reset all settings in this buffer to their saved values."
:action 'Custom-reset-saved)
(widget-insert " ")
- (widget-create 'push-button
- :tag "Erase Customization"
- :help-echo "\
-Un-customize all values in this buffer. They get their standard settings."
- :action 'Custom-reset-standard))
+ (when (or custom-file user-init-file)
+ (widget-create 'push-button
+ :tag "Erase Customization"
+ :help-echo "\
+Un-customize all settings in this buffer--save them with standard values."
+ :action 'Custom-reset-standard)))
(if (not custom-buffer-verbose-help)
(progn
(widget-insert " ")
(get (widget-value widget) 'standard-value))
(defvar custom-variable-menu
- '(("Set for Current Session" custom-variable-set
+ `(("Set for Current Session" custom-variable-set
(lambda (widget)
(eq (widget-get widget :custom-state) 'modified)))
- ("Save for Future Sessions" custom-variable-save
- (lambda (widget)
- (memq (widget-get widget :custom-state) '(modified set changed rogue))))
+ ,@(when (or custom-file user-init-file)
+ '(("Save for Future Sessions" custom-variable-save
+ (lambda (widget)
+ (memq (widget-get widget :custom-state) '(modified set changed rogue))))))
("Reset to Current" custom-redraw
(lambda (widget)
(and (default-boundp (widget-value widget))
(get (widget-value widget) 'saved-variable-comment))
(memq (widget-get widget :custom-state)
'(modified set changed rogue)))))
- ("Erase Customization" custom-variable-reset-standard
- (lambda (widget)
- (and (get (widget-value widget) 'standard-value)
- (memq (widget-get widget :custom-state)
- '(modified set changed saved rogue)))))
+ ,@(when (or custom-file user-init-file)
+ '(("Erase Customization" custom-variable-reset-standard
+ (lambda (widget)
+ (and (get (widget-value widget) 'standard-value)
+ (memq (widget-get widget :custom-state)
+ '(modified set changed saved rogue)))))))
("Use Backup Value" custom-variable-reset-backup
(lambda (widget)
(get (widget-value widget) 'backup-value)))
(message "Creating face editor...done"))))))
(defvar custom-face-menu
- '(("Set for Current Session" custom-face-set)
- ("Save for Future Sessions" custom-face-save-command)
+ `(("Set for Current Session" custom-face-set)
+ ,@(when (or custom-file user-init-file)
+ '(("Save for Future Sessions" custom-face-save-command)))
("Reset to Saved" custom-face-reset-saved
(lambda (widget)
(or (get (widget-value widget) 'saved-face)
(get (widget-value widget) 'saved-face-comment))))
- ("Erase Customization" custom-face-reset-standard
- (lambda (widget)
- (get (widget-value widget) 'face-defface-spec)))
+ ,@(when (or custom-file user-init-file)
+ '(("Erase Customization" custom-face-reset-standard
+ (lambda (widget)
+ (get (widget-value widget) 'face-defface-spec)))))
("---" ignore ignore)
("Add Comment" custom-comment-show custom-comment-invisible-p)
("---" ignore ignore)
(insert "/\n")))))
(defvar custom-group-menu
- '(("Set for Current Session" custom-group-set
+ `(("Set for Current Session" custom-group-set
(lambda (widget)
(eq (widget-get widget :custom-state) 'modified)))
- ("Save for Future Sessions" custom-group-save
- (lambda (widget)
- (memq (widget-get widget :custom-state) '(modified set))))
+ ,@(when (or custom-file user-init-file)
+ '(("Save for Future Sessions" custom-group-save
+ (lambda (widget)
+ (memq (widget-get widget :custom-state) '(modified set))))))
("Reset to Current" custom-group-reset-current
(lambda (widget)
(memq (widget-get widget :custom-state) '(modified))))
("Reset to Saved" custom-group-reset-saved
(lambda (widget)
(memq (widget-get widget :custom-state) '(modified set))))
- ("Reset to standard setting" custom-group-reset-standard
- (lambda (widget)
- (memq (widget-get widget :custom-state) '(modified set saved)))))
+ ,@(when (or custom-file user-init-file)
+ '(("Reset to standard setting" custom-group-reset-standard
+ (lambda (widget)
+ (memq (widget-get widget :custom-state) '(modified set saved)))))))
"Alist of actions for the `custom-group' widget.
Each entry has the form (NAME ACTION FILTER) where NAME is the name of
the menu entry, ACTION is the function to call on the widget when the