Commit 0a57ffed authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(custom-variable-prompt): Say "variable" in prompt.

(custom-buffer-create-internal): Reword the top-of-buffer help intro.
Don't include buttons that write a file when there's no file.
(custom-variable-menu, custom-face-menu, custom-group-menu):
Don't include commands that write a file when there's no file.
parent d130d129
...@@ -506,8 +506,8 @@ Return a list suitable for use in `interactive'." ...@@ -506,8 +506,8 @@ Return a list suitable for use in `interactive'."
(enable-recursive-minibuffers t) (enable-recursive-minibuffers t)
val) val)
(setq val (completing-read (setq val (completing-read
(if default (format "Customize option (default %s): " default) (if default (format "Customize variable (default %s): " default)
"Customize option: ") "Customize variable: ")
obarray 'custom-variable-p t nil nil default)) obarray 'custom-variable-p t nil nil default))
(list (if (equal val "") (list (if (equal val "")
(if (symbolp v) v nil) (if (symbolp v) v nil)
...@@ -1430,11 +1430,11 @@ Otherwise use brackets." ...@@ -1430,11 +1430,11 @@ Otherwise use brackets."
(if description (if description
(widget-insert description)) (widget-insert description))
(widget-insert (format ". (widget-insert (format ".
%s show active fields; type RET or click mouse-1 %s indicate buttons; type RET or click mouse-1 to actuate one.
on an active field to invoke its action. Editing an option value Editing a setting changes only the text in the buffer.
changes only the text in the buffer. Invoke the State button to set or Use the setting's State button to set it or save changes in it.
save the option value. Saving an option normally edits your init file. Saving a change normally works by editing your Emacs init file.
Invoke " See "
(if custom-raised-buttons (if custom-raised-buttons
"`Raised' buttons" "`Raised' buttons"
"Square brackets"))) "Square brackets")))
...@@ -1442,13 +1442,13 @@ Invoke " ...@@ -1442,13 +1442,13 @@ Invoke "
:tag "Custom file" :tag "Custom file"
"(emacs)Saving Customizations") "(emacs)Saving Customizations")
(widget-insert (widget-insert
" for information on how to save in a different file. " for information on how to save in a different file.\n
Invoke ") See ")
(widget-create 'info-link (widget-create 'info-link
:tag "Help" :tag "Help"
:help-echo "Read the online help." :help-echo "Read the online help."
"(emacs)Easy Customization") "(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 "Operate on everything in this buffer:\n "))
(widget-insert " ")) (widget-insert " "))
(widget-create 'push-button (widget-create 'push-button
...@@ -1457,14 +1457,15 @@ Invoke ") ...@@ -1457,14 +1457,15 @@ Invoke ")
Make your editing in this buffer take effect for this session." Make your editing in this buffer take effect for this session."
:action (lambda (widget &optional event) :action (lambda (widget &optional event)
(Custom-set))) (Custom-set)))
(widget-insert " ") (when (or custom-file user-init-file)
(widget-create 'push-button (widget-insert " ")
:tag "Save for Future Sessions" (widget-create 'push-button
:help-echo "\ :tag "Save for Future Sessions"
:help-echo "\
Make your editing in this buffer take effect for future Emacs sessions. Make your editing in this buffer take effect for future Emacs sessions.
This updates your Emacs initialization file or creates a new one." This updates your Emacs initialization file or creates a new one."
:action (lambda (widget &optional event) :action (lambda (widget &optional event)
(Custom-save))) (Custom-save))))
(if custom-reset-button-menu (if custom-reset-button-menu
(progn (progn
(widget-insert " ") (widget-insert " ")
...@@ -1484,14 +1485,15 @@ Reset all edited text in this buffer to reflect current values." ...@@ -1484,14 +1485,15 @@ Reset all edited text in this buffer to reflect current values."
(widget-create 'push-button (widget-create 'push-button
:tag "Reset to Saved" :tag "Reset to Saved"
:help-echo "\ :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) :action 'Custom-reset-saved)
(widget-insert " ") (widget-insert " ")
(widget-create 'push-button (when (or custom-file user-init-file)
:tag "Erase Customization" (widget-create 'push-button
:help-echo "\ :tag "Erase Customization"
Un-customize all values in this buffer. They get their standard settings." :help-echo "\
:action 'Custom-reset-standard)) Un-customize all settings in this buffer--save them with standard values."
:action 'Custom-reset-standard)))
(if (not custom-buffer-verbose-help) (if (not custom-buffer-verbose-help)
(progn (progn
(widget-insert " ") (widget-insert " ")
...@@ -2547,12 +2549,13 @@ Otherwise, look up symbol in `custom-guess-type-alist'." ...@@ -2547,12 +2549,13 @@ Otherwise, look up symbol in `custom-guess-type-alist'."
(get (widget-value widget) 'standard-value)) (get (widget-value widget) 'standard-value))
(defvar custom-variable-menu (defvar custom-variable-menu
'(("Set for Current Session" custom-variable-set `(("Set for Current Session" custom-variable-set
(lambda (widget) (lambda (widget)
(eq (widget-get widget :custom-state) 'modified))) (eq (widget-get widget :custom-state) 'modified)))
("Save for Future Sessions" custom-variable-save ,@(when (or custom-file user-init-file)
(lambda (widget) '(("Save for Future Sessions" custom-variable-save
(memq (widget-get widget :custom-state) '(modified set changed rogue)))) (lambda (widget)
(memq (widget-get widget :custom-state) '(modified set changed rogue))))))
("Reset to Current" custom-redraw ("Reset to Current" custom-redraw
(lambda (widget) (lambda (widget)
(and (default-boundp (widget-value widget)) (and (default-boundp (widget-value widget))
...@@ -2563,11 +2566,12 @@ Otherwise, look up symbol in `custom-guess-type-alist'." ...@@ -2563,11 +2566,12 @@ Otherwise, look up symbol in `custom-guess-type-alist'."
(get (widget-value widget) 'saved-variable-comment)) (get (widget-value widget) 'saved-variable-comment))
(memq (widget-get widget :custom-state) (memq (widget-get widget :custom-state)
'(modified set changed rogue))))) '(modified set changed rogue)))))
("Erase Customization" custom-variable-reset-standard ,@(when (or custom-file user-init-file)
(lambda (widget) '(("Erase Customization" custom-variable-reset-standard
(and (get (widget-value widget) 'standard-value) (lambda (widget)
(memq (widget-get widget :custom-state) (and (get (widget-value widget) 'standard-value)
'(modified set changed saved rogue))))) (memq (widget-get widget :custom-state)
'(modified set changed saved rogue)))))))
("Use Backup Value" custom-variable-reset-backup ("Use Backup Value" custom-variable-reset-backup
(lambda (widget) (lambda (widget)
(get (widget-value widget) 'backup-value))) (get (widget-value widget) 'backup-value)))
...@@ -3218,15 +3222,17 @@ SPEC must be a full face spec." ...@@ -3218,15 +3222,17 @@ SPEC must be a full face spec."
(message "Creating face editor...done")))))) (message "Creating face editor...done"))))))
(defvar custom-face-menu (defvar custom-face-menu
'(("Set for Current Session" custom-face-set) `(("Set for Current Session" custom-face-set)
("Save for Future Sessions" custom-face-save-command) ,@(when (or custom-file user-init-file)
'(("Save for Future Sessions" custom-face-save-command)))
("Reset to Saved" custom-face-reset-saved ("Reset to Saved" custom-face-reset-saved
(lambda (widget) (lambda (widget)
(or (get (widget-value widget) 'saved-face) (or (get (widget-value widget) 'saved-face)
(get (widget-value widget) 'saved-face-comment)))) (get (widget-value widget) 'saved-face-comment))))
("Erase Customization" custom-face-reset-standard ,@(when (or custom-file user-init-file)
(lambda (widget) '(("Erase Customization" custom-face-reset-standard
(get (widget-value widget) 'face-defface-spec))) (lambda (widget)
(get (widget-value widget) 'face-defface-spec)))))
("---" ignore ignore) ("---" ignore ignore)
("Add Comment" custom-comment-show custom-comment-invisible-p) ("Add Comment" custom-comment-show custom-comment-invisible-p)
("---" ignore ignore) ("---" ignore ignore)
...@@ -3808,21 +3814,23 @@ Creating group members... %2d%%" ...@@ -3808,21 +3814,23 @@ Creating group members... %2d%%"
(insert "/\n"))))) (insert "/\n")))))
(defvar custom-group-menu (defvar custom-group-menu
'(("Set for Current Session" custom-group-set `(("Set for Current Session" custom-group-set
(lambda (widget) (lambda (widget)
(eq (widget-get widget :custom-state) 'modified))) (eq (widget-get widget :custom-state) 'modified)))
("Save for Future Sessions" custom-group-save ,@(when (or custom-file user-init-file)
(lambda (widget) '(("Save for Future Sessions" custom-group-save
(memq (widget-get widget :custom-state) '(modified set)))) (lambda (widget)
(memq (widget-get widget :custom-state) '(modified set))))))
("Reset to Current" custom-group-reset-current ("Reset to Current" custom-group-reset-current
(lambda (widget) (lambda (widget)
(memq (widget-get widget :custom-state) '(modified)))) (memq (widget-get widget :custom-state) '(modified))))
("Reset to Saved" custom-group-reset-saved ("Reset to Saved" custom-group-reset-saved
(lambda (widget) (lambda (widget)
(memq (widget-get widget :custom-state) '(modified set)))) (memq (widget-get widget :custom-state) '(modified set))))
("Reset to standard setting" custom-group-reset-standard ,@(when (or custom-file user-init-file)
(lambda (widget) '(("Reset to standard setting" custom-group-reset-standard
(memq (widget-get widget :custom-state) '(modified set saved))))) (lambda (widget)
(memq (widget-get widget :custom-state) '(modified set saved)))))))
"Alist of actions for the `custom-group' widget. "Alist of actions for the `custom-group' widget.
Each entry has the form (NAME ACTION FILTER) where NAME is the name of 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 the menu entry, ACTION is the function to call on the widget when the
......
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