# HG changeset patch # User Richard M. Stallman # Date 1135300688 0 # Node ID 1c62bde2851806f4ff742667e0c0eff54e8512a1 # Parent 3c879987313fa655207e2c0e3e04c3452aa6545b (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. diff -r 3c879987313f -r 1c62bde28518 lisp/cus-edit.el --- a/lisp/cus-edit.el Thu Dec 22 23:30:36 2005 +0000 +++ b/lisp/cus-edit.el Fri Dec 23 01:18:08 2005 +0000 @@ -506,8 +506,8 @@ (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) @@ -1430,11 +1430,11 @@ (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"))) @@ -1442,13 +1442,13 @@ :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 @@ -1457,14 +1457,15 @@ 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 " ") @@ -1484,14 +1485,15 @@ (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 " ") @@ -2547,12 +2549,13 @@ (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)) @@ -2563,11 +2566,12 @@ (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))) @@ -3218,15 +3222,17 @@ (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) @@ -3808,21 +3814,23 @@ (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