aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/wid-edit.el
diff options
context:
space:
mode:
authorKaroly Lorentey2005-06-15 12:57:51 +0000
committerKaroly Lorentey2005-06-15 12:57:51 +0000
commitef85512e51f043d73788f00a2aed13cccde0682c (patch)
treefc1fa1378533250f260ef8eaa9a84ae882d9df84 /lisp/wid-edit.el
parent8736257554f49445f7b4402ac7a9436b38ce6452 (diff)
parentef88a9999004e6c26148c8d280d6a41f623d7249 (diff)
downloademacs-ef85512e51f043d73788f00a2aed13cccde0682c.tar.gz
emacs-ef85512e51f043d73788f00a2aed13cccde0682c.zip
Merged from miles@gnu.org--gnu-2005 (patch 80-82, 350-422)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-350 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-351 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-352 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-353 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-354 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-355 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-356 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-357 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-358 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-359 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-360 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-361 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-362 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-363 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-364 Remove "-face" suffix from widget faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365 Remove "-face" suffix from custom faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-366 Remove "-face" suffix from change-log faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-367 Remove "-face" suffix from compilation faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-368 Remove "-face" suffix from diff-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-369 lisp/longlines.el (longlines-visible-face): Face removed * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-370 Remove "-face" suffix from woman faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-371 Remove "-face" suffix from whitespace-highlight face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372 Remove "-face" suffix from ruler-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-373 Remove "-face" suffix from show-paren faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374 Remove "-face" suffix from log-view faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-375 Remove "-face" suffix from smerge faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-376 Remove "-face" suffix from show-tabs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-377 Remove "-face" suffix from highlight-changes faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-378 Remove "-face" suffix from and downcase info faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379 Remove "-face" suffix from pcvs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-380 Update uses of renamed pcvs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-381 Tweak ChangeLog * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-382 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-383 Remove "-face" suffix from strokes-char face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-384 Remove "-face" suffix from compare-windows face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-385 Remove "-face" suffix from calendar faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-386 Remove "-face" suffix from diary-button face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-387 Remove "-face" suffix from testcover faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-388 Remove "-face" suffix from viper faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-389 Remove "-face" suffix from org faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-390 Remove "-face" suffix from sgml-namespace face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-391 Remove "-face" suffix from table-cell face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-392 Remove "-face" suffix from tex-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-393 Remove "-face" suffix from texinfo-heading face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-394 Remove "-face" suffix from flyspell faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-395 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-396 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-397 Remove "-face" suffix from gomoku faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-398 Remove "-face" suffix from mpuz faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-399 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-400 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-401 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-402 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-403 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-404 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-405 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-406 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-407 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-408 Remove "-face" suffix from Buffer-menu-buffer face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-409 Remove "-face" suffix from antlr-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410 Remove "-face" suffix from ebrowse faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-411 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-412 Remove "-face" suffix from flymake faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-413 Remove "-face" suffix from idlwave faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-414 Remove "-face" suffix from sh-script faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-415 Remove "-face" suffix from vhdl-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-416 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-417 Remove "-face" suffix from which-func face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-418 Remove "-face" suffix from cperl-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-419 Remove "-face" suffix from ld-script faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-420 Fix cperl-mode font-lock problem * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-421 Tweak which-func face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-422 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-80 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-81 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-82 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-350
Diffstat (limited to 'lisp/wid-edit.el')
-rw-r--r--lisp/wid-edit.el108
1 files changed, 60 insertions, 48 deletions
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 ()