diff options
| author | Chong Yidong | 2006-01-04 15:56:08 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-01-04 15:56:08 +0000 |
| commit | 73e60f534c975124124973b03fa76072a769b6c6 (patch) | |
| tree | 0387db4b493293c76b65e5e0c93e92787db0a3ed | |
| parent | 205c40f84bf25827c95e1eeb136faaa4c85a8bcb (diff) | |
| download | emacs-73e60f534c975124124973b03fa76072a769b6c6.tar.gz emacs-73e60f534c975124124973b03fa76072a769b6c6.zip | |
* cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu)
(custom-variable-menu, custom-face-menu, custom-group-menu)
(custom-buffer-create-internal): Change "Reset" to "Show".
Reorder menu items.
(custom-link): New face for Info links.
(custom-buffer-create-internal, custom-manual): Use it.
* wid-edit.el (widget-default-mouse-face-get): New function.
(widget-specify-button): Handle mouse-face like button-face.
* custom.el (load-theme): Clear old theme settings if reloading.
| -rw-r--r-- | lisp/ChangeLog | 14 | ||||
| -rw-r--r-- | lisp/cus-edit.el | 162 | ||||
| -rw-r--r-- | lisp/custom.el | 8 | ||||
| -rw-r--r-- | lisp/wid-edit.el | 12 |
4 files changed, 124 insertions, 72 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dd2e6b15cdb..12f6295ee75 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,17 @@ | |||
| 1 | 2006-01-04 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * cus-edit.el (custom-reset-menu, custom-reset, Custom-mode-menu) | ||
| 4 | (custom-variable-menu, custom-face-menu, custom-group-menu) | ||
| 5 | (custom-buffer-create-internal): Change "Reset" to "Show". | ||
| 6 | Reorder menu items. | ||
| 7 | (custom-link): New face for Info links. | ||
| 8 | (custom-buffer-create-internal, custom-manual): Use it. | ||
| 9 | |||
| 10 | * wid-edit.el (widget-default-mouse-face-get): New function. | ||
| 11 | (widget-specify-button): Handle mouse-face like button-face. | ||
| 12 | |||
| 13 | * custom.el (load-theme): Clear old theme settings if reloading. | ||
| 14 | |||
| 1 | 2006-01-03 Luc Teirlinck <teirllm@auburn.edu> | 15 | 2006-01-03 Luc Teirlinck <teirllm@auburn.edu> |
| 2 | 16 | ||
| 3 | * cus-edit.el (custom-buffer-create-internal): Move whole buffer | 17 | * cus-edit.el (custom-buffer-create-internal): Move whole buffer |
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 37350920751..08b66cb7e9e 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -768,8 +768,8 @@ groups after non-groups, if nil do not order groups at all." | |||
| 768 | (message "Aborted"))) | 768 | (message "Aborted"))) |
| 769 | 769 | ||
| 770 | (defvar custom-reset-menu | 770 | (defvar custom-reset-menu |
| 771 | '(("Current" . Custom-reset-current) | 771 | '(("Show current settings" . Custom-reset-current) |
| 772 | ("Saved" . Custom-reset-saved) | 772 | ("Show saved settings" . Custom-reset-saved) |
| 773 | ("Erase Customization (use standard values)" . Custom-reset-standard)) | 773 | ("Erase Customization (use standard values)" . Custom-reset-standard)) |
| 774 | "Alist of actions for the `Reset' button. | 774 | "Alist of actions for the `Reset' button. |
| 775 | The key is a string containing the name of the action, the value is a | 775 | The key is a string containing the name of the action, the value is a |
| @@ -779,7 +779,7 @@ when the action is chosen.") | |||
| 779 | (defun custom-reset (event) | 779 | (defun custom-reset (event) |
| 780 | "Select item from reset menu." | 780 | "Select item from reset menu." |
| 781 | (let* ((completion-ignore-case t) | 781 | (let* ((completion-ignore-case t) |
| 782 | (answer (widget-choose "Reset to" | 782 | (answer (widget-choose "Reset buffer" |
| 783 | custom-reset-menu | 783 | custom-reset-menu |
| 784 | event))) | 784 | event))) |
| 785 | (if answer | 785 | (if answer |
| @@ -1456,50 +1456,39 @@ See " | |||
| 1456 | "Square brackets indicate"))) | 1456 | "Square brackets indicate"))) |
| 1457 | (widget-create 'info-link | 1457 | (widget-create 'info-link |
| 1458 | :tag "Custom file" | 1458 | :tag "Custom file" |
| 1459 | :button-face 'custom-link | ||
| 1460 | :mouse-face 'highlight | ||
| 1459 | "(emacs)Saving Customizations") | 1461 | "(emacs)Saving Customizations") |
| 1460 | (widget-insert | 1462 | (widget-insert |
| 1461 | " for information on how to save in a different file.\n | 1463 | " for information on how to save in a different file.\n |
| 1462 | See ") | 1464 | See ") |
| 1463 | (widget-create 'info-link | 1465 | (widget-create 'info-link |
| 1464 | :tag "Help" | 1466 | :tag "Help" |
| 1467 | :button-face 'custom-link | ||
| 1468 | :mouse-face 'highlight | ||
| 1465 | :help-echo "Read the online help." | 1469 | :help-echo "Read the online help." |
| 1466 | "(emacs)Easy Customization") | 1470 | "(emacs)Easy Customization") |
| 1467 | (widget-insert " for more information.\n\n") | 1471 | (widget-insert " for more information.\n\n") |
| 1468 | (widget-insert "Operate on everything in this buffer:\n ")) | 1472 | (widget-insert "Operate on everything in this buffer:\n ")) |
| 1469 | (widget-insert " ")) | 1473 | (widget-insert " ")) |
| 1470 | (widget-create 'push-button | ||
| 1471 | :tag "Set for Current Session" | ||
| 1472 | :help-echo "\ | ||
| 1473 | Make your editing in this buffer take effect for this session." | ||
| 1474 | :action (lambda (widget &optional event) | ||
| 1475 | (Custom-set))) | ||
| 1476 | (when (or custom-file user-init-file) | ||
| 1477 | (widget-insert " ") | ||
| 1478 | (widget-create 'push-button | ||
| 1479 | :tag "Save for Future Sessions" | ||
| 1480 | :help-echo "\ | ||
| 1481 | Make your editing in this buffer take effect for future Emacs sessions. | ||
| 1482 | This updates your Emacs initialization file or creates a new one." | ||
| 1483 | :action (lambda (widget &optional event) | ||
| 1484 | (Custom-save)))) | ||
| 1485 | (if custom-reset-button-menu | 1474 | (if custom-reset-button-menu |
| 1486 | (progn | 1475 | (progn |
| 1487 | (widget-insert " ") | 1476 | (widget-insert " ") |
| 1488 | (widget-create 'push-button | 1477 | (widget-create 'push-button |
| 1489 | :tag "Reset" | 1478 | :tag "Reset buffer" |
| 1490 | :help-echo "Show a menu with reset operations." | 1479 | :help-echo "Show a menu with reset operations." |
| 1491 | :mouse-down-action (lambda (&rest junk) t) | 1480 | :mouse-down-action (lambda (&rest junk) t) |
| 1492 | :action (lambda (widget &optional event) | 1481 | :action (lambda (widget &optional event) |
| 1493 | (custom-reset event)))) | 1482 | (custom-reset event)))) |
| 1494 | (widget-insert "\n ") | 1483 | (widget-insert "\n ") |
| 1495 | (widget-create 'push-button | 1484 | (widget-create 'push-button |
| 1496 | :tag "Reset to Current" | 1485 | :tag "Show Current Settings" |
| 1497 | :help-echo "\ | 1486 | :help-echo "\ |
| 1498 | Reset all edited text in this buffer to reflect current values." | 1487 | Reset all edited text in this buffer to reflect current values." |
| 1499 | :action 'Custom-reset-current) | 1488 | :action 'Custom-reset-current) |
| 1500 | (widget-insert " ") | 1489 | (widget-insert " ") |
| 1501 | (widget-create 'push-button | 1490 | (widget-create 'push-button |
| 1502 | :tag "Reset to Saved" | 1491 | :tag "Show Saved Settings" |
| 1503 | :help-echo "\ | 1492 | :help-echo "\ |
| 1504 | Reset all settings in this buffer to their saved values." | 1493 | Reset all settings in this buffer to their saved values." |
| 1505 | :action 'Custom-reset-saved) | 1494 | :action 'Custom-reset-saved) |
| @@ -1510,13 +1499,31 @@ Reset all settings in this buffer to their saved values." | |||
| 1510 | :help-echo "\ | 1499 | :help-echo "\ |
| 1511 | Un-customize all settings in this buffer--save them with standard values." | 1500 | Un-customize all settings in this buffer--save them with standard values." |
| 1512 | :action 'Custom-reset-standard))) | 1501 | :action 'Custom-reset-standard))) |
| 1502 | (widget-insert "\n ") | ||
| 1503 | (widget-create 'push-button | ||
| 1504 | :tag "Set for Current Session" | ||
| 1505 | :help-echo "\ | ||
| 1506 | Make your editing in this buffer take effect for this session." | ||
| 1507 | :action (lambda (widget &optional event) | ||
| 1508 | (Custom-set))) | ||
| 1513 | (if (not custom-buffer-verbose-help) | 1509 | (if (not custom-buffer-verbose-help) |
| 1514 | (progn | 1510 | (progn |
| 1515 | (widget-insert " ") | 1511 | (widget-insert " ") |
| 1516 | (widget-create 'info-link | 1512 | (widget-create 'info-link |
| 1517 | :tag "Help" | 1513 | :tag "Help" |
| 1514 | :button-face 'custom-link | ||
| 1515 | :mouse-face 'highlight | ||
| 1518 | :help-echo "Read the online help." | 1516 | :help-echo "Read the online help." |
| 1519 | "(emacs)Easy Customization"))) | 1517 | "(emacs)Easy Customization"))) |
| 1518 | (when (or custom-file user-init-file) | ||
| 1519 | (widget-insert " ") | ||
| 1520 | (widget-create 'push-button | ||
| 1521 | :tag "Save for Future Sessions" | ||
| 1522 | :help-echo "\ | ||
| 1523 | Make your editing in this buffer take effect for future Emacs sessions. | ||
| 1524 | This updates your Emacs initialization file or creates a new one." | ||
| 1525 | :action (lambda (widget &optional event) | ||
| 1526 | (Custom-save)))) | ||
| 1520 | (widget-insert " ") | 1527 | (widget-insert " ") |
| 1521 | (widget-create 'push-button | 1528 | (widget-create 'push-button |
| 1522 | :tag "Finish" | 1529 | :tag "Finish" |
| @@ -1701,6 +1708,8 @@ item in another window.\n\n")) | |||
| 1701 | (define-widget 'custom-manual 'info-link | 1708 | (define-widget 'custom-manual 'info-link |
| 1702 | "Link to the manual entry for this customization option." | 1709 | "Link to the manual entry for this customization option." |
| 1703 | :help-echo "Read the manual entry for this option." | 1710 | :help-echo "Read the manual entry for this option." |
| 1711 | :button-face 'custom-link | ||
| 1712 | :mouse-face 'highlight | ||
| 1704 | :tag "Manual") | 1713 | :tag "Manual") |
| 1705 | 1714 | ||
| 1706 | ;;; The `custom-magic' Widget. | 1715 | ;;; The `custom-magic' Widget. |
| @@ -2045,6 +2054,17 @@ and `face'." | |||
| 2045 | ;; backward-compatibility alias | 2054 | ;; backward-compatibility alias |
| 2046 | (put 'custom-state-face 'face-alias 'custom-state) | 2055 | (put 'custom-state-face 'face-alias 'custom-state) |
| 2047 | 2056 | ||
| 2057 | (defface custom-link | ||
| 2058 | '((((min-colors 88) | ||
| 2059 | (class color) (background light)) :foreground "blue1" :underline t) | ||
| 2060 | (((class color) (background light)) :foreground "blue" :underline t) | ||
| 2061 | (((min-colors 88) | ||
| 2062 | (class color) (background dark)) :foreground "cyan1" :underline t) | ||
| 2063 | (((class color) (background dark)) :foreground "cyan" :underline t) | ||
| 2064 | (t :underline t)) | ||
| 2065 | "Face for Info links in customization buffers." | ||
| 2066 | :group 'info) | ||
| 2067 | |||
| 2048 | (define-widget 'custom 'default | 2068 | (define-widget 'custom 'default |
| 2049 | "Customize a user option." | 2069 | "Customize a user option." |
| 2050 | :format "%v" | 2070 | :format "%v" |
| @@ -2601,41 +2621,42 @@ Otherwise, look up symbol in `custom-guess-type-alist'." | |||
| 2601 | (get (widget-value widget) 'standard-value)) | 2621 | (get (widget-value widget) 'standard-value)) |
| 2602 | 2622 | ||
| 2603 | (defvar custom-variable-menu | 2623 | (defvar custom-variable-menu |
| 2604 | `(("Set for Current Session" custom-variable-set | 2624 | `(("Show current value" custom-redraw |
| 2605 | (lambda (widget) | ||
| 2606 | (eq (widget-get widget :custom-state) 'modified))) | ||
| 2607 | ,@(when (or custom-file user-init-file) | ||
| 2608 | '(("Save for Future Sessions" custom-variable-save | ||
| 2609 | (lambda (widget) | ||
| 2610 | (memq (widget-get widget :custom-state) '(modified set changed rogue)))))) | ||
| 2611 | ("Reset to Current" custom-redraw | ||
| 2612 | (lambda (widget) | 2625 | (lambda (widget) |
| 2613 | (and (default-boundp (widget-value widget)) | 2626 | (and (default-boundp (widget-value widget)) |
| 2614 | (memq (widget-get widget :custom-state) '(modified changed))))) | 2627 | (memq (widget-get widget :custom-state) '(modified changed))))) |
| 2615 | ("Reset to Saved" custom-variable-reset-saved | 2628 | ("Show saved value" custom-variable-reset-saved |
| 2616 | (lambda (widget) | 2629 | (lambda (widget) |
| 2617 | (and (or (get (widget-value widget) 'saved-value) | 2630 | (and (or (get (widget-value widget) 'saved-value) |
| 2618 | (get (widget-value widget) 'saved-variable-comment)) | 2631 | (get (widget-value widget) 'saved-variable-comment)) |
| 2619 | (memq (widget-get widget :custom-state) | 2632 | (memq (widget-get widget :custom-state) |
| 2620 | '(modified set changed rogue))))) | 2633 | '(modified set changed rogue))))) |
| 2621 | ,@(when (or custom-file user-init-file) | 2634 | ("Show backup value" custom-variable-reset-backup |
| 2622 | '(("Erase Customization" custom-variable-reset-standard | ||
| 2623 | (lambda (widget) | ||
| 2624 | (and (get (widget-value widget) 'standard-value) | ||
| 2625 | (memq (widget-get widget :custom-state) | ||
| 2626 | '(modified set changed saved rogue))))))) | ||
| 2627 | ("Use Backup Value" custom-variable-reset-backup | ||
| 2628 | (lambda (widget) | 2635 | (lambda (widget) |
| 2629 | (get (widget-value widget) 'backup-value))) | 2636 | (get (widget-value widget) 'backup-value))) |
| 2630 | ("---" ignore ignore) | 2637 | ("---" ignore ignore) |
| 2631 | ("Add Comment" custom-comment-show custom-comment-invisible-p) | 2638 | ("Add comment" custom-comment-show custom-comment-invisible-p) |
| 2632 | ("---" ignore ignore) | 2639 | ("Show value widget" custom-variable-edit |
| 2633 | ("Don't show as Lisp expression" custom-variable-edit | ||
| 2634 | (lambda (widget) | 2640 | (lambda (widget) |
| 2635 | (eq (widget-get widget :custom-form) 'lisp))) | 2641 | (eq (widget-get widget :custom-form) 'lisp))) |
| 2636 | ("Show initial Lisp expression" custom-variable-edit-lisp | 2642 | ("Show Lisp expression" custom-variable-edit-lisp |
| 2637 | (lambda (widget) | 2643 | (lambda (widget) |
| 2638 | (eq (widget-get widget :custom-form) 'edit)))) | 2644 | (eq (widget-get widget :custom-form) 'edit))) |
| 2645 | ("---" ignore ignore) | ||
| 2646 | ,@(when (or custom-file user-init-file) | ||
| 2647 | '(("Erase customization" custom-variable-reset-standard | ||
| 2648 | (lambda (widget) | ||
| 2649 | (and (get (widget-value widget) 'standard-value) | ||
| 2650 | (memq (widget-get widget :custom-state) | ||
| 2651 | '(modified set changed saved rogue))))))) | ||
| 2652 | ("Set for current session" custom-variable-set | ||
| 2653 | (lambda (widget) | ||
| 2654 | (eq (widget-get widget :custom-state) 'modified))) | ||
| 2655 | ,@(when (or custom-file user-init-file) | ||
| 2656 | '(("Save for future sessions" custom-variable-save | ||
| 2657 | (lambda (widget) | ||
| 2658 | (memq (widget-get widget :custom-state) | ||
| 2659 | '(modified set changed rogue))))))) | ||
| 2639 | "Alist of actions for the `custom-variable' widget. | 2660 | "Alist of actions for the `custom-variable' widget. |
| 2640 | Each entry has the form (NAME ACTION FILTER) where NAME is the name of | 2661 | Each entry has the form (NAME ACTION FILTER) where NAME is the name of |
| 2641 | the menu entry, ACTION is the function to call on the widget when the | 2662 | the menu entry, ACTION is the function to call on the widget when the |
| @@ -3273,29 +3294,29 @@ SPEC must be a full face spec." | |||
| 3273 | (message "Creating face editor...done")))))) | 3294 | (message "Creating face editor...done")))))) |
| 3274 | 3295 | ||
| 3275 | (defvar custom-face-menu | 3296 | (defvar custom-face-menu |
| 3276 | `(("Set for Current Session" custom-face-set) | 3297 | `(("Show saved face" custom-face-reset-saved |
| 3277 | ,@(when (or custom-file user-init-file) | ||
| 3278 | '(("Save for Future Sessions" custom-face-save-command))) | ||
| 3279 | ("Reset to Saved" custom-face-reset-saved | ||
| 3280 | (lambda (widget) | 3298 | (lambda (widget) |
| 3281 | (or (get (widget-value widget) 'saved-face) | 3299 | (or (get (widget-value widget) 'saved-face) |
| 3282 | (get (widget-value widget) 'saved-face-comment)))) | 3300 | (get (widget-value widget) 'saved-face-comment)))) |
| 3283 | ,@(when (or custom-file user-init-file) | ||
| 3284 | '(("Erase Customization" custom-face-reset-standard | ||
| 3285 | (lambda (widget) | ||
| 3286 | (get (widget-value widget) 'face-defface-spec))))) | ||
| 3287 | ("---" ignore ignore) | ||
| 3288 | ("Add Comment" custom-comment-show custom-comment-invisible-p) | ||
| 3289 | ("---" ignore ignore) | 3301 | ("---" ignore ignore) |
| 3290 | ("Show all display specs" custom-face-edit-all | 3302 | ("Add comment" custom-comment-show custom-comment-invisible-p) |
| 3303 | ("Show all attributes" custom-face-edit-all | ||
| 3291 | (lambda (widget) | 3304 | (lambda (widget) |
| 3292 | (not (eq (widget-get widget :custom-form) 'all)))) | 3305 | (not (eq (widget-get widget :custom-form) 'all)))) |
| 3293 | ("Just current attributes" custom-face-edit-selected | 3306 | ("Show current attributes" custom-face-edit-selected |
| 3294 | (lambda (widget) | 3307 | (lambda (widget) |
| 3295 | (not (eq (widget-get widget :custom-form) 'selected)))) | 3308 | (not (eq (widget-get widget :custom-form) 'selected)))) |
| 3296 | ("Show as Lisp expression" custom-face-edit-lisp | 3309 | ("Show Lisp expression" custom-face-edit-lisp |
| 3297 | (lambda (widget) | 3310 | (lambda (widget) |
| 3298 | (not (eq (widget-get widget :custom-form) 'lisp))))) | 3311 | (not (eq (widget-get widget :custom-form) 'lisp)))) |
| 3312 | ("---" ignore ignore) | ||
| 3313 | ,@(when (or custom-file user-init-file) | ||
| 3314 | '(("Erase customization" custom-face-reset-standard | ||
| 3315 | (lambda (widget) | ||
| 3316 | (get (widget-value widget) 'face-defface-spec))))) | ||
| 3317 | ("Set for current session" custom-face-set) | ||
| 3318 | ,@(when (or custom-file user-init-file) | ||
| 3319 | '(("Save for future sessions" custom-face-save-command)))) | ||
| 3299 | "Alist of actions for the `custom-face' widget. | 3320 | "Alist of actions for the `custom-face' widget. |
| 3300 | Each entry has the form (NAME ACTION FILTER) where NAME is the name of | 3321 | Each entry has the form (NAME ACTION FILTER) where NAME is the name of |
| 3301 | the menu entry, ACTION is the function to call on the widget when the | 3322 | the menu entry, ACTION is the function to call on the widget when the |
| @@ -3869,23 +3890,24 @@ Creating group members... %2d%%" | |||
| 3869 | (insert "/\n"))))) | 3890 | (insert "/\n"))))) |
| 3870 | 3891 | ||
| 3871 | (defvar custom-group-menu | 3892 | (defvar custom-group-menu |
| 3872 | `(("Set for Current Session" custom-group-set | 3893 | `(("Show current settings" custom-group-reset-current |
| 3873 | (lambda (widget) | ||
| 3874 | (eq (widget-get widget :custom-state) 'modified))) | ||
| 3875 | ,@(when (or custom-file user-init-file) | ||
| 3876 | '(("Save for Future Sessions" custom-group-save | ||
| 3877 | (lambda (widget) | ||
| 3878 | (memq (widget-get widget :custom-state) '(modified set)))))) | ||
| 3879 | ("Reset to Current" custom-group-reset-current | ||
| 3880 | (lambda (widget) | 3894 | (lambda (widget) |
| 3881 | (memq (widget-get widget :custom-state) '(modified)))) | 3895 | (memq (widget-get widget :custom-state) '(modified)))) |
| 3882 | ("Reset to Saved" custom-group-reset-saved | 3896 | ("Show saved settings" custom-group-reset-saved |
| 3883 | (lambda (widget) | 3897 | (lambda (widget) |
| 3884 | (memq (widget-get widget :custom-state) '(modified set)))) | 3898 | (memq (widget-get widget :custom-state) '(modified set)))) |
| 3885 | ,@(when (or custom-file user-init-file) | 3899 | ,@(when (or custom-file user-init-file) |
| 3886 | '(("Reset to standard setting" custom-group-reset-standard | 3900 | '(("Show standard settings" custom-group-reset-standard |
| 3901 | (lambda (widget) | ||
| 3902 | (memq (widget-get widget :custom-state) '(modified set saved)))))) | ||
| 3903 | ("---" ignore ignore) | ||
| 3904 | ("Set for current session" custom-group-set | ||
| 3905 | (lambda (widget) | ||
| 3906 | (eq (widget-get widget :custom-state) 'modified))) | ||
| 3907 | ,@(when (or custom-file user-init-file) | ||
| 3908 | '(("Save for future sessions" custom-group-save | ||
| 3887 | (lambda (widget) | 3909 | (lambda (widget) |
| 3888 | (memq (widget-get widget :custom-state) '(modified set saved))))))) | 3910 | (memq (widget-get widget :custom-state) '(modified set))))))) |
| 3889 | "Alist of actions for the `custom-group' widget. | 3911 | "Alist of actions for the `custom-group' widget. |
| 3890 | Each entry has the form (NAME ACTION FILTER) where NAME is the name of | 3912 | Each entry has the form (NAME ACTION FILTER) where NAME is the name of |
| 3891 | the menu entry, ACTION is the function to call on the widget when the | 3913 | the menu entry, ACTION is the function to call on the widget when the |
| @@ -4342,9 +4364,9 @@ The format is suitable for use with `easy-menu-define'." | |||
| 4342 | ,(customize-menu-create 'customize) | 4364 | ,(customize-menu-create 'customize) |
| 4343 | ["Set" Custom-set t] | 4365 | ["Set" Custom-set t] |
| 4344 | ["Save" Custom-save t] | 4366 | ["Save" Custom-save t] |
| 4345 | ["Reset to Current" Custom-reset-current t] | 4367 | ["Show current settings" Custom-reset-current t] |
| 4346 | ["Reset to Saved" Custom-reset-saved t] | 4368 | ["Show saved settings" Custom-reset-saved t] |
| 4347 | ["Reset to Standard Values" Custom-reset-standard t] | 4369 | ["Erase customizations" Custom-reset-standard t] |
| 4348 | ["Info" (info "(emacs)Easy Customization") t])) | 4370 | ["Info" (info "(emacs)Easy Customization") t])) |
| 4349 | 4371 | ||
| 4350 | (defun Custom-goto-parent () | 4372 | (defun Custom-goto-parent () |
diff --git a/lisp/custom.el b/lisp/custom.el index 6a7c6408381..6267febe0d5 100644 --- a/lisp/custom.el +++ b/lisp/custom.el | |||
| @@ -1007,11 +1007,17 @@ property `theme-feature' (which is usually a symbol created by | |||
| 1007 | (enable-theme 'user))) | 1007 | (enable-theme 'user))) |
| 1008 | 1008 | ||
| 1009 | (defun load-theme (theme) | 1009 | (defun load-theme (theme) |
| 1010 | "Try to load a theme's settings from its file. | 1010 | "Load a theme's settings from its file. |
| 1011 | This also enables the theme; use `disable-theme' to disable it." | 1011 | This also enables the theme; use `disable-theme' to disable it." |
| 1012 | ;; Note we do no check for validity of the theme here. | 1012 | ;; Note we do no check for validity of the theme here. |
| 1013 | ;; This allows to pull in themes by a file-name convention | 1013 | ;; This allows to pull in themes by a file-name convention |
| 1014 | (interactive "SCustom theme name: ") | 1014 | (interactive "SCustom theme name: ") |
| 1015 | ;; If reloading, clear out the old theme settings. | ||
| 1016 | (when (custom-theme-p theme) | ||
| 1017 | (disable-theme theme) | ||
| 1018 | (put theme 'theme-settings nil) | ||
| 1019 | (put theme 'theme-feature nil) | ||
| 1020 | (put theme 'theme-documentation nil)) | ||
| 1015 | (let ((load-path (if (file-directory-p custom-theme-directory) | 1021 | (let ((load-path (if (file-directory-p custom-theme-directory) |
| 1016 | (cons custom-theme-directory load-path) | 1022 | (cons custom-theme-directory load-path) |
| 1017 | load-path))) | 1023 | load-path))) |
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index cb55cfb5429..0735c467439 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -403,7 +403,8 @@ new value.") | |||
| 403 | ;; We want to avoid the face with image buttons. | 403 | ;; We want to avoid the face with image buttons. |
| 404 | (unless (widget-get widget :suppress-face) | 404 | (unless (widget-get widget :suppress-face) |
| 405 | (overlay-put overlay 'face (widget-apply widget :button-face-get)) | 405 | (overlay-put overlay 'face (widget-apply widget :button-face-get)) |
| 406 | (overlay-put overlay 'mouse-face widget-mouse-face)) | 406 | (overlay-put overlay 'mouse-face |
| 407 | (widget-apply widget :mouse-face-get))) | ||
| 407 | (overlay-put overlay 'pointer 'hand) | 408 | (overlay-put overlay 'pointer 'hand) |
| 408 | (overlay-put overlay 'follow-link follow-link) | 409 | (overlay-put overlay 'follow-link follow-link) |
| 409 | (overlay-put overlay 'help-echo help-echo))) | 410 | (overlay-put overlay 'help-echo help-echo))) |
| @@ -1391,6 +1392,7 @@ The value of the :type attribute should be an unconverted widget type." | |||
| 1391 | :offset 0 | 1392 | :offset 0 |
| 1392 | :format-handler 'widget-default-format-handler | 1393 | :format-handler 'widget-default-format-handler |
| 1393 | :button-face-get 'widget-default-button-face-get | 1394 | :button-face-get 'widget-default-button-face-get |
| 1395 | :mouse-face-get 'widget-default-mouse-face-get | ||
| 1394 | :sample-face-get 'widget-default-sample-face-get | 1396 | :sample-face-get 'widget-default-sample-face-get |
| 1395 | :delete 'widget-default-delete | 1397 | :delete 'widget-default-delete |
| 1396 | :copy 'identity | 1398 | :copy 'identity |
| @@ -1535,6 +1537,14 @@ If that does not exists, call the value of `widget-complete-field'." | |||
| 1535 | (widget-apply parent :button-face-get) | 1537 | (widget-apply parent :button-face-get) |
| 1536 | widget-button-face)))) | 1538 | widget-button-face)))) |
| 1537 | 1539 | ||
| 1540 | (defun widget-default-mouse-face-get (widget) | ||
| 1541 | ;; Use :mouse-face or widget-mouse-face | ||
| 1542 | (or (widget-get widget :mouse-face) | ||
| 1543 | (let ((parent (widget-get widget :parent))) | ||
| 1544 | (if parent | ||
| 1545 | (widget-apply parent :mouse-face-get) | ||
| 1546 | widget-mouse-face)))) | ||
| 1547 | |||
| 1538 | (defun widget-default-sample-face-get (widget) | 1548 | (defun widget-default-sample-face-get (widget) |
| 1539 | ;; Use :sample-face. | 1549 | ;; Use :sample-face. |
| 1540 | (widget-get widget :sample-face)) | 1550 | (widget-get widget :sample-face)) |