aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2005-06-10 07:16:40 +0000
committerMiles Bader2005-06-10 07:16:40 +0000
commit0efefc5296d1cdd0371b3faeafbccf382e5811c7 (patch)
tree04f672f3e359934f1499c9761b4f277dac4d400e
parentd8338794e7ced36f47e50a5877b4e716ccbf1060 (diff)
downloademacs-0efefc5296d1cdd0371b3faeafbccf382e5811c7.tar.gz
emacs-0efefc5296d1cdd0371b3faeafbccf382e5811c7.zip
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-364
Remove "-face" suffix from widget faces 2005-06-10 Miles Bader <miles@gnu.org> * lisp/wid-edit.el (widget-documentation, widget-button) (widget-field, widget-single-line-field, widget-inactive) (widget-button-pressed): "-face" suffix removed from face names. (widget-documentation-face, widget-button-face) (widget-field-face, widget-single-line-field-face) (widget-inactive-face, widget-button-pressed-face): New backward-compatibility aliases for renamed faces. (widget-documentation-face, widget-button-face) (widget-button-pressed-face, widget-specify-field) (widget-specify-inactive): Use renamed widget faces.
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/wid-edit.el108
2 files changed, 73 insertions, 48 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a6f7849346b..d74aa9d564a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
12005-06-10 Miles Bader <miles@gnu.org>
2
3 * wid-edit.el (widget-documentation, widget-button)
4 (widget-field, widget-single-line-field, widget-inactive)
5 (widget-button-pressed): "-face" suffix removed from face names.
6 (widget-documentation-face, widget-button-face)
7 (widget-field-face, widget-single-line-field-face)
8 (widget-inactive-face, widget-button-pressed-face):
9 New backward-compatibility aliases for renamed faces.
10 (widget-documentation-face, widget-button-face)
11 (widget-button-pressed-face, widget-specify-field)
12 (widget-specify-inactive): Use renamed widget faces.
13
12005-06-10 Kenichi Handa <handa@m17n.org> 142005-06-10 Kenichi Handa <handa@m17n.org>
2 15
3 * term/x-win.el (x-clipboard-yank): Remove condition-case 16 * term/x-win.el (x-clipboard-yank): Remove condition-case
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index d1ea8197fec..fbd76c6931a 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -89,28 +89,32 @@
89 :group 'widgets 89 :group 'widgets
90 :group 'faces) 90 :group 'faces)
91 91
92(defvar widget-documentation-face 'widget-documentation-face 92(defvar widget-documentation-face 'widget-documentation
93 "Face used for documentation strings in widgets. 93 "Face used for documentation strings in widgets.
94This exists as a variable so it can be set locally in certain buffers.") 94This exists as a variable so it can be set locally in certain buffers.")
95 95
96(defface widget-documentation-face '((((class color) 96(defface widget-documentation '((((class color)
97 (background dark)) 97 (background dark))
98 (:foreground "lime green")) 98 (:foreground "lime green"))
99 (((class color) 99 (((class color)
100 (background light)) 100 (background light))
101 (:foreground "dark green")) 101 (:foreground "dark green"))
102 (t nil)) 102 (t nil))
103 "Face used for documentation text." 103 "Face used for documentation text."
104 :group 'widget-documentation 104 :group 'widget-documentation
105 :group 'widget-faces) 105 :group 'widget-faces)
106;; backward compatibility alias
107(put 'widget-documentation-face 'face-alias 'widget-documentation)
106 108
107(defvar widget-button-face 'widget-button-face 109(defvar widget-button-face 'widget-button
108 "Face used for buttons in widgets. 110 "Face used for buttons in widgets.
109This exists as a variable so it can be set locally in certain buffers.") 111This exists as a variable so it can be set locally in certain buffers.")
110 112
111(defface widget-button-face '((t (:weight bold))) 113(defface widget-button '((t (:weight bold)))
112 "Face used for widget buttons." 114 "Face used for widget buttons."
113 :group 'widget-faces) 115 :group 'widget-faces)
116;; backward compatibility alias
117(put 'widget-button-face 'face-alias 'widget-button)
114 118
115(defcustom widget-mouse-face 'highlight 119(defcustom widget-mouse-face 'highlight
116 "Face used for widget buttons when the mouse is above them." 120 "Face used for widget buttons when the mouse is above them."
@@ -120,33 +124,37 @@ This exists as a variable so it can be set locally in certain buffers.")
120;; TTY gets special definitions here and in the next defface, because 124;; TTY gets special definitions here and in the next defface, because
121;; the gray colors defined for other displays cause black text on a black 125;; the gray colors defined for other displays cause black text on a black
122;; background, at least on light-background TTYs. 126;; background, at least on light-background TTYs.
123(defface widget-field-face '((((type tty)) 127(defface widget-field '((((type tty))
124 :background "yellow3" 128 :background "yellow3"
125 :foreground "black") 129 :foreground "black")
126 (((class grayscale color) 130 (((class grayscale color)
127 (background light)) 131 (background light))
128 :background "gray85") 132 :background "gray85")
129 (((class grayscale color) 133 (((class grayscale color)
130 (background dark)) 134 (background dark))
131 :background "dim gray") 135 :background "dim gray")
132 (t 136 (t
133 :slant italic)) 137 :slant italic))
134 "Face used for editable fields." 138 "Face used for editable fields."
135 :group 'widget-faces) 139 :group 'widget-faces)
136 140;; backward-compatibility alias
137(defface widget-single-line-field-face '((((type tty)) 141(put 'widget-field-face 'face-alias 'widget-field)
138 :background "green3" 142
139 :foreground "black") 143(defface widget-single-line-field '((((type tty))
140 (((class grayscale color) 144 :background "green3"
141 (background light)) 145 :foreground "black")
142 :background "gray85") 146 (((class grayscale color)
143 (((class grayscale color) 147 (background light))
144 (background dark)) 148 :background "gray85")
145 :background "dim gray") 149 (((class grayscale color)
146 (t 150 (background dark))
147 :slant italic)) 151 :background "dim gray")
152 (t
153 :slant italic))
148 "Face used for editable fields spanning only a single line." 154 "Face used for editable fields spanning only a single line."
149 :group 'widget-faces) 155 :group 'widget-faces)
156;; backward-compatibility alias
157(put 'widget-single-line-field-face 'face-alias 'widget-single-line-field)
150 158
151;;; This causes display-table to be loaded, and not usefully. 159;;; This causes display-table to be loaded, and not usefully.
152;;;(defvar widget-single-line-display-table 160;;;(defvar widget-single-line-display-table
@@ -325,7 +333,7 @@ new value.")
325 (insert-and-inherit " "))) 333 (insert-and-inherit " ")))
326 (setq to (point))) 334 (setq to (point)))
327 (let ((keymap (widget-get widget :keymap)) 335 (let ((keymap (widget-get widget :keymap))
328 (face (or (widget-get widget :value-face) 'widget-field-face)) 336 (face (or (widget-get widget :value-face) 'widget-field))
329 (help-echo (widget-get widget :help-echo)) 337 (help-echo (widget-get widget :help-echo))
330 (follow-link (widget-get widget :follow-link)) 338 (follow-link (widget-get widget :follow-link))
331 (rear-sticky 339 (rear-sticky
@@ -433,24 +441,26 @@ new value.")
433 (prog1 (progn ,@form) 441 (prog1 (progn ,@form)
434 (goto-char (point-max)))))) 442 (goto-char (point-max))))))
435 443
436(defface widget-inactive-face '((((class grayscale color) 444(defface widget-inactive '((((class grayscale color)
437 (background dark)) 445 (background dark))
438 (:foreground "light gray")) 446 (:foreground "light gray"))
439 (((class grayscale color) 447 (((class grayscale color)
440 (background light)) 448 (background light))
441 (:foreground "dim gray")) 449 (:foreground "dim gray"))
442 (t 450 (t
443 (:slant italic))) 451 (:slant italic)))
444 "Face used for inactive widgets." 452 "Face used for inactive widgets."
445 :group 'widget-faces) 453 :group 'widget-faces)
454;; backward-compatibility alias
455(put 'widget-inactive-face 'face-alias 'widget-inactive)
446 456
447(defun widget-specify-inactive (widget from to) 457(defun widget-specify-inactive (widget from to)
448 "Make WIDGET inactive for user modifications." 458 "Make WIDGET inactive for user modifications."
449 (unless (widget-get widget :inactive) 459 (unless (widget-get widget :inactive)
450 (let ((overlay (make-overlay from to nil t nil))) 460 (let ((overlay (make-overlay from to nil t nil)))
451 (overlay-put overlay 'face 'widget-inactive-face) 461 (overlay-put overlay 'face 'widget-inactive)
452 ;; This is disabled, as it makes the mouse cursor change shape. 462 ;; This is disabled, as it makes the mouse cursor change shape.
453 ;; (overlay-put overlay 'mouse-face 'widget-inactive-face) 463 ;; (overlay-put overlay 'mouse-face 'widget-inactive)
454 (overlay-put overlay 'evaporate t) 464 (overlay-put overlay 'evaporate t)
455 (overlay-put overlay 'priority 100) 465 (overlay-put overlay 'priority 100)
456 (overlay-put overlay 'modification-hooks '(widget-overlay-inactive)) 466 (overlay-put overlay 'modification-hooks '(widget-overlay-inactive))
@@ -633,7 +643,7 @@ extension (xpm, xbm, gif, jpg, or png) located in
633 ;; Oh well. 643 ;; Oh well.
634 nil))) 644 nil)))
635 645
636(defvar widget-button-pressed-face 'widget-button-pressed-face 646(defvar widget-button-pressed-face 'widget-button-pressed
637 "Face used for pressed buttons in widgets. 647 "Face used for pressed buttons in widgets.
638This exists as a variable so it can be set locally in certain 648This exists as a variable so it can be set locally in certain
639buffers.") 649buffers.")
@@ -882,7 +892,7 @@ Recommended as a parent keymap for modes using widgets.")
882 (call-interactively 892 (call-interactively
883 (lookup-key widget-global-map (this-command-keys)))))) 893 (lookup-key widget-global-map (this-command-keys))))))
884 894
885(defface widget-button-pressed-face 895(defface widget-button-pressed
886 '((((min-colors 88) (class color)) 896 '((((min-colors 88) (class color))
887 (:foreground "red1")) 897 (:foreground "red1"))
888 (((class color)) 898 (((class color))
@@ -891,6 +901,8 @@ Recommended as a parent keymap for modes using widgets.")
891 (:weight bold :underline t))) 901 (:weight bold :underline t)))
892 "Face used for pressed buttons." 902 "Face used for pressed buttons."
893 :group 'widget-faces) 903 :group 'widget-faces)
904;; backward-compatibility alias
905(put 'widget-button-pressed-face 'face-alias 'widget-button-pressed)
894 906
895(defun widget-button-click (event) 907(defun widget-button-click (event)
896 "Invoke the button that the mouse is pointing at." 908 "Invoke the button that the mouse is pointing at."
@@ -2953,7 +2965,7 @@ as the value."
2953 :match 'widget-regexp-match 2965 :match 'widget-regexp-match
2954 :validate 'widget-regexp-validate 2966 :validate 'widget-regexp-validate
2955 ;; Doesn't work well with terminating newline. 2967 ;; Doesn't work well with terminating newline.
2956 ;; :value-face 'widget-single-line-field-face 2968 ;; :value-face 'widget-single-line-field
2957 :tag "Regexp") 2969 :tag "Regexp")
2958 2970
2959(defun widget-regexp-match (widget value) 2971(defun widget-regexp-match (widget value)
@@ -2979,7 +2991,7 @@ It will read a file name from the minibuffer when invoked."
2979 :prompt-value 'widget-file-prompt-value 2991 :prompt-value 'widget-file-prompt-value
2980 :format "%{%t%}: %v" 2992 :format "%{%t%}: %v"
2981 ;; Doesn't work well with terminating newline. 2993 ;; Doesn't work well with terminating newline.
2982 ;; :value-face 'widget-single-line-field-face 2994 ;; :value-face 'widget-single-line-field
2983 :tag "File") 2995 :tag "File")
2984 2996
2985(defun widget-file-complete () 2997(defun widget-file-complete ()