home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / hyperbole / hui-xe-but.el < prev    next >
Encoding:
Text File  |  1995-05-20  |  19.2 KB  |  423 lines

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