diff options
Diffstat (limited to 'lisp/cus-edit.el')
| -rw-r--r-- | lisp/cus-edit.el | 85 |
1 files changed, 38 insertions, 47 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index a5f9e301946..763b4b8c57f 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -1470,22 +1470,19 @@ See " | |||
| 1470 | (if custom-raised-buttons | 1470 | (if custom-raised-buttons |
| 1471 | "`Raised' text indicates" | 1471 | "`Raised' text indicates" |
| 1472 | "Square brackets indicate"))) | 1472 | "Square brackets indicate"))) |
| 1473 | (widget-create 'info-link | 1473 | (widget-create 'custom-manual |
| 1474 | :tag "Custom file" | 1474 | :tag "Custom file" |
| 1475 | :button-face 'custom-link | ||
| 1476 | :mouse-face 'highlight | ||
| 1477 | "(emacs)Saving Customizations") | 1475 | "(emacs)Saving Customizations") |
| 1478 | (widget-insert | 1476 | (widget-insert |
| 1479 | " for information on how to save in a different file.\n | 1477 | " for information on how to save in a different file.\n |
| 1480 | See ") | 1478 | See ") |
| 1481 | (widget-create 'info-link | 1479 | (widget-create 'custom-manual |
| 1482 | :tag "Help" | 1480 | :tag "Help" |
| 1483 | :button-face 'custom-link | ||
| 1484 | :mouse-face 'highlight | ||
| 1485 | :help-echo "Read the online help." | 1481 | :help-echo "Read the online help." |
| 1486 | "(emacs)Easy Customization") | 1482 | "(emacs)Easy Customization") |
| 1487 | (widget-insert " for more information.\n\n") | 1483 | (widget-insert " for more information.\n\n") |
| 1488 | (widget-insert "Operate on everything in this buffer:\n ")) | 1484 | (widget-insert "Operate on all settings in this buffer that \ |
| 1485 | are not marked HIDDEN:\n ")) | ||
| 1489 | (widget-insert " ")) | 1486 | (widget-insert " ")) |
| 1490 | (widget-create 'push-button | 1487 | (widget-create 'push-button |
| 1491 | :tag "Set for Current Session" | 1488 | :tag "Set for Current Session" |
| @@ -1496,10 +1493,8 @@ Make your editing in this buffer take effect for this session." | |||
| 1496 | (if (not custom-buffer-verbose-help) | 1493 | (if (not custom-buffer-verbose-help) |
| 1497 | (progn | 1494 | (progn |
| 1498 | (widget-insert " ") | 1495 | (widget-insert " ") |
| 1499 | (widget-create 'info-link | 1496 | (widget-create 'custom-manual |
| 1500 | :tag "Help" | 1497 | :tag "Help" |
| 1501 | :button-face 'custom-link | ||
| 1502 | :mouse-face 'highlight | ||
| 1503 | :help-echo "Read the online help." | 1498 | :help-echo "Read the online help." |
| 1504 | "(emacs)Easy Customization"))) | 1499 | "(emacs)Easy Customization"))) |
| 1505 | (when (or custom-file user-init-file) | 1500 | (when (or custom-file user-init-file) |
| @@ -1647,7 +1642,7 @@ item in another window.\n\n")) | |||
| 1647 | (let ((custom-buffer-style 'tree)) | 1642 | (let ((custom-buffer-style 'tree)) |
| 1648 | (custom-toggle-parent widget))) | 1643 | (custom-toggle-parent widget))) |
| 1649 | 1644 | ||
| 1650 | (define-widget 'custom-browse-group-tag 'push-button | 1645 | (define-widget 'custom-browse-group-tag 'custom-group-link |
| 1651 | "Show parent in other window when activated." | 1646 | "Show parent in other window when activated." |
| 1652 | :tag "Group" | 1647 | :tag "Group" |
| 1653 | :tag-glyph "folder" | 1648 | :tag-glyph "folder" |
| @@ -1657,7 +1652,7 @@ item in another window.\n\n")) | |||
| 1657 | (let ((parent (widget-get widget :parent))) | 1652 | (let ((parent (widget-get widget :parent))) |
| 1658 | (customize-group-other-window (widget-value parent)))) | 1653 | (customize-group-other-window (widget-value parent)))) |
| 1659 | 1654 | ||
| 1660 | (define-widget 'custom-browse-variable-tag 'push-button | 1655 | (define-widget 'custom-browse-variable-tag 'custom-group-link |
| 1661 | "Show parent in other window when activated." | 1656 | "Show parent in other window when activated." |
| 1662 | :tag "Option" | 1657 | :tag "Option" |
| 1663 | :tag-glyph "option" | 1658 | :tag-glyph "option" |
| @@ -1667,7 +1662,7 @@ item in another window.\n\n")) | |||
| 1667 | (let ((parent (widget-get widget :parent))) | 1662 | (let ((parent (widget-get widget :parent))) |
| 1668 | (customize-variable-other-window (widget-value parent)))) | 1663 | (customize-variable-other-window (widget-value parent)))) |
| 1669 | 1664 | ||
| 1670 | (define-widget 'custom-browse-face-tag 'push-button | 1665 | (define-widget 'custom-browse-face-tag 'custom-group-link |
| 1671 | "Show parent in other window when activated." | 1666 | "Show parent in other window when activated." |
| 1672 | :tag "Face" | 1667 | :tag "Face" |
| 1673 | :tag-glyph "face" | 1668 | :tag-glyph "face" |
| @@ -2009,13 +2004,7 @@ and `face'." | |||
| 2009 | :group 'custom-faces) | 2004 | :group 'custom-faces) |
| 2010 | 2005 | ||
| 2011 | (defface custom-button-unraised | 2006 | (defface custom-button-unraised |
| 2012 | '((((min-colors 88) | 2007 | '((t :inherit underline)) |
| 2013 | (class color) (background light)) :foreground "blue1" :underline t) | ||
| 2014 | (((class color) (background light)) :foreground "blue" :underline t) | ||
| 2015 | (((min-colors 88) | ||
| 2016 | (class color) (background dark)) :foreground "cyan1" :underline t) | ||
| 2017 | (((class color) (background dark)) :foreground "cyan" :underline t) | ||
| 2018 | (t :underline t)) | ||
| 2019 | "Face for custom buffer buttons if `custom-raised-buttons' is nil." | 2008 | "Face for custom buffer buttons if `custom-raised-buttons' is nil." |
| 2020 | :version "22.1" | 2009 | :version "22.1" |
| 2021 | :group 'custom-faces) | 2010 | :group 'custom-faces) |
| @@ -2070,15 +2059,10 @@ and `face'." | |||
| 2070 | (put 'custom-state-face 'face-alias 'custom-state) | 2059 | (put 'custom-state-face 'face-alias 'custom-state) |
| 2071 | 2060 | ||
| 2072 | (defface custom-link | 2061 | (defface custom-link |
| 2073 | '((((min-colors 88) | 2062 | '((t :inherit link)) |
| 2074 | (class color) (background light)) :foreground "blue1" :underline t) | 2063 | "Face for links in customization buffers." |
| 2075 | (((class color) (background light)) :foreground "blue" :underline t) | 2064 | :version "22.1" |
| 2076 | (((min-colors 88) | 2065 | :group 'custom-faces) |
| 2077 | (class color) (background dark)) :foreground "cyan1" :underline t) | ||
| 2078 | (((class color) (background dark)) :foreground "cyan" :underline t) | ||
| 2079 | (t :underline t)) | ||
| 2080 | "Face for Info links in customization buffers." | ||
| 2081 | :group 'info) | ||
| 2082 | 2066 | ||
| 2083 | (define-widget 'custom 'default | 2067 | (define-widget 'custom 'default |
| 2084 | "Customize a user option." | 2068 | "Customize a user option." |
| @@ -2245,8 +2229,6 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"." | |||
| 2245 | (insert " ") | 2229 | (insert " ") |
| 2246 | (push (widget-create-child-and-convert | 2230 | (push (widget-create-child-and-convert |
| 2247 | widget 'custom-group-link | 2231 | widget 'custom-group-link |
| 2248 | :button-face 'custom-link | ||
| 2249 | :mouse-face 'highlight | ||
| 2250 | :tag (custom-unlispify-tag-name symbol) | 2232 | :tag (custom-unlispify-tag-name symbol) |
| 2251 | symbol) | 2233 | symbol) |
| 2252 | buttons) | 2234 | buttons) |
| @@ -3323,7 +3305,7 @@ SPEC must be a full face spec." | |||
| 3323 | (defvar custom-face-menu | 3305 | (defvar custom-face-menu |
| 3324 | `(("Set for Current Session" custom-face-set) | 3306 | `(("Set for Current Session" custom-face-set) |
| 3325 | ,@(when (or custom-file user-init-file) | 3307 | ,@(when (or custom-file user-init-file) |
| 3326 | '(("Save for Future Sessions" custom-face-save-command))) | 3308 | '(("Save for Future Sessions" custom-face-save))) |
| 3327 | ("Undo Edits" custom-redraw | 3309 | ("Undo Edits" custom-redraw |
| 3328 | (lambda (widget) | 3310 | (lambda (widget) |
| 3329 | (memq (widget-get widget :custom-state) '(modified changed)))) | 3311 | (memq (widget-get widget :custom-state) '(modified changed)))) |
| @@ -3448,13 +3430,8 @@ Optional EVENT is the location for the menu." | |||
| 3448 | (custom-face-state-set widget) | 3430 | (custom-face-state-set widget) |
| 3449 | (custom-redraw-magic widget))) | 3431 | (custom-redraw-magic widget))) |
| 3450 | 3432 | ||
| 3451 | (defun custom-face-save-command (widget) | ||
| 3452 | "Save in `.emacs' the face attributes in WIDGET." | ||
| 3453 | (custom-face-save widget) | ||
| 3454 | (custom-save-all)) | ||
| 3455 | |||
| 3456 | (defun custom-face-save (widget) | 3433 | (defun custom-face-save (widget) |
| 3457 | "Prepare for saving WIDGET's face attributes, but don't write `.emacs'." | 3434 | "Save in `.emacs' the face attributes in WIDGET." |
| 3458 | (let* ((symbol (widget-value widget)) | 3435 | (let* ((symbol (widget-value widget)) |
| 3459 | (child (car (widget-get widget :children))) | 3436 | (child (car (widget-get widget :children))) |
| 3460 | (value (custom-post-filter-face-spec (widget-value child))) | 3437 | (value (custom-post-filter-face-spec (widget-value child))) |
| @@ -3480,6 +3457,10 @@ Optional EVENT is the location for the menu." | |||
| 3480 | (custom-face-state-set widget) | 3457 | (custom-face-state-set widget) |
| 3481 | (custom-redraw-magic widget))) | 3458 | (custom-redraw-magic widget))) |
| 3482 | 3459 | ||
| 3460 | ;; For backward compatibility. | ||
| 3461 | (define-obsolete-function-alias 'custom-face-save-command 'custom-face-save | ||
| 3462 | "22.1") | ||
| 3463 | |||
| 3483 | (defun custom-face-reset-saved (widget) | 3464 | (defun custom-face-reset-saved (widget) |
| 3484 | "Restore WIDGET to the face's default attributes." | 3465 | "Restore WIDGET to the face's default attributes." |
| 3485 | (let* ((symbol (widget-value widget)) | 3466 | (let* ((symbol (widget-value widget)) |
| @@ -3607,6 +3588,8 @@ restoring it to the state of a face that has never been customized." | |||
| 3607 | 3588 | ||
| 3608 | (define-widget 'custom-group-link 'link | 3589 | (define-widget 'custom-group-link 'link |
| 3609 | "Show parent in other window when activated." | 3590 | "Show parent in other window when activated." |
| 3591 | :button-face 'custom-link | ||
| 3592 | :mouse-face 'highlight | ||
| 3610 | :help-echo "Create customization buffer for this group." | 3593 | :help-echo "Create customization buffer for this group." |
| 3611 | :action 'custom-group-link-action) | 3594 | :action 'custom-group-link-action) |
| 3612 | 3595 | ||
| @@ -3805,8 +3788,6 @@ If GROUPS-ONLY non-nil, return only those members that are groups." | |||
| 3805 | (if (eq custom-buffer-style 'links) | 3788 | (if (eq custom-buffer-style 'links) |
| 3806 | (push (widget-create-child-and-convert | 3789 | (push (widget-create-child-and-convert |
| 3807 | widget 'custom-group-link | 3790 | widget 'custom-group-link |
| 3808 | :button-face 'custom-link | ||
| 3809 | :mouse-face 'highlight | ||
| 3810 | :tag "Go to Group" | 3791 | :tag "Go to Group" |
| 3811 | symbol) | 3792 | symbol) |
| 3812 | buttons) | 3793 | buttons) |
| @@ -4400,6 +4381,15 @@ The format is suitable for use with `easy-menu-define'." | |||
| 4400 | ["Erase Customization" Custom-reset-standard t] | 4381 | ["Erase Customization" Custom-reset-standard t] |
| 4401 | ["Info" (info "(emacs)Easy Customization") t])) | 4382 | ["Info" (info "(emacs)Easy Customization") t])) |
| 4402 | 4383 | ||
| 4384 | (defvar custom-field-keymap | ||
| 4385 | (let ((map (copy-keymap widget-field-keymap))) | ||
| 4386 | (define-key map "\C-c\C-c" 'Custom-set) | ||
| 4387 | (define-key map "\C-x\C-s" 'Custom-save) | ||
| 4388 | map) | ||
| 4389 | "Keymap used inside editable fields in customization buffers.") | ||
| 4390 | |||
| 4391 | (widget-put (get 'editable-field 'widget-type) :keymap custom-field-keymap) | ||
| 4392 | |||
| 4403 | (defun Custom-goto-parent () | 4393 | (defun Custom-goto-parent () |
| 4404 | "Go to the parent group listed at the top of this buffer. | 4394 | "Go to the parent group listed at the top of this buffer. |
| 4405 | If several parents are listed, go to the first of them." | 4395 | If several parents are listed, go to the first of them." |
| @@ -4425,17 +4415,18 @@ If several parents are listed, go to the first of them." | |||
| 4425 | 4415 | ||
| 4426 | The following commands are available: | 4416 | The following commands are available: |
| 4427 | 4417 | ||
| 4428 | Move to next button or editable field. \\[widget-forward] | 4418 | \\<widget-keymap>\ |
| 4429 | Move to previous button or editable field. \\[widget-backward] | 4419 | Move to next button, link or editable field. \\[widget-forward] |
| 4430 | \\<widget-field-keymap>\ | 4420 | Move to previous button, link or editable field. \\[advertised-widget-backward] |
| 4421 | \\<custom-field-keymap>\ | ||
| 4431 | Complete content of editable text field. \\[widget-complete] | 4422 | Complete content of editable text field. \\[widget-complete] |
| 4432 | \\<custom-mode-map>\ | 4423 | \\<custom-mode-map>\ |
| 4433 | Invoke button under the mouse pointer. \\[Custom-move-and-invoke] | 4424 | Invoke button under the mouse pointer. \\[widget-move-and-invoke] |
| 4434 | Invoke button under point. \\[widget-button-press] | 4425 | Invoke button under point. \\[widget-button-press] |
| 4435 | Set all options from current text. \\[Custom-set] | 4426 | Set all options from current text. \\[Custom-set] |
| 4436 | Make values in current text permanent. \\[Custom-save] | 4427 | Make values in current text permanent. \\[Custom-save] |
| 4437 | Make text match actual option values. \\[Custom-reset-current] | 4428 | Make text match actual option values. \\[Custom-reset-current] |
| 4438 | Reset options to permanent settings. \\[Custom-reset-saved] | 4429 | Reset options to permanent settings. \\[Custom-reset-saved] |
| 4439 | Erase customizations; set options | 4430 | Erase customizations; set options |
| 4440 | and buffer text to the standard values. \\[Custom-reset-standard] | 4431 | and buffer text to the standard values. \\[Custom-reset-standard] |
| 4441 | 4432 | ||