diff options
| author | Juri Linkov | 2006-01-23 01:21:24 +0000 |
|---|---|---|
| committer | Juri Linkov | 2006-01-23 01:21:24 +0000 |
| commit | 192e44fc8e81000009ffa0374078c8476bd35ba4 (patch) | |
| tree | 411a03b56bbb465b95025cab18e07b1e0d6a3e01 | |
| parent | de8ad208b1e42925d6e9ea237d9bbd02c02b21b0 (diff) | |
| download | emacs-192e44fc8e81000009ffa0374078c8476bd35ba4.tar.gz emacs-192e44fc8e81000009ffa0374078c8476bd35ba4.zip | |
(custom-buffer-create-internal): Use widget type
`custom-manual' instead of `info-link' and don't set properties
`button-face' and `mouse-face' explicitly.
(custom-browse-group-tag, custom-browse-variable-tag)
(custom-browse-face-tag): Inherit from widget class
`custom-group-link' instead of `push-button'.
(custom-button-unraised): Inherit from `underline' face.
(custom-link): Inherit from `link' face. Fix doc and group.
(custom-add-parent-links, custom-group-value-create): Don't set
properties `button-face' and `mouse-face' explicitly for
`custom-group-link' widget.
(custom-group-link): Add properties `button-face' and `mouse-face'
to widget definition.
(custom-field-keymap): New variable. Put `custom-field-keymap' to
editable-field's :keymap property.
(custom-mode): Fix docstring: substitute keybindings for
`widget-forward' and `widget-backward' from `widget-keymap',
`widget-complete' from `custom-field-keymap', replace old
`Custom-move-and-invoke' with `widget-move-and-invoke'. Untabify.
| -rw-r--r-- | lisp/cus-edit.el | 69 |
1 files changed, 30 insertions, 39 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 286027ac46d..87dc594b0fe 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -1470,18 +1470,14 @@ 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") |
| @@ -1497,10 +1493,8 @@ Make your editing in this buffer take effect for this session." | |||
| 1497 | (if (not custom-buffer-verbose-help) | 1493 | (if (not custom-buffer-verbose-help) |
| 1498 | (progn | 1494 | (progn |
| 1499 | (widget-insert " ") | 1495 | (widget-insert " ") |
| 1500 | (widget-create 'info-link | 1496 | (widget-create 'custom-manual |
| 1501 | :tag "Help" | 1497 | :tag "Help" |
| 1502 | :button-face 'custom-link | ||
| 1503 | :mouse-face 'highlight | ||
| 1504 | :help-echo "Read the online help." | 1498 | :help-echo "Read the online help." |
| 1505 | "(emacs)Easy Customization"))) | 1499 | "(emacs)Easy Customization"))) |
| 1506 | (when (or custom-file user-init-file) | 1500 | (when (or custom-file user-init-file) |
| @@ -1648,7 +1642,7 @@ item in another window.\n\n")) | |||
| 1648 | (let ((custom-buffer-style 'tree)) | 1642 | (let ((custom-buffer-style 'tree)) |
| 1649 | (custom-toggle-parent widget))) | 1643 | (custom-toggle-parent widget))) |
| 1650 | 1644 | ||
| 1651 | (define-widget 'custom-browse-group-tag 'push-button | 1645 | (define-widget 'custom-browse-group-tag 'custom-group-link |
| 1652 | "Show parent in other window when activated." | 1646 | "Show parent in other window when activated." |
| 1653 | :tag "Group" | 1647 | :tag "Group" |
| 1654 | :tag-glyph "folder" | 1648 | :tag-glyph "folder" |
| @@ -1658,7 +1652,7 @@ item in another window.\n\n")) | |||
| 1658 | (let ((parent (widget-get widget :parent))) | 1652 | (let ((parent (widget-get widget :parent))) |
| 1659 | (customize-group-other-window (widget-value parent)))) | 1653 | (customize-group-other-window (widget-value parent)))) |
| 1660 | 1654 | ||
| 1661 | (define-widget 'custom-browse-variable-tag 'push-button | 1655 | (define-widget 'custom-browse-variable-tag 'custom-group-link |
| 1662 | "Show parent in other window when activated." | 1656 | "Show parent in other window when activated." |
| 1663 | :tag "Option" | 1657 | :tag "Option" |
| 1664 | :tag-glyph "option" | 1658 | :tag-glyph "option" |
| @@ -1668,7 +1662,7 @@ item in another window.\n\n")) | |||
| 1668 | (let ((parent (widget-get widget :parent))) | 1662 | (let ((parent (widget-get widget :parent))) |
| 1669 | (customize-variable-other-window (widget-value parent)))) | 1663 | (customize-variable-other-window (widget-value parent)))) |
| 1670 | 1664 | ||
| 1671 | (define-widget 'custom-browse-face-tag 'push-button | 1665 | (define-widget 'custom-browse-face-tag 'custom-group-link |
| 1672 | "Show parent in other window when activated." | 1666 | "Show parent in other window when activated." |
| 1673 | :tag "Face" | 1667 | :tag "Face" |
| 1674 | :tag-glyph "face" | 1668 | :tag-glyph "face" |
| @@ -2010,13 +2004,7 @@ and `face'." | |||
| 2010 | :group 'custom-faces) | 2004 | :group 'custom-faces) |
| 2011 | 2005 | ||
| 2012 | (defface custom-button-unraised | 2006 | (defface custom-button-unraised |
| 2013 | '((((min-colors 88) | 2007 | '((t :inherit underline)) |
| 2014 | (class color) (background light)) :foreground "blue1" :underline t) | ||
| 2015 | (((class color) (background light)) :foreground "blue" :underline t) | ||
| 2016 | (((min-colors 88) | ||
| 2017 | (class color) (background dark)) :foreground "cyan1" :underline t) | ||
| 2018 | (((class color) (background dark)) :foreground "cyan" :underline t) | ||
| 2019 | (t :underline t)) | ||
| 2020 | "Face for custom buffer buttons if `custom-raised-buttons' is nil." | 2008 | "Face for custom buffer buttons if `custom-raised-buttons' is nil." |
| 2021 | :version "22.1" | 2009 | :version "22.1" |
| 2022 | :group 'custom-faces) | 2010 | :group 'custom-faces) |
| @@ -2071,15 +2059,10 @@ and `face'." | |||
| 2071 | (put 'custom-state-face 'face-alias 'custom-state) | 2059 | (put 'custom-state-face 'face-alias 'custom-state) |
| 2072 | 2060 | ||
| 2073 | (defface custom-link | 2061 | (defface custom-link |
| 2074 | '((((min-colors 88) | 2062 | '((t :inherit link)) |
| 2075 | (class color) (background light)) :foreground "blue1" :underline t) | 2063 | "Face for links in customization buffers." |
| 2076 | (((class color) (background light)) :foreground "blue" :underline t) | 2064 | :version "22.1" |
| 2077 | (((min-colors 88) | 2065 | :group 'custom-faces) |
| 2078 | (class color) (background dark)) :foreground "cyan1" :underline t) | ||
| 2079 | (((class color) (background dark)) :foreground "cyan" :underline t) | ||
| 2080 | (t :underline t)) | ||
| 2081 | "Face for Info links in customization buffers." | ||
| 2082 | :group 'info) | ||
| 2083 | 2066 | ||
| 2084 | (define-widget 'custom 'default | 2067 | (define-widget 'custom 'default |
| 2085 | "Customize a user option." | 2068 | "Customize a user option." |
| @@ -2246,8 +2229,6 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"." | |||
| 2246 | (insert " ") | 2229 | (insert " ") |
| 2247 | (push (widget-create-child-and-convert | 2230 | (push (widget-create-child-and-convert |
| 2248 | widget 'custom-group-link | 2231 | widget 'custom-group-link |
| 2249 | :button-face 'custom-link | ||
| 2250 | :mouse-face 'highlight | ||
| 2251 | :tag (custom-unlispify-tag-name symbol) | 2232 | :tag (custom-unlispify-tag-name symbol) |
| 2252 | symbol) | 2233 | symbol) |
| 2253 | buttons) | 2234 | buttons) |
| @@ -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. \\[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 | ||