annotate lisp/hyperbole/hui-xe-but.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children c53a95d3c46d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;!emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; FILE: hui-xe-but.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: XEmacs button highlighting and flashing support.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; USAGE: XEmacs Lisp Library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; KEYWORDS: faces, hypermedia
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; AUTHOR: Bob Weiner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; ORG: Brown U.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; ORIG-DATE: 21-Aug-92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; LAST-MOD: 24-Oct-95 at 19:55:08 by Bob Weiner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; This file is part of Hyperbole.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; It is for use with XEmacs, a modified version of GNU Emacs V19.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; Available for use and distribution under the same terms as GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; Copyright (C) 1992-1995, Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; Developed with support from Motorola Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; DESCRIPTION:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; This is truly prototype code.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;; Can't use read-only buttons here because then outline-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; becomes unusable.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; DESCRIP-END.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (or hyperb:lemacs-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (error "(hui-xe-but.el): Load only when running XEmacs."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;;; Other required Elisp libraries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (require 'hbut)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;;; XEmacs 19.12 renamed x-color-display-p to x-display-color-p.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (if (and (fboundp 'x-color-display-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (not (fboundp 'x-display-color-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (fset 'x-display-color-p 'x-color-display-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (defun hproperty:background ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 "Returns default background color for selected frame."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (face-background (get-face 'default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (defun hproperty:foreground ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 "Returns default foreground color for selected frame."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (face-foreground (get-face 'default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;;; Public variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (defvar hproperty:but-emphasize-p nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 "*Non-nil means visually emphasize that button under mouse cursor is selectable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (defvar hproperty:but-flash-time 1000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 "*Machine specific value for empty loop counter, XEmacs button flash delay.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (defvar hproperty:item-highlight-color (hproperty:foreground)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 "Color with which to highlight list/menu selections.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 Call (hproperty:set-item-highlight <color>) to change value.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ;;; Public functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (defun hproperty:but-add (start end face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 "Add between START and END a button using FACE in current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 If 'hproperty:but-emphasize-p' is non-nil when this is called, emphasize that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 button is selectable whenever the mouse cursor moves over it."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (let ((but (make-extent start end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (set-extent-face but face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (set-extent-property but 'highlight hproperty:but-emphasize-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (defun hproperty:but-color ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 "Return current color of buffer's buttons."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (if hproperty:color-ptr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (car hproperty:color-ptr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (hproperty:foreground)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (defun hproperty:but-clear ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 "Delete all Hyperbole buttons from current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (map-extents (function (lambda (extent unused-arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (if (eq (extent-face extent) 'hbut)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (delete-extent extent))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (defun hproperty:but-create (&optional start-delim end-delim regexp-match)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 "Highlight all hyper-buttons in buffer using XEmacs extents.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 Will use optional strings START-DELIM and END-DELIM instead of default values.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 If END-DELIM is a symbol, e.g. t, then START-DELIM is taken as a regular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 expression which matches an entire button string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 If REGEXP-MATCH is non-nil, only buttons matching this argument are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 highlighted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 If 'hproperty:but-emphasize-p' is non-nil when this is called, emphasize that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 button is selectable whenever the mouse cursor moves over it."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (hproperty:but-clear)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (hproperty:but-create-all start-delim end-delim regexp-match))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (defun hproperty:but-create-all (&optional start-delim end-delim regexp-match)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 "Mark all hyper-buttons in buffer as XEmacs buttons, for later highlighting.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 Will use optional strings START-DELIM and END-DELIM instead of default values.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 If END-DELIM is a symbol, e.g. t, then START-DELIM is taken as a regular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 expression which matches an entire button string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 If REGEXP-MATCH is non-nil, only buttons matching this argument are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 highlighted."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (ebut:map (function (lambda (lbl start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (hproperty:but-add start end hproperty:but-face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 start-delim end-delim regexp-match 'include-delims))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (defun hproperty:but-delete (&optional pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (let ((extent (extent-at (or pos (point)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (if extent (delete-extent extent))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ;;; Private functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (defmacro hproperty:list-cycle (list-ptr list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 "Move LIST-PTR to next element in LIST or when at end to first element."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (` (or (and (, list-ptr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (setq (, list-ptr) (cdr (, list-ptr))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (setq (, list-ptr) (, list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ;;; Private variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (defconst hproperty:color-list '( "red" "blue" "paleturquoise4" "mediumpurple2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 "lightskyblue3" "springgreen2" "salmon" "yellowgreen" "darkorchid2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 "aquamarine4" "slateblue4" "slateblue1" "olivedrab1" "goldenrod4"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 "goldenrod3" "cadetblue2" "burlywood1" "slategrey" "mistyrose"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 "limegreen" "lightcyan" "goldenrod" "gainsboro" "skyblue1" "honeydew"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 "yellow2" "tomato3" "skyblue" "purple4" "orange3" "bisque3" "bisque2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 "grey34" "gray99" "gray63" "gray44" "gray37" "gray33" "gray26" "azure1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 "snow4" "peru" "red" "lightgoldenrod4" "mediumseagreen" "blush"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 "mediumorchid2" "lightskyblue1" "darkslateblue" "midnightblue"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 "lightsalmon1" "lemonchiffon" "yellow" "lightsalmon" "coral"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 "dodgerblue3" "darkorange4" "blue" "royalblue4" "red" "green" "cyan"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 "darkviolet" "darksalmon" "darkorange" "blue" "pink" "magenta2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 "sienna4" "khaki2" "grey75" "grey74" "grey73" "grey69" "grey68" "grey35"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 "grey13" "gray90" "gray81" "gray55" "gray51" "gray31" "snow2" "pink3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 "grey7" "gray1" "red4" "red3" "tan" "red" "yellow" "mediumvioletred"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 "lightslategrey" "lavenderblush4" "turquoise" "darkturquoise"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 "darkslategrey" "lightskyblue" "lightsalmon4" "lightsalmon3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 "forestgreen" "dodgerblue4" "orchid" "rosybrown4" "brown" "peachpuff3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 "palegreen3" "orangered2" "rose" "lightcyan4" "indianred4" "indianred3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 "seagreen2" "indianred" "deeppink1" "navyblue" "lavender" "grey"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 "deeppink" "salmon4" "salmon3" "oldlace" "grey78" "grey77" "grey54"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 "grey45" "grey21" "gray97" "gray96" "gray95" "gray88" "gray87" "gray86"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 "gray70" "gray57" "gray38" "gray12" "gray11" "plum3" "linen" "gray9"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 "gray8" "blue4" "beige" "turquoise" "blue" "lemonchiffon4"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 "darkseagreen1" "antiquewhite3" "mediumorchid" "springgreen"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 "turquoise4" "steelblue3" "mistyrose2" "lightcyan2" "red" "firebrick2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 "royalblue" "cadetblue" "skyblue3" "yellow3" "salmon1" "orange4"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 "hotpink" "grey90" "gray56" "gray39" "gray18" "gray14" "plum4" "grey6"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 "gray6" "gold3" "gold1" "blue2" "tan2" "cyan" "mediumspringgreen"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 "darkolivegreen2" "goldenrod" "lightsteelblue" "brown" "whip"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 "chartreuse3" "violetred4" "royalblue2" "royalblue1" "papayawhip"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 "mistyrose3" "lightcyan1" "aquamarine" "skyblue4" "hotpink4" "hotpink3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 "hotpink2" "dimgray" "tomato" "grey66" "grey65" "grey64" "grey33"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 "grey27" "gray76" "gray69" "gray68" "grey0" "azure" "green"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 "darkgoldenrod4" "darkgoldenrod3" "darkgoldenrod2" "darkgoldenrod"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 "brown" "lightsalmon2" "deepskyblue4" "deepskyblue3" "deepskyblue2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 "deepskyblue" "darkorange1" "violetred3" "violetred2" "violetred1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 "slateblue3" "slateblue2" "drab" "indianred1" "firebrick1" "cadetblue4"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 "violetred" "rosybrown" "blue" "firebrick" "grey100" "wheat4" "grey79"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 "grey76" "grey61" "gray93" "gray84" "gray65" "gray36" "gray32" "gray13"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 "gray10" "azure3" "snow1" "tan1" "gray" "darkolivegreen1" "blue"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 "almond" "lavenderblush3" "lavenderblush2" "lavenderblush1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 "darkolivegreen" "lavenderblush" "aquamarine2" "red" "olivedrab2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 "mistyrose4" "mistyrose1" "lightcyan3" "lightcoral" "chartreuse"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 "peachpuff" "palegreen" "mintcream" "skyblue2" "moccasin" "tomato1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 "orchid3" "maroon3" "salmon" "grey81" "grey62" "grey39" "grey38"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 "grey37" "gray92" "gray83" "gray66" "gray54" "gray50" "gray30" "gray19"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 "gray15" "azure4" "grey3" "tan3" "pink" "gray" "blue" "lightsteelblue2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 "lightsteelblue1" "green" "lightslategray" "lemonchiffon2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 "springgreen1" "greenyellow" "chartreuse2" "grey" "royalblue3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 "powderblue" "peachpuff2" "palegreen2" "cream" "slateblue" "seashell2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 "deeppink2" "darkkhaki" "maroon4" "sienna" "grey71" "grey67" "grey18"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 "gray59" "gray43" "gray25" "bisque" "red1" "mediumslateblue"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 "lightgoldenrod1" "goldenrod" "paleturquoise3" "lightskyblue4" "green"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 "yellow" "smoke" "blue" "white" "steelblue4" "rosybrown3" "peachpuff1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 "palegreen1" "blueviolet" "seashell4" "sienna3" "grey40" "gray91"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 "gray82" "gray5" "cyan2" "cyan1" "blue1" "snow" "lightgoldenrod2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 "lightslateblue" "mediumorchid3" "darkseagreen4" "springgreen3" "green"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 "slategray4" "slategray3" "slategray2" "blue" "peachpuff4" "palegreen4"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 "green" "orangered3" "goldenrod1" "ghostwhite" "firebrick4" "firebrick3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 "cadetblue3" "slategray" "seashell3" "honeydew3" "cornsilk4" "cornsilk2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 "purple1" "dimgrey" "khaki1" "ivory3" "grey70" "grey60" "grey32"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 "grey22" "grey12" "gray98" "gray89" "gray71" "gray64" "gray60" "gray49"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 "azure2" "gray3" "paleturquoise1" "mediumpurple1" "purple"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 "lemonchiffon1" "blue" "navajowhite3" "darkorchid1" "orange"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 "goldenrod2" "khaki" "chocolate2" "burlywood2" "honeydew1" "darkgreen"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 "thistle3" "thistle2" "thistle1" "thistle" "maroon2" "maroon1" "grey53"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 "grey44" "grey25" "gray74" "gray45" "gray41" "gray35" "gray27" "gray23"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 "gray16" "brown4" "wheat" "coral" "tan4" "lightgoldenrodyellow" "blue"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 "green" "gray" "palevioletred3" "mediumpurple4" "mediumpurple3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 "saddlebrown" "blue" "darkorchid4" "darkorchid3" "puff" "olivedrab4"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 "lightblue4" "lightpink" "lightgray" "honeydew2" "cornsilk1" "lace"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 "sienna1" "bisque4" "orchid" "khaki3" "grey84" "grey83" "grey82"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 "grey72" "grey52" "grey43" "grey26" "grey14" "grey10" "gray75" "gray53"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 "gray21" "gray20" "brown3" "grey8" "red2" "navy" "grey" "gold"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 "mediumaquamarine" "lightgoldenrod" "darkslategray4" "darkseagreen3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 "darkseagreen2" "antiquewhite4" "white" "springgreen4" "lightyellow4"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 "white" "aquamarine1" "turquoise3" "steelblue2" "rosybrown2" "pink"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 "gray" "indianred2" "dodgerblue" "green" "seagreen1" "deeppink4"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 "aliceblue" "magenta1" "pink" "sienna2" "orchid1" "gray100" "grey97"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 "grey94" "grey87" "grey86" "grey51" "grey42" "grey19" "gray94" "gray85"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 "gray61" "brown2" "khaki" "grey1" "gold4" "blue" "green" "grey"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 "turquoise" "paleturquoise" "mediumorchid4" "antiquewhite2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 "lightyellow2" "violet" "salmon" "chartreuse1" "turquoise1" "sandybrown"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 "orangered1" "lightpink1" "lightblue2" "lightblue1" "grey" "seagreen4"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 "seagreen3" "lightblue" "deeppink3" "burlywood" "seashell" "hotpink1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 "gray" "yellow4" "yellow" "purple" "orange" "ivory4" "grey99" "grey89"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 "grey63" "grey58" "grey49" "grey31" "grey24" "grey20" "green4" "green1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 "gray73" "gray67" "coral3" "coral2" "plum2" "pink4" "ivory" "gray4"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 "gray2" "gold2" "aquamarine" "grey" "lightgoldenrod3" "darkolivegreen3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 "darkgoldenrod1" "goldenrod" "orchid" "chiffon" "navajowhite4"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 "deepskyblue1" "lightyellow" "floralwhite" "blue" "mediumblue"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 "chocolate4" "chocolate3" "burlywood4" "turquoise" "steelblue" "green"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 "lawngreen" "honeydew4" "seagreen" "orchid4" "wheat1" "violet" "ivory1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 "grey88" "grey85" "grey57" "grey56" "grey55" "grey48" "grey47" "grey46"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 "grey30" "grey17" "gray47" "gray29" "pink2" "grey5" "grey4" "green"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 "gray0" "brown" "lightsteelblue4" "darkolivegreen4" "palevioletred4"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 "blue" "darkslategray3" "darkslategray2" "darkslategray1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 "blanchedalmond" "palegoldenrod" "blue" "lightseagreen" "lemonchiffon3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 "darkslategray" "green" "darkseagreen" "antiquewhite" "darkorange2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 "chartreuse4" "blue" "rosybrown1" "olivedrab3" "lightpink2" "orangered"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 "thistle4" "blue" "cornsilk" "salmon2" "orchid2" "ivory2" "grey93"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 "grey92" "grey91" "grey36" "grey29" "grey28" "grey16" "gray79" "gray78"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 "gray77" "gray48" "gray17" "coral4" "coral1" "plum1" "pink1" "grey9"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 "grey2" "gray7" "cyan4" "blue3" "plum" "cornflowerblue" "lightskyblue2"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 "antiquewhite1" "navajowhite2" "navajowhite1" "lightyellow3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 "navajowhite" "darkorange3" "whitesmoke" "turquoise2" "steelblue1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 "lightpink4" "lightblue3" "green" "chocolate1" "blue" "olivedrab"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 "lightgrey" "chocolate" "magenta4" "magenta3" "yellow1" "purple3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 "purple2" "orange2" "orange1" "magenta" "bisque1" "wheat2" "maroon"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 "khaki4" "grey96" "grey95" "grey80" "grey50" "grey41" "grey15" "grey11"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 "gray80" "gray58" "gray40" "gray34" "gray22" "brown1" "snow3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 "mediumturquoise" "lightsteelblue3" "palevioletred2" "palevioletred1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 "paleturquoise2" "green" "palevioletred" "mediumorchid1" "white"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 "mediumpurple" "lightyellow1" "dodgerblue2" "dodgerblue1" "violet"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 "aquamarine3" "slategray1" "gray" "orangered4" "lightpink3" "blue"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 "darkorchid" "cadetblue1" "burlywood3" "seashell1" "cornsilk3" "tomato4"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 "tomato2" "wheat3" "grey98" "grey59" "grey23" "green3" "green2" "gray72"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 "gray62" "gray52" "gray46" "gray42" "gray28" "gray24" "white" "cyan3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 "black" ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 (defvar hproperty:color-ptr nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 "Pointer to current color name table to use for Hyperbole buttons in XEmacs.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (defconst hproperty:good-colors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 "medium violet red" "indianred4" "firebrick1" "DarkGoldenrod" "NavyBlue"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 "darkorchid" "tomato3" "mediumseagreen" "deeppink" "forestgreen"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 "mistyrose4" "slategrey" "purple4" "dodgerblue3" "mediumvioletred"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 "lightsalmon3" "orangered2" "turquoise4" "Gray55"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 "Good colors for contrast against wheat background and black foreground.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 ;;; Public functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (defun hproperty:cycle-but-color (&optional color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 "Switches button color to optional COLOR name or next item referenced by hproperty:color-ptr."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (interactive "sHyperbole button color: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (if (not (x-display-color-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (if color (setq hproperty:color-ptr nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (set-face-foreground
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 hproperty:but-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (or color (car (hproperty:list-cycle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 hproperty:color-ptr hproperty:good-colors))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (hproperty:set-flash-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (sit-for 0) ;; Force display update
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (defun hproperty:set-flash-color ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 "Set button flashing colors based upon current color set."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (if (not (x-display-color-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (set-face-background hproperty:flash-face (hproperty:but-color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (set-face-foreground hproperty:flash-face (hproperty:background))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (defun hproperty:but-flash ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 "Flash a XEmacs Hyperbole button at or near point to indicate selection."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (let ((ibut) (prev)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (start (hattr:get 'hbut:current 'lbl-start))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (end (hattr:get 'hbut:current 'lbl-end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (b) (a))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (if (and start end (setq prev (extent-at start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 ibut t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (progn (if (not prev) (hproperty:but-add start end hproperty:but-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (setq b (and start (extent-at start))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 (setq b (extent-at (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (if (setq a (and (extentp b) (extent-face b)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (set-extent-face b hproperty:flash-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (sit-for 0);; Force display update
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 ;; Delay before redraw button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (let ((i 0)) (while (< i hproperty:but-flash-time) (setq i (1+ i))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (set-extent-face b a)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (sit-for 0);; Force display update
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (if (and ibut (not prev)) (hproperty:but-delete start))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (defun hproperty:set-item-highlight (&optional background foreground)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 "Setup or reset item highlight face using optional BACKGROUND and FOREGROUND."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (make-local-variable 'hproperty:item-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (if background (setq hproperty:item-highlight-color background))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (if (not hproperty:highlight-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (setq hproperty:highlight-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (or (find-face 'hproperty:highlight-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 (face-name (make-face 'hproperty:highlight-face))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (set-face-foreground hproperty:highlight-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (or foreground (hproperty:background)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (set-face-underline-p hproperty:highlight-face nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (let* ((tty (and (fboundp 'device-type)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 (eq 'tty (device-type (selected-device)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (specifiers-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (if (fboundp 'specifier-specs) 'specifier-specs 'identity))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (color-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (if (fboundp 'color-name) 'color-name 'identity))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (update-rolo-highlight-flag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (and (boundp 'rolo-highlight-face) (find-face rolo-highlight-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (or (null
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (funcall specifiers-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (face-foreground rolo-highlight-face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (equal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (funcall color-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (face-foreground rolo-highlight-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (funcall color-function (face-foreground 'default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (face-equal hproperty:highlight-face rolo-highlight-face)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (if tty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (copy-face 'italic 'hproperty:highlight-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (if (and (funcall specifiers-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (face-background hproperty:highlight-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (equal (funcall color-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (face-background hproperty:highlight-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 hproperty:item-highlight-color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (set-face-background hproperty:highlight-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 hproperty:item-highlight-color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (and background (not (equal (face-background
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 hproperty:highlight-face) background))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (set-face-background hproperty:highlight-face background))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (and foreground (not (equal (face-foreground
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 hproperty:highlight-face) foreground))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (set-face-foreground hproperty:highlight-face foreground)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (setq hproperty:item-face hproperty:highlight-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (if update-rolo-highlight-flag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (if tty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 (copy-face 'italic 'rolo-highlight-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (copy-face hproperty:highlight-face rolo-highlight-face)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (defun hproperty:select-item (&optional pnt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 "Select item in current buffer at optional position PNT using hproperty:item-face."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (if hproperty:item-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (set-extent-face (setq hproperty:item-button (make-extent (point) (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 hproperty:item-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (if pnt (goto-char pnt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (skip-chars-forward " \t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (skip-chars-backward "^ \t\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (skip-chars-forward "^ \t\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 (set-extent-endpoints hproperty:item-button start (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (sit-for 0) ;; Force display update
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (defun hproperty:select-line (&optional pnt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 "Select line in current buffer at optional position PNT using hproperty:item-face."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (if hproperty:item-button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (set-extent-face (setq hproperty:item-button (make-extent (point) (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 hproperty:item-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (if pnt (goto-char pnt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (set-extent-endpoints hproperty:item-button (point) (progn (end-of-line) (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (sit-for 0) ;; Force display update
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 ;;; Private variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (defvar hproperty:but-face (face-name (make-face 'hproperty:but-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 "Face for hyper-buttons.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (setq hproperty:but hproperty:but-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (if (and (fboundp 'device-type)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (eq 'tty (device-type (selected-device))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (copy-face 'italic 'hproperty:but-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (set-face-foreground hproperty:but-face (hproperty:but-color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (set-face-background hproperty:but-face (hproperty:background)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (defvar hproperty:flash-face (face-name (make-face 'hproperty:flash-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 "Face for flashing hyper-buttons.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 (hproperty:set-flash-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (defvar hproperty:item-button nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 "Button used to highlight an item in a listing buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (make-variable-buffer-local 'hproperty:item-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (defvar hproperty:item-face nil "Item marking face.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (defvar hproperty:highlight-face nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 "Item highlighting face. Use (hproperty:set-item-highlight) to set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (if hproperty:highlight-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 ;; Reverse foreground and background colors for default block-style highlighting.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (hproperty:set-item-highlight (hproperty:foreground) (hproperty:background)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (provide 'hui-xe-but)