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-em19-b.el < prev    next >
Encoding:
Text File  |  1995-07-14  |  19.2 KB  |  424 lines

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