annotate lisp/hilit19.el @ 4282:af81ea5c816e

(kbd_buffer_store_event): Apply all the modifiers bits before testing for quit_char and stop_character. Don't alter event->code, though. (interrupt_signal): Tell Fdo_auto_save not to print msg. Print "Auto-save done" here.
author Richard M. Stallman <rms@gnu.org>
date Mon, 26 Jul 1993 05:34:46 +0000
parents cfee000861f5
children faf739d1d572
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4251
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 ;; hilit19.el, Beta 1.9 -- customizable highlighting for Emacs19.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2 ;; Copyright (c) 1993 Free Software Foundation, Inc.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4 ;; Author: Jonathan Stigelman <Stig@netcom.com>
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 ;; Keywords: faces
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 ;; This program is free software; you can redistribute it and/or modify
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8 ;; it under the terms of the GNU General Public License as published by
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9 ;; the Free Software Foundation; either version 2 of the License, or
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; (at your option) any later version.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 ;; This program is distributed in the hope that it will be useful,
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 ;; GNU General Public License for more details.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; You should have received a copy of the GNU General Public License
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; along with this program; if not, write to the Free Software
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;;; Commentary:
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24 ;; hilit19.el, Beta 1.9 -- customizable highlighting for Emacs19.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 ;; Supports not only source code highlighting, but also rmail, VM, and gnus.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 ;; WHERE TO GET THE LATEST VERSION OF HILIT19.EL (possibly beta),
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;; PLUS LOTS OF OTHER *WAY COOL* STUFF VIA ANONYMOUS FTP:
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 ;; netcom.com:/pub/stig/src/hilit19.el.gz
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 ;; TO SUBMIT BUG REPORTS (or feedback of any sort)...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 ;; M-x hilit-submit-feedback RET
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43 ;; $Id: hilit19.el,v 1.34 1993/07/23 05:18:37 stig Exp stig $
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 ;; LCD Archive Entry:
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46 ;; emacs19/hilit19.el|Jonathan Stigelman|Stig@netcom.com
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47 ;; |Comprehensive (and comparatively fast) regex-based highlighting for Emacs 19
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 ;; Thu Jul 22 21:03:46 1993|Beta 1.9||
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 ;; GENERAL OVERVIEW
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 ;; This package installs numerous hooks to colorfully highlight your
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 ;; source code buffers as well as mail and news buffers. Most
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 ;; programming languages have predefined highlighting patterns.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57 ;; Just load hilit19 and files will be automatically highlighted as
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58 ;; they're loaded.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 ;; Rehighlight a buffer by typing C-S-l (control-shift-lowercase-L).
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 ;; If, when you edit the buffer, the coloring gets messed up, just
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 ;; redraw and the coloring will be adjusted. If automatic highlighting
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 ;; in the current buffer has been turned off, then typing C-u C-S-l will
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 ;; force a rehighlight of the entire buffer.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 ;; Hilit19 can build faces by examining the names that you give to them
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 ;; For example, green/black-bold-italic-underline would be created as
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 ;; a face with a green foreground, and a black background, using a
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 ;; bold-italic font...with underlining for good measure.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 ;; SETUP -- In your .emacs:
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 ;; (require 'hilit19) ; not intended to be autoloaded
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 ;; (setq hilit-mode-enable-list '(not text-mode))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 ;; (hilit-translate type 'RoyalBlue ; enable highlighting in C/C++
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 ;; string nil) ; disable string highlighting
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 ;; To get 100% of the utility of hilit19, you may also have to apply the
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 ;; patches below for info.el and vm5.33L_19/vm-summary.el
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 ;; SETUP -- Are you using the right font for Emacs?
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 ;; Emacs cannot properly find bold and italic fonts unless you specify a
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 ;; verbose X11 font name. Here's a good font menu:
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 ;; (setq
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 ;; x-fixed-font-alist
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 ;; '("Font Menu"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 ;; ("Fonts"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 ;; ("6x12" "-misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 ;; ("6x13" "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 ;; ("lucida 13"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 ;; "-b&h-lucidatypewriter-medium-r-normal-sans-0-0-0-0-m-0-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 ;; ("7x13" "-misc-fixed-medium-r-normal--13-120-75-75-c-70-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 ;; ("7x14" "-misc-fixed-medium-r-normal--14-130-75-75-c-70-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 ;; ("9x15" "-misc-fixed-medium-r-normal--15-140-*-*-c-*-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104 ;; ("")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 ;; ("clean 8x8" "-schumacher-clean-medium-r-normal--*-80-*-*-c-*-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 ;; ("clean 8x14" "-schumacher-clean-medium-r-normal--*-140-*-*-c-*-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 ;; ("clean 8x10" "-schumacher-clean-medium-r-normal--*-100-*-*-c-*-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 ;; ("clean 8x16" "-schumacher-clean-medium-r-normal--*-160-*-*-c-*-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109 ;; ("")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110 ;; ("sony 8x16" "-sony-fixed-medium-r-normal--16-120-100-100-c-80-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 ;; ("")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 ;; ("-- Courier --")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 ;; ("Courier 10" "-adobe-courier-medium-r-normal--*-100-*-*-m-*-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 ;; ("Courier 12" "-adobe-courier-medium-r-normal--*-120-*-*-m-*-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 ;; ("Courier 14" "-adobe-courier-medium-r-normal--*-140-*-*-m-*-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116 ;; ("Courier 18" "-adobe-courier-medium-r-normal--*-180-*-*-m-*-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117 ;; ("Courier 18-b" "-adobe-courier-bold-r-normal--*-180-*-*-m-*-*-1")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 ;; )))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 ;; KNOWN BUGS/TO DO LIST/HELP WANTED/APPLY WITHIN
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 ;; * unbalanced double quote characters can confuse hilit19. This will be
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 ;; fixed, so don't bug me about it.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 ;; * ALTHOUGH HILIT19 IS FASTER THAN FONT-LOCK-MODE, for various reasons,
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 ;; the speed of the package could still stand to be improved. If you care
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129 ;; to do a little profiling and make things tighter...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 ;; * hilit-toggle-highlight is flaky in large buffers where auto-rehighlight
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 ;; is numeric after toggling twice, it loses it's numeric value
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 ;; PROJECTS THAT YOU CAN TAKE OVER BECAUSE I DON'T MUCH CARE ABOUT THEM...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 ;; * Moved hilit-wysiwyg-replace here from my version of man.el, this is not
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 ;; a bug. The bug is that I don't have a reverse operation yet...just a
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 ;; stub Wysiwyg-anything really belongs in a package of it's own.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 ;; Thanks to the following people for their input:
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143 ;; ebert@enpc.enpc.fr (Rolf EBERT), ada, LaTeX & bibtex highlights
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 ;; Vivek Khera <khera@cs.duke.edu>, gnus hooks + random advice & patches
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145 ;; brian@athe.WUstl.EDU (Brian Dunford-Shore), prolog highlights
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 ;; John Ladwig <jladwig@soils.umn.edu>, 1st pass nroff highlights
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 ;; campo@sunthpi3.difi.unipi.it (Massimo Campostrini), fortran highlights
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148 ;; jayb@laplace.MATH.ColoState.EDU (Jay Bourland), 1st pass dired
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149 ;; Yoshio Turner <yoshio@CS.UCLA.EDU>, modula 2 highlights
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 ;; Fritz Knabe <knabe@ecrc.de>, advice & patches
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151 ;; Alon Albert <alon@milcse.rtsg.mot.com>, advice & patches
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 ;; dana@thumper.bellcore.com (Dana A. Chee), for breaking it...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 ;; derway@ndc.com (Don Erway), for breaking it...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155 ;; With suggestions and minor regex patches from numerous others...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 ;; HISTORY
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 ;; V1.9 21-July-1993 Stig@netcom.com
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 ;; better documentation and added the function hilit-submit-feedback.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 ;; no longer rebind ^L, now C-S-l (control shift l) repaints the buffer
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 ;; multi-line highlights no longer cause problems when
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 ;; hilit-auto-rehighlight is 'visible
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 ;; added hilit-predefined-face-list...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 ;; changed name of hilit-mode-alist to hilit-patterns-alist
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 ;; added hilit-message-quietly to mail-setup-hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 ;; added hilit-parser-alist which can be used to apply different patterns to
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 ;; different parts of a buffer. This could be integrated in a far more
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171 ;; elegant manner, but it presently serves the purpose of not applying
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 ;; message header patterns to message bodies in mail-mode and it's kin.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173 ;; hilit-set-mode-patterns now takes a list of modes and an optional parse-fn
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174 ;; V1.8 19-July-1993 Stig@netcom.com
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
175 ;; changed hilit-translate to be a macro so that now it mirrors setq
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176 ;; now permit multiple layers of face-translation...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177 ;; hilit-lookup-face-create now parses background colors
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
178 ;; added code to check for face changes and recopy the fonts from 'default
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179 ;; when necessary. this can be disabled if you never change fonts.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180 ;; you should be able to change fonts, redraw, and have all of your
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 ;; bold & italic faces back to normal. Should work in new frames as well.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182 ;; fixed typo for one of the vm hooks and included the magic patch to
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183 ;; vm5.33 that keeps the summary window up to date.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 ;; got rid of the annoying dings and delays when colors aren't available
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185 ;; set case-fold-search to nil in highlighting-region function
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 ;; fixed minor bug in hilit-rehighlight-message-quietly
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187 ;; patches to Info, LaTeX, fortran, nroff, & c++ patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 ;; modula-2-mode support
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 ;; improved gnus-mark-article-hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190 ;; moved timecard-mode highlights to timecard-mode itself
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 ;; V1.7 12-July-1993 Stig@netcom.com
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 ;; fix to dired patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193 ;; punted on the dual functionality in hilit-auto-highlight and added
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194 ;; hilit-mode-enable-list, which permits users to specifically lock out
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 ;; modes by preventing them from being added into the hilit-mode-list
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 ;; incorporated defaults for dark backgrounds (see hilit-background-mode)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197 ;; incorporated fortran highlighting patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
198 ;; patches to ada-mode and msg-header regexes
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
199 ;; added msg-separator pattern
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200 ;; changed dired-backup to dired ignored which (which is derived from the
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201 ;; variable completion-ignored-extensions)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202 ;; V1.6 5-July-1993 Stig@netcom.com
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 ;; added dired patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 ;; fixed minor typo bug in mail patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205 ;; added profiling hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206 ;; V1.5 5-July-1993 Stig@netcom.com
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 ;; changed behavior of hilit-recenter to more closely match that of recenter
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208 ;; hilit-auto-highlight can now be a list of major-modes to highlight on find
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209 ;; reverted to using overlays...the cost of text-properties is too high, IMHO
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 ;; added 'visible option to hilit-auto-rehighlight variable
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 ;; now highlighting support for info pages (see patch below)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 ;; added hilit-yank and hilit-yank-pop which replace their analogues
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 ;; wrote special parsing function for strings...bug squished...faster too
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 ;; tuned the texinfo patterns for better performance
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215 ;; nroff support
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216 ;; V1.4 2-July-1993 Stig@netcom.com
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 ;; more efficient highlighting for news and mail
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 ;; switched to text properties (this may be temporary)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 ;; changed regular expressions for c*mode to accomodate syntax tables
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220 ;; minor mod to Ada parameter regexp
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221 ;; now catch regex stack overflows and print an error
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222 ;; string matching now uses start and end expressions to prevent overflows
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 ;; V1.3 28-June-1993 Stig@netcom.com
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 ;; added support for hexadecimal color specification under X
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225 ;; added hilit-translate for simple color translations
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226 ;; changed coverage of hilit-quietly...when it's quiet, it's always quiet.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
227 ;; removed extra call to unhighlight-region in rehighlight-buffer
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228 ;; automatically installs hooks, unless hilit-inhibit-hooks set before load
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229 ;; installed fixes for latex
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230 ;; V1.2 28-June-1993 Stig@netcom.com
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
231 ;; partially fixed bug in hilit-toggle-highlight
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
232 ;; added string highlighting
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233 ;; fixed bug in hilit-lookup-face-create
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
234 ;; additions for Ada, Tex, LaTeX, and Texinfo (is scribe next? =)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
235 ;; now highlight template decls in C++
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
236 ;; added reverse-* intelligence to hilit-lookup-face-create
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
237 ;; imported wysiwyg (overstrike replacement) stuff from my hacks to man.el
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
238 ;; sketched out a stub of a wysiwyg write file hook, care to finish it?
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239 ;; V1.1 25-June-1993 Stig@netcom.com
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240 ;; replaced last vestiges of original hilit.el
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241 ;; now map default modes to major-mode values
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242 ;; reworked face allocation so that colors don't get tied up
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 ;; rewrote some comments that I'd put in earlier but somehow managed to nuke
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 ;; V1.0 22-June-1993 Stig@netcom.com
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245 ;; incrementally replaced just about everything...simpler, cleaner, & faster
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 ;; extended highlight coverage for C/C++ modes (highlight more things)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
247 ;; added layer of indirection to face selection
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 ;;;;;; THIS WILL ALLOW INFO PAGES TO BE HILIGHTED:
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251 ;; *** 19.15/info.el Sat Jun 19 14:47:06 1993
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
252 ;; --- 19/info.el Sun Jul 4 03:33:12 1993
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 ;; ***************
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254 ;; *** 475,481 ****
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255 ;; (setq active-expression
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256 ;; (read (current-buffer))))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 ;; (point-max)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258 ;; ! (if Info-enable-active-nodes (eval active-expression)))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
260 ;; (defun Info-set-mode-line ()
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
261 ;; (setq mode-line-buffer-identification
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262 ;; --- 475,482 ----
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
263 ;; (setq active-expression
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264 ;; (read (current-buffer))))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 ;; (point-max)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266 ;; ! (if Info-enable-active-nodes (eval active-expression)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267 ;; ! (run-hooks 'Info-select-hook)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269 ;; (defun Info-set-mode-line ()
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270 ;; (setq mode-line-buffer-identification
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
272 ;;;;;; AND THIS CAN BE APPLIED TO VM 5.33L_19
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274 ;; *** ../site/vm5.33L_19/vm-summary.el Fri Jun 4 22:17:11 1993
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275 ;; --- ./vm-summary.el Tue Jun 22 16:39:30 1993
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276 ;; ***************
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 ;; *** 152,158 ****
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278 ;; (insert "->")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279 ;; (delete-char 2)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 ;; (forward-char -2)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
281 ;; ! (and w vm-auto-center-summary (vm-auto-center-summary))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
282 ;; (and old-window (select-window old-window)))))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284 ;; (defun vm-mark-for-display-update (message)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285 ;; --- 152,159 ----
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
286 ;; (insert "->")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287 ;; (delete-char 2)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
288 ;; (forward-char -2)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289 ;; ! (and w vm-auto-center-summary (vm-auto-center-summary))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 ;; ! (run-hooks 'vm-summary-pointer-hook)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291 ;; (and old-window (select-window old-window)))))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
293 ;; (defun vm-mark-for-display-update (message)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
294 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295 ;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
296
4252
cfee000861f5 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 4251
diff changeset
297 ;;; Code:
4251
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
298
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
299 ;; User Options:
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
300
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301 (defvar hilit-quietly nil
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
302 "* If non-nil, this inhibits progress indicators during highlighting")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
303
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
304 (defvar hilit-inhibit-hooks nil
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305 "* If non-nil, this inhibits installation of hooks for Info, gnus, & vm.")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
306
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
307 (defvar hilit-background-mode 'light
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
308 "* 'mono inhibits color, 'dark or 'light indicate the background brightness.")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
309
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
310 (defvar hilit-mode-enable-list nil
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
311 "* If a list of modes to exclusively enable or specifically disable.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
312 The sense of the list is negated if it begins with the symbol 'not'.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
313 Set this variable before you load hilit19.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
314
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
315 Ex: (perl-mode jargon-mode c-mode) ; just perl, C, and jargon modes
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
316 (not text-mode) ; all modes except text mode")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
317
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
318 (defvar hilit-auto-highlight t
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
319 "* T if we should highlight all buffers as we find 'em, nil to disable
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
320 automatic highlighting by the find-file hook.")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
321
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
322 (defvar hilit-auto-highlight-maxout 57000
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
323 "* auto-highlight is disabled in buffers larger than this")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
324
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
325 (defvar hilit-auto-rehighlight t
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
326 "* If this is non-nil, then hilit-redraw and hilit-recenter will also
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
327 rehighlight part or all of the current buffer. T will rehighlights the
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
328 whole buffer, a NUMBER will rehighlight that many lines before and
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
329 after the cursor, or the symbol 'visible' will rehighlight only the visible
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
330 portion of the current buffer.")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
331
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
332 (make-variable-buffer-local 'hilit-auto-rehighlight)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
333 (setq-default hilit-auto-rehighlight t)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
334
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
335 (defvar hilit-auto-rehighlight-fallback '(20000 . 100)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
336 "* Cons of the form (THRESHOLD . FALLBACK), where FALLBACK is assigned to
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
337 hilit-auto-rehighlight if the size of a newly opened buffer is larger than
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
338 THRESHOLD.")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
339
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
340 (defvar hilit-face-check t
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
341 "* T slows down highlighting but permits the user to change fonts without
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
342 losing bold and italic faces... T causes hilit-lookup-face-create to dig
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
343 through the frame parameters for the current window every time it's called.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
344 If you never change fonts in emacs, set this to NIL.")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
345
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
346 ;; Variables that are not generally modified directly
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
347
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
348 (defvar hilit-parser-alist nil
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
349 "alist of major-mode values and parsers called by hilit-rehighlight-buffer.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
350
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
351 Parsers for a given mode are IGNORED for partial rehighlights...maybe you'd
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
352 like to make this more universal?")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
353
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
354 (defvar hilit-patterns-alist nil
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
355 "alist of major-mode values and default highlighting patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
356
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
357 A hilighting pattern is a list of the form (start end face), where
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
358 start is a regex, end is a regex (or nil if it's not needed) and face
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
359 is the name of an entry in hilit-face-translation-table, the name of a face,
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
360 or nil (which disables the pattern).
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
361
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
362 See the hilit-lookup-face-create documentation for valid face names.")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
363
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
364 (defvar hilit-predefined-face-list (face-list)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
365 "List of faces which with hilit-lookup-face-create will NOT tamper.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
366
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
367 If hilit19 is dumped into emacs at your site, you may have to set this in
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
368 your init file.")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
369
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
370 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
371 ;; Use this to report bugs:
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
372
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
373 (defun hilit-submit-feeback ()
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
374 "Submit via mail a bug report on stig-paren"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
375 (interactive)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
376 (require 'reporter)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
377 (and (y-or-n-p "Do you really want to submit a report on hilit19? ")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
378 (reporter-submit-bug-report
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
379 "Jonathan Stigelman <Stig@netcom.com>"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
380 "hilit19.el Beta 1.9 ($Revision: 1.34 $)"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
381 (and (y-or-n-p "Do you need to include a dump hilit variables? ")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
382 (append
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
383 '(
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
384 hilit-quietly hilit-inhibit-hooks
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
385 hilit-background-mode hilit-mode-enable-list
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
386 hilit-auto-highlight hilit-auto-highlight-maxout
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
387 hilit-auto-rehighlight hilit-auto-rehighlight-fallback
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
388 hilit-face-check
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
389 )
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
390 (and (y-or-n-p "Have you modified the standard patterns? ")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
391 (yes-or-no-p "Are your patterns *REALLY* relevant? ")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
392 '(hilit-parser-alist
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
393 hilit-patterns-alist
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
394 hilit-predefined-face-list
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
395 ))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
396 (function
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
397 (lambda ()
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
398 (insert "\nFrame Configuration:\n====================\n"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
399 (prin1-to-string (frame-configuration-to-register ?F))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
400 "\n"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
401 )))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
402 nil
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
403 (concat
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
404 "This is (check all that apply, or delete those that don't):\n"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
405 " [ ] a _MASSIVE_THANK_YOU_ for writing hilit19.el\n"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
406 " [ ] my DONATION to your vacation fund (prototype digital cash)\n"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
407 " [ ] You're a RIGHTEOUS HACKER, what are your rates?\n"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
408 " [ ] I've used the force and read the source, but I'M CONFUSED\n"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
409 " [ ] a PATCH (diff -cw oldversion newversion) to fix a problem\n"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
410 " [ ] a REPRODUCABLE BUG that I do not believe to be an EMACS bug\n"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
411 " - I *swear* that it's not already mentioned in the KNOWN BUGS\n"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
412 " - Also, I have checked netcom.com:/pub/stig/src/hilit19.el.gz\n"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
413 " for a newer release that fixes the problem.\n"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
414 " [ ] ADVICE -- or an unfulfilled desire that I suspect you share\n"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
415 "\n"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
416 "Hey Stig, do you do anything besides hack emacs?\n"))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
417
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
418 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
419 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
420 ;; These faces are either a valid face name, or nil
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
421 ;; if you want to change them, you must do so AFTER hilit19 is loaded
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
422
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
423 (defconst hilit-face-translation-table
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
424 (cond ((and (eq hilit-background-mode 'light) (x-display-color-p))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
425 ;; COLOR DEFAULTS for LIGHT backgrounds
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
426 '(
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
427 ;; used for C/C++ and elisp and perl
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
428 (comment . firebrick-italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
429 (include . purple)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
430 (define . ForestGreen-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
431 (defun . blue-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
432 (decl . RoyalBlue)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
433 (type . nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
434 (keyword . RoyalBlue)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
435 (label . red-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
436 (string . grey40)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
437
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
438 ;; some further faces for Ada
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
439 (struct . black-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
440 (glob-struct . magenta)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
441 (named-param . DarkGoldenrod)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
442
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
443 ;; and anotherone for LaTeX
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
444 (crossref . DarkGoldenrod)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
445
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
446 (wysiwyg-bold . bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
447 (wysiwyg-underline . underline)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
448
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
449 ;; compilation buffers
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
450 (error . red-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
451 (warning . firebrick)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
452
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
453 ;; Makefiles (some faces borrowed from C/C++ too)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
454 (rule . blue-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
455
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
456 ;; VM, GNUS and Text mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
457 (msg-subject . blue-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
458 (msg-from . purple-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
459 (msg-header . firebrick-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
460 (msg-separator . black/tan-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
461 (msg-quote . ForestGreen)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
462
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
463 (summary-seen . grey40)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
464 (summary-killed . grey50)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
465 (summary-Xed . OliveDrab2)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
466 (summary-current . default/skyblue-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
467 (summary-deleted . firebrick)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
468 (summary-unread . RoyalBlue)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
469 (summary-new . blue-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
470
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
471 (gnus-group-unsubscribed . grey50)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
472 (gnus-group-empty . nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
473 (gnus-group-full . ForestGreen)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
474 (gnus-group-overflowing . firebrick)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
475
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
476 ;; dired mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
477 (dired-directory . blue-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
478 (dired-link . firebrick-italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
479 (dired-ignored . ForestGreen)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
480 (dired-deleted . red-bold-italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
481 (dired-marked . purple)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
482
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
483 ;; see jargon-mode.el and prep.ai.mit.edu:/pub/gnu/jargon*.txt
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
484 (jargon-entry . blue-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
485 (jargon-xref . purple-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
486 ;; really used for Info-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
487 (jargon-keyword . firebrick-underline)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
488 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
489 ((and (eq hilit-background-mode 'dark) (x-display-color-p))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
490 ;; COLOR DEFAULTS for DARK backgrounds
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
491 '(
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
492 ;; used for C/C++ and elisp and perl
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
493 (comment . moccasin)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
494 (include . Plum1)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
495 (define . green)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
496 (defun . cyan-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
497 (decl . cyan)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
498 (type . yellow)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
499 (keyword . cyan)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
500 (label . orange-underlined)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
501 (string . orange)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
502
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
503 ;; some further faces for Ada
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
504 (struct . white-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
505 (glob-struct . Plum1)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
506 (named-param . Goldenrod)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
507
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
508 ;; and anotherone for LaTeX
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
509 (crossref . Goldenrod)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
510
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
511 (wysiwyg-bold . bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
512 (wysiwyg-underline . underline)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
513
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
514 ;; compilation buffers
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
515 (error . yellow)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
516 (warning . green)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
517
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
518 ;; Makefiles (some faces borrowed from C/C++ too)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
519 (rule . cyan)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
520
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
521 ;; VM, GNUS and Text mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
522 (msg-subject . yellow)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
523 (msg-from . SeaGreen2)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
524 (msg-header . cyan)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
525 (msg-separator . lightblue)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
526 (msg-quote . green)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
527
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
528 (summary-seen . white)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
529 (summary-killed . white)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
530 (summary-Xed . green)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
531 (summary-current . green-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
532 (summary-deleted . white)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
533 (summary-unread . yellow)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
534 (summary-new . yellow-bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
535
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
536 (gnus-group-unsubscribed . white)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
537 (gnus-group-empty . yellow)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
538 (gnus-group-full . green)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
539 (gnus-group-overflowing . orange)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
540
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
541 ;; dired mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
542 (dired-directory . cyan)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
543 (dired-link . green)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
544 (dired-ignored . moccasin)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
545 (dired-deleted . orange)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
546 (dired-marked . Plum1)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
547
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
548 ;; see jargon-mode.el and prep.ai.mit.edu:/pub/gnu/jargon*.txt
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
549 (jargon-entry . cyan)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
550 (jargon-xref . Plum1)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
551 ;; really used for Info-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
552 (jargon-keyword . yellow)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
553 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
554 (t
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
555 ;; MONO DEFAULTS -- you lose
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
556 '(
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
557 ;; used for C/C++ and elisp and perl
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
558 (comment . italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
559 (include . default-bold-italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
560 (define . bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
561 (defun . default-bold-italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
562 (decl . bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
563 (type . nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
564 (keyword . default-bold-italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
565 (label . underline)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
566 (string . underline)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
567
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
568 ;; some further faces for Ada
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
569 (struct . bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
570 (named-param . underline)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
571 (glob-struct . default-bold-underline)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
572
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
573 ;; and another one for LaTeX
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
574 (crossref . underline)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
575
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
576 (wysiwyg-bold . bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
577 (wysiwyg-underline . underline)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
578
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
579 ;; compilation buffers
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
580 (error . bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
581 (warning . italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
582
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
583 ;; Makefiles (some faces borrowed from C/C++ too)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
584 (rule . bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
585
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
586 ;; VM, GNUS and Text mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
587 (msg-subject . bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
588 (msg-from . bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
589 (msg-header . italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
590 (msg-separator . nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
591 (msg-quote . italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
592
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
593 (summary-seen . nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
594 (summary-killed . nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
595 (summary-Xed . nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
596 (summary-current . reverse-default)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
597 (summary-unread . bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
598 (summary-deleted . italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
599 (summary-new . default-bold-italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
600
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
601 (gnus-group-unsubscribed . nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
602 (gnus-group-empty . nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
603 (gnus-group-full . italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
604 (gnus-group-overflowing . default-bold-italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
605
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
606 ;; dired mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
607 (dired-directory . bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
608 (dired-link . italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
609 (dired-ignored . nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
610 (dired-marked . nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
611 (dired-deleted . default-bold-italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
612
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
613 ;; see jargon-mode.el and prep.ai.mit.edu:/pub/gnu/jargon*.txt
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
614 (jargon-entry . bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
615 (jargon-xref . italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
616 ;; really used for Info-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
617 (jargon-keyword . underline)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
618 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
619 )
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
620 "alist that maps symbolic face-names to real face names")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
621
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
622 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
623 ;; To translate one face to another...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
624 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
625
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
626 (defmacro hilit-translate (&rest args)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
627 "(hilit-translate FROM TO FROM TO ...): translate each face FROM to the
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
628 value of its TO face. This is like setq for faces.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
629
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
630 The function hilit-lookup-face-create will repeatedly translate until no more
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
631 translations for the face exist in the translation table.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
632
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
633 See the documentation for hilit-lookup-face-create for names of valid faces.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
634 "
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
635 ;; can't have an interactive macro
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
636 ;; (interactive "SFace translate from: \nSFace translate to: ")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
637 (or (zerop (% (length args) 2))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
638 (error "wrong number of args"))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
639 (let (cmdl from to)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
640 (while args
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
641 (setq from (car args) to (nth 1 args) args (nthcdr 2 args)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
642 cmdl (cons (list 'hilit-associate ''hilit-face-translation-table
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
643 ;; this is for reverse compatibility...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
644 (if (and (consp from) (eq 'quote (car from)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
645 from
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
646 (list 'quote from)) to)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
647 cmdl)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
648 (cons 'progn cmdl)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
649
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
650 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
651 ;; This function actually translates and then creates the faces...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
652 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
653
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
654 (defun hilit-lookup-face-create (face &optional force)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
655 "Get a FACE, or create it if it doesn't exist. In order for it to
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
656 properly create the face, the followwing naming convention must be used:
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
657 [reverse-](fgcolor[/bgcolor])[-bold][-italic][-underline]
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
658 Example: (hilit-lookup-face-create 'comment-face) might create and return 'red
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
659
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
660 Each color is either the name of an X color (see .../X11/lib/X11/rgb.txt),
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
661 a hexadecimal specification of the form \"hex-[0-9A-Fa-f]+\", or \"default\".
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
662
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
663 An optional argument, FORCE, will cause the face to be recopied from the
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
664 default...which is probably of use only if you've changed fonts.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
665
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
666 See the documentation for hilit-translate and hilit-face-translation-table."
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
667
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
668 ;; translate the face ...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
669 (let ((trec t) visited)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
670 (while trec
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
671 (cond ((memq face visited) (error "face translation loop: %S" visited))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
672 (t (setq visited (cons face visited)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
673 trec (assq face hilit-face-translation-table))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
674 (and trec (setq face (cdr trec)))))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
675
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
676 ;; make the face if we need to...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
677 (let* ((fn (symbol-name face))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
678 (frame (selected-frame))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
679 (basefont (cdr (assq 'font (frame-parameters frame))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
680 error fgcolor bgcolor)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
681 (cond
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
682 ((or (null face)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
683 (memq face hilit-predefined-face-list))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
684 ;; do nothing if the face is nil or if it's predefined.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
685 )
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
686 ((or force
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
687 (not (memq face (face-list)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
688 (and hilit-face-check
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
689 (not (string= (get face 'basefont) basefont))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
690 (copy-face 'default 'scratch-face)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
691 (if (string-match "^reverse-?" fn)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
692 (progn (invert-face 'scratch-face)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
693 (setq fn (substring fn (match-end 0)))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
694
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
695 ;; parse foreground color
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
696 (if (string-match "^\\(hex-\\)?\\([A-Za-z0-9]+\\)" fn)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
697 (setq fgcolor (concat
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
698 (if (match-beginning 1) "#")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
699 (substring fn (match-beginning 2) (match-end 2)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
700 fn (substring fn (match-end 0)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
701 (error "bad face name %S" face))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
702
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
703 ;; parse background color
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
704 (if (string-match "^/\\(hex-\\)?\\([A-Za-z0-9]+\\)" fn)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
705 (setq bgcolor (concat
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
706 (and (match-beginning 1) "#")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
707 (substring fn (match-beginning 2) (match-end 2)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
708 fn (substring fn (match-end 0))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
709
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
710 (and (string= "default" fgcolor) (setq fgcolor nil))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
711 (and (string= "default" bgcolor) (setq bgcolor nil))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
712
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
713 ;; catch errors if we can't allocate the color(s)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
714 (condition-case nil
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
715 (progn (set-face-foreground 'scratch-face fgcolor)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
716 (set-face-background 'scratch-face bgcolor)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
717 (copy-face 'scratch-face face)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
718 (put face 'basefont basefont))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
719 (error (message "couldn't allocate color for '%s'"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
720 (symbol-name face))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
721 (setq face 'default)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
722 (setq error t)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
723 (or error
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
724 ;; don't bother w/ bold or italic if we didn't get the color
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
725 ;; we wanted, but ignore errors making the face bold or italic
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
726 ;; if the font isn't available, there's nothing to do about it...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
727 (progn
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
728 (set-face-font face nil frame)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
729 (set-face-underline-p face (string-match "underline" fn))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
730 (if (string-match ".*bold" fn)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
731 (make-face-bold face frame 'noerr))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
732 (if (string-match ".*italic" fn)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
733 (make-face-italic face frame 'noerr))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
734 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
735 )))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
736 face)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
737
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
738 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
739 ;; Region Highlight/Unhighlight code (Both overlay and text-property versions)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
740 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
741
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
742 (defsubst hilit-region-set-face (start end face-name &optional prio prop)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
743 "Highlight region from START to END using FACE and, optionally, PRIO.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
744 The optional 5th arg, PROP is a property to set instead of 'hilit."
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
745 (let ((overlay (make-overlay start end)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
746 (overlay-put overlay 'face face-name)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
747 (overlay-put overlay (or prop 'hilit) t)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
748 (and prio (overlay-put overlay 'priority prio))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
749
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
750 (defun hilit-unhighlight-region (start end &optional quietly)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
751 "Unhighlights the region from START to END, optionally in a QUIET way"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
752 (interactive "r")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
753 (or quietly hilit-quietly (message "Unhighlighting"))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
754 (while (< start end)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
755 (mapcar (function (lambda (ovr)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
756 (and (overlay-get ovr 'hilit) (delete-overlay ovr))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
757 (overlays-at start))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
758 (setq start (next-overlay-change start)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
759 (or quietly hilit-quietly (message "Done unhighlighting")))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
760
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
761 ;;;; These functions use text properties instead of overlays. Text properties
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
762 ;;;; are copied through kill and yank...which might be convenient, but is not
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
763 ;;;; terribly efficient as of 19.12, ERGO it's been disabled
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
764 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
765 ;;(defsubst hilit-region-set-face (start end face-name &optional prio prop)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
766 ;; "Highlight region from START to END using FACE and, optionally, PRIO.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
767 ;;The optional 5th arg, PROP is a property to set instead of 'hilit."
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
768 ;; (put-text-property start end 'face face-name)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
769 ;; )
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
770 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
771 ;;(defun hilit-unhighlight-region (start end &optional quietly)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
772 ;; "Unhighlights the region from START to END, optionally in a QUIET way"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
773 ;; (interactive "r")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
774 ;; (let ((buffer-read-only nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
775 ;; (bm (buffer-modified-p)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
776 ;; (remove-text-properties start end '(face))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
777 ;; (set-buffer-modified-p bm)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
778 ;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
779
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
780 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
781 ;; Pattern Application code and user functions
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
782 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
783
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
784 (defun hilit-highlight-region (start end &optional patterns quietly)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
785 "Highlights the area of the buffer between START and END (the region when
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
786 interactive). Without the optional PATTERNS argument, the pattern for
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
787 major-mode is used. If PATTERNS is a symbol, then the patterns associated
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
788 with that symbol are used. QUIETLY suppresses progress messages if
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
789 non-nil."
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
790 (interactive "r")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
791 (cond ((null patterns)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
792 (setq patterns (cdr (assq major-mode hilit-patterns-alist))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
793 ((symbolp patterns)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
794 (setq patterns (cdr (assq patterns hilit-patterns-alist)))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
795 ;; txt prop: (setq patterns (reverse patterns))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
796 (let ((prio (length patterns))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
797 (case-fold-search nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
798 ;; txt prop: (buffer-read-only nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
799 ;; txt prop: (bm (buffer-modified-p))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
800 p pstart pend face mstart)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
801 ;; txt prop: (unwind-protect
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
802 (save-excursion
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
803 (save-restriction
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
804 (narrow-to-region start end)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
805 (while patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
806 (setq p (car patterns))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
807 (setq pstart (car p)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
808 pend (nth 1 p)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
809 face (hilit-lookup-face-create (nth 2 p)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
810 (if (not face) ; skipped if nil
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
811 nil
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
812 (or quietly hilit-quietly
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
813 (message "highlighting %d: %s%s" prio pstart
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
814 (if pend (concat " ... " pend) "")))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
815 (goto-char (point-min))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
816 (condition-case nil
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
817 (cond
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
818 ((symbolp pstart)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
819 ;; inner loop -- special function to find pattern
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
820 (let (region)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
821 (while (setq region (funcall pstart pend))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
822 (hilit-region-set-face (car region) (cdr region)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
823 face prio))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
824 (pend
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
825 ;; inner loop -- regex-start ... regex-end
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
826 (while (re-search-forward pstart nil t nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
827 (goto-char (setq mstart (match-beginning 0)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
828 (if (re-search-forward pend nil t nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
829 (hilit-region-set-face mstart (match-end 0)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
830 face prio)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
831 (forward-char 1))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
832 (t
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
833 ;; inner loop -- just one regex to match whole pattern
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
834 (while (re-search-forward pstart nil t nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
835 (hilit-region-set-face (match-beginning 0)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
836 (match-end 0) face prio))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
837 (error (message "Unbalanced delimiters? Barfed on '%s'"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
838 pstart)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
839 (ding) (sit-for 4))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
840 (setq prio (1- prio)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
841 patterns (cdr patterns)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
842 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
843 (or quietly hilit-quietly (message "")) ; "Done highlighting"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
844 ;; txt prop: (set-buffer-modified-p bm)) ; unwind protection
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
845 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
846
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
847 (defun hilit-rehighlight-region (start end &optional quietly)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
848 "Re-highlights the region, optionally in a QUIET way"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
849 (interactive "r")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
850 (setq start (apply 'min start (mapcar 'overlay-start (overlays-at start)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
851 end (apply 'max end (mapcar 'overlay-end (overlays-at end))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
852 (hilit-unhighlight-region start end quietly)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
853 (hilit-highlight-region start end nil quietly))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
854
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
855 (defun hilit-rehighlight-buffer (&optional quietly)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
856 "Re-highlights the buffer, optionally in a QUIET way"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
857 (interactive "")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
858 (let ((parse-fn (cdr (assq major-mode hilit-parser-alist))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
859 (if parse-fn
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
860 (funcall parse-fn quietly)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
861 (hilit-rehighlight-region (point-min) (point-max) quietly)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
862 nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
863
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
864 (defun hilit-rehighlight-buffer-quietly ()
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
865 (hilit-rehighlight-buffer t))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
866
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
867 (defun hilit-rehighlight-message (quietly)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
868 "Highlight a buffer containing a news article or mail message."
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
869 (save-excursion
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
870 (goto-char (point-min))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
871 (re-search-forward "^$" nil 'noerr)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
872 (hilit-unhighlight-region (point-min) (point-max) quietly)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
873 (hilit-highlight-region (point-min) (point) 'msg-header quietly)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
874 (hilit-highlight-region (point) (point-max) 'msg-body quietly)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
875
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
876 (defalias 'hilit-highlight-buffer 'hilit-rehighlight-buffer)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
877
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
878 (defun hilit-toggle-highlight (arg)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
879 "Locally toggle highlighting. With arg, forces highlighting off."
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
880 (interactive "P")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
881 ;; FIXME -- this loses numeric information in hilit-auto-rehighlight
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
882 (setq hilit-auto-rehighlight
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
883 (and (not arg) (not hilit-auto-rehighlight)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
884 (if hilit-auto-rehighlight
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
885 (hilit-rehighlight-buffer)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
886 (hilit-unhighlight-region (point-min) (point-max)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
887 (message "Rehighlighting is set to %s" hilit-auto-rehighlight))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
888
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
889 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
890 ;; HOOKS
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
891 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
892
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
893 (defun hilit-find-file-hook ()
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
894 "Find-file hook for hilit package. See the variable hilit-auto-highlight."
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
895 (cond ((and hilit-auto-highlight
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
896 (assq major-mode hilit-patterns-alist))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
897 (if (> buffer-saved-size (car hilit-auto-rehighlight-fallback))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
898 (setq hilit-auto-rehighlight
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
899 (cdr hilit-auto-rehighlight-fallback)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
900 (if (> buffer-saved-size hilit-auto-highlight-maxout) nil
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
901 (hilit-rehighlight-buffer)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
902 (set-buffer-modified-p nil)))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
903
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
904 (defun hilit-repaint-command (arg)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
905 "Rehighlights according to the value of hilit-auto-rehighlight, or the
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
906 prefix argument if that is specified.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
907 \t\\[hilit-repaint-command]\t\trepaint according to hilit-auto-rehighlight
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
908 \t^U \\[hilit-repaint-command]\trepaint entire buffer
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
909 \t^U - \\[hilit-repaint-command]\trepaint visible portion of buffer
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
910 \t^U n \\[hilit-repaint-command]\trepaint n lines to either side of point"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
911 (interactive "P")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
912 (let (st en quietly)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
913 (or arg (setq arg hilit-auto-rehighlight))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
914 (cond ((or (eq arg 'visible) (eq arg '-))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
915 (setq st (window-start) en (window-end) quietly t))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
916 ((numberp arg)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
917 (setq st (save-excursion (forward-line (- arg)) (point))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
918 en (save-excursion (forward-line arg) (point))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
919 (arg
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
920 (hilit-rehighlight-buffer)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
921 (if st
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
922 (hilit-rehighlight-region st en quietly))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
923
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
924 ;; (defun hilit-rehighlight-yank-region ()
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
925 ;; "Rehighlights from the beginning of the line where the region starts to
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
926 ;; the end of the line where the region ends. This could flake out on
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
927 ;; multi-line highlights (like C comments and lisp strings.)"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
928 ;; (if hilit-auto-rehighlight
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
929 ;; (hilit-rehighlight-region
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
930 ;; (save-excursion (goto-char (region-beginning))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
931 ;; (beginning-of-line) (point))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
932 ;; (save-excursion (goto-char (region-end))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
933 ;; (end-of-line) (point))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
934 ;; t)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
935
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
936 (defun hilit-recenter (arg)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
937 "Recenter, then rehighlight according to hilit-auto-rehighlight. If called
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
938 with an unspecified prefix argument (^U but no number), then a rehighlight of
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
939 the entire buffer is forced."
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
940 (interactive "P")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
941 (recenter arg)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
942 ;; force display update
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
943 (sit-for 0)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
944 (hilit-repaint-command (consp arg)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
945
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
946 ;; (defun hilit-redraw-display (arg)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
947 ;; "Rehighlights according to the value of hilit-auto-rehighlight, a prefix
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
948 ;; arg forces a rehighlight of the whole buffer. Otherwise just like
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
949 ;; redraw-display."
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
950 ;; (interactive "P")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
951 ;; (hilit-redraw-internal arg)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
952 ;; (redraw-display))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
953
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
954 (defun hilit-yank (arg)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
955 "Yank with rehighlighting"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
956 (interactive "*P")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
957 (let ((transient-mark-mode nil))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
958 (yank arg)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
959 (hilit-rehighlight-region (region-beginning) (region-end) t)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
960 (setq this-command 'yank)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
961
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
962 (defun hilit-yank-pop (arg)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
963 "Yank-pop with rehighlighting"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
964 (interactive "*p")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
965 (let ((transient-mark-mode nil))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
966 (yank-pop arg)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
967 (hilit-rehighlight-region (region-beginning) (region-end) t)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
968 (setq this-command 'yank)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
969
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
970 ;;; this line highlighting stuff is untested. play with it only if you feel
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
971 ;;; adventurous...don't ask me to fix it...though you're welcome to. -- Stig
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
972 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
973 ;; (defun hilit-rehighlight-line-quietly (&rest args)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
974 ;; "Quietly rehighlight just this line.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
975 ;; Useful as an after change hook in VM/gnus summary buffers and dired buffers.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
976 ;; If only there were an after-change-function, that is..."
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
977 ;; (save-excursion
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
978 ;; (push-mark nil t)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
979 ;; (hilit-rehighlight-yank-region)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
980 ;; (and orig-achange-function (apply orig-achange-function args))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
981 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
982 ;; (defun hilit-install-line-hooks ()
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
983 ;; (make-variable-buffer-local 'after-change-function)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
984 ;; (make-local-variable 'orig-achange-function)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
985 ;; (setq orig-achange-function after-change-function)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
986 ;; (setq after-change-function 'hilit-rehighlight-line-quietly))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
987
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
988 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
989 ;; Wysiwyg Stuff... take it away and build a whole package around it!
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
990 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
991 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
992 ;; ; For the Jargon-impaired, WYSIWYG === What You See Is What You Get
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
993 ;; ; Sure, it sucks to type. Oh, well.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
994 ;; (defun hilit-wysiwyg-replace ()
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
995 ;; "Replace overstruck text with normal text that's been overlayed with the
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
996 ;; appropriate text attribute. Suitable for a find-file hook."
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
997 ;; (save-excursion
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
998 ;; (goto-char (point-min))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
999 ;; (let ((wysb (hilit-lookup-face-create 'wysiwyg-bold))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1000 ;; (wysu (hilit-lookup-face-create 'wysiwyg-underline))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1001 ;; (bmod (buffer-modified-p)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1002 ;; (while (re-search-forward "\\(.\b.\\)+" nil t)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1003 ;; (let ((st (match-beginning 0)) (en (match-end 0)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1004 ;; (goto-char st)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1005 ;; (if (looking-at "_")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1006 ;; (hilit-region-set-face st en wysu 100 'wysiwyg)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1007 ;; (hilit-region-set-face st en wysb 100 'wysiwyg))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1008 ;; (while (and (< (point) en) (looking-at ".\b"))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1009 ;; (replace-match "") (forward-char))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1010 ;; ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1011 ;; (set-buffer-modified-p bmod))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1012 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1013 ;; ; is this more appropriate as a write-file-hook or a write-contents-hook?
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1014 ;; (defun hilit-wysiwyg-write-repair ()
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1015 ;; "Replace wysiwyg overlays with overstrike text."
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1016 ;; (message "*sigh* hilit-wysiwyg-write-repair not implemented yet")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1017 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1018 ;; For efficiency, this hook should copy the current buffer to a scratch
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1019 ;; buffer and do it's overstriking there. Overlays are not copied, so it'll
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1020 ;; be necessary to hop back and forth. This is OK since you're not fiddling
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1021 ;; with--making or deleting--any overlays. THEN write the new buffer,
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1022 ;; delete it, and RETURN T. << important
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1023 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1024 ;; Just so you know...there is already an emacs function called
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1025 ;; underline-region that does underlining. I think that the thing to do is
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1026 ;; extend that to do overstriking as well.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1027 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1028 ;; (while (< start end)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1029 ;; (mapcar (function (lambda (ovr)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1030 ;; (and (overlay-get ovr 'hilit) (delete-overlay ovr))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1031 ;; (overlays-at start))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1032 ;; (setq start (next-overlay-change start)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1033 ;; nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1034
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1035 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1036 ;; Initialization.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1037 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1038
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1039 (substitute-key-definition 'yank 'hilit-yank (current-global-map))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1040 (substitute-key-definition 'yank-pop 'hilit-yank-pop (current-global-map))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1041
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1042 ;; (substitute-key-definition 'recenter 'hilit-recenter (current-global-map))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1043 ;; (substitute-key-definition 'redraw-display 'hilit-redraw-display
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1044 ;; (current-global-map))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1045
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1046 (global-set-key [?\C-\S-l] 'hilit-repaint-command)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1047
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1048 (and window-system
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1049 (add-hook 'find-file-hooks 'hilit-find-file-hook t))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1050
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1051 (and (not hilit-inhibit-hooks)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1052 window-system
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1053 (condition-case c
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1054 (progn
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1055
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1056 ;; BUFFER highlights...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1057 (mapcar (function
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1058 (lambda (hook)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1059 (add-hook hook 'hilit-rehighlight-buffer-quietly)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1060 '(
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1061 Info-select-hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1062 vm-summary-mode-hooks
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1063 vm-summary-pointer-hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1064 gnus-summary-prepare-hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1065 gnus-group-prepare-hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1066
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1067 vm-preview-message-hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1068 vm-show-message-hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1069 gnus-article-prepare-hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1070 rmail-show-message-hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1071 mail-setup-hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1072 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1073
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1074 ;; rehilight only the visible part of the summary buffer for speed.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1075 (add-hook 'gnus-mark-article-hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1076 (function
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1077 (lambda ()
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1078 (or (memq gnus-current-article gnus-newsgroup-marked)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1079 (gnus-summary-mark-as-read gnus-current-article))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1080 (gnus-summary-set-current-mark)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1081 (save-excursion
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1082 (set-buffer gnus-summary-buffer)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1083 (hilit-rehighlight-region (window-start)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1084 (window-end) t)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1085 ))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1086 ;; only need prepare article hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1087 ;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1088 ;; (add-hook 'gnus-select-article-hook
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1089 ;; '(lambda () (save-excursion
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1090 ;; (set-buffer gnus-article-buffer)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1091 ;; (hilit-rehighlight-buffer))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1092 )
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1093 (error (message "Error loading highlight hooks: %s" c)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1094 (ding) (sit-for 1))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1095
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1096 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1097 ;; Default patterns for various modes.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1098 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1099
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1100 ;;; do I need this? I changed the defconst to a defvar because defconst is
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1101 ;;; inappropriate, but I don't know why I wanted hilit-patterns-alist to be
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1102 ;;; reset on every reload...
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1103
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1104 (setq hilit-patterns-alist nil)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1105
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1106 (defun hilit-associate (alist key val)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1107 "creates, or destructively replaces, the pair (key . val) in alist"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1108 (let ((oldentry (assq key (eval alist))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1109 (if oldentry
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1110 (setcdr oldentry val)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1111 (set alist (cons (cons key val) (eval alist))))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1112
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1113 (defun hilit-set-mode-patterns (modelist patterns &optional parse-fn)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1114 "Sets the default hilighting patterns for MODE to PATTERNS.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1115 See the variable hilit-mode-enable-list."
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1116 (or (consp modelist) (setq modelist (list modelist)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1117 (let (ok (flip (eq (car hilit-mode-enable-list) 'not)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1118 (mapcar (function
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1119 (lambda (m)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1120 (setq ok (or (null hilit-mode-enable-list)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1121 (memq m hilit-mode-enable-list)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1122 (and flip (setq ok (not ok)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1123 (and ok
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1124 (progn
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1125 (and parse-fn
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1126 (hilit-associate 'hilit-parser-alist m parse-fn))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1127 (hilit-associate 'hilit-patterns-alist m patterns)))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1128 modelist)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1129
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1130 (defun hilit-string-find (qchar)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1131 "looks for a string and returns (start . end) or NIL. The argument QCHAR
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1132 is the character that would precede a character constant double quote.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1133 Finds [^QCHAR]\" ... [^\\]\""
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1134 (let (st en)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1135 (while (and (search-forward "\"" nil t)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1136 (eq qchar (char-after (1- (setq st (match-beginning 0)))))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1137 (while (and (search-forward "\"" nil t)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1138 (eq ?\\ (char-after (- (setq en (point)) 2)))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1139 (and en (cons st en))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1140
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1141 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1142 '(c-mode c++-c-mode elec-c-mode)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1143 '(("/\\*" "\\*/" comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1144 ; ("\"" "[^\\]\"" string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1145 (hilit-string-find ?' string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1146 ;; declaration
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1147 ("^#[ \t]*\\(undef\\|define\\).*$" nil define)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1148 ("^#.*$" nil include)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1149 ;; function decls are expected to have types on the previous line
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1150 ("^\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1151 ("^\\(typedef\\|struct\\|union\\|enum\\).*$" nil decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1152 ;; datatype -- black magic regular expression
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1153 ("[ \n\t({]\\(\\(register\\|volatile\\|unsigned\\|extern\\|static\\)\\s +\\)*\\(\\(\\w\\|[$_]\\)+_t\\|float\\|double\\|void\\|char\\|short\\|int\\|long\\|FILE\\|\\(\\(struct\\|union\\|enum\\)\\([ \t]+\\(\\w\\|[$_]\\)*\\)\\)\\)\\(\\s +\\*+)?\\|[ \n\t;()]\\)" nil type)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1154 ;; key words
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1155 ("\\<\\(return\\|goto\\|if\\|else\\|case\\|default\\|switch\\|break\\|continue\\|while\\|do\\|for\\)\\>" nil keyword)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1156 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1157
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1158 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1159 'c++-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1160 '(("/\\*" "\\*/" comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1161 ("//.*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1162 ("^/.*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1163 ; ("\"" "[^\\]\"" string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1164 (hilit-string-find ?' string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1165 ;; declaration
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1166 ("^#[ \t]*\\(undef\\|define\\).*$" nil define)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1167 ("^#.*$" nil include)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1168 ;; function decls are expected to have types on the previous line
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1169 ("^\\(\\(\\w\\|[$_]\\)+::\\)?\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1170 ("^\\(\\(\\w\\|[$_]\\)+[ \t]*::[ \t]*\\)?\\(\\(\\w\\|[$_]\\)+\\|operator.*\\)\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1171 ("^\\(template\\|typedef\\|struct\\|union\\|class\\|enum\\|public\\|private\\|protected\\).*$" nil decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1172 ;; datatype -- black magic regular expression
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1173 ("[ \n\t({]\\(\\(register\\|volatile\\|unsigned\\|extern\\|static\\)\\s +\\)*\\(\\(\\w\\|[$_]\\)+_t\\|float\\|double\\|void\\|char\\|short\\|int\\|long\\|FILE\\|\\(\\(struct\\|union\\|enum\\|class\\)\\([ \t]+\\(\\w\\|[$_]\\)*\\)\\)\\)\\(\\s +\\*+)?\\|[ \n\t;()]\\)" nil type)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1174 ;; key words
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1175 ("\\<\\(return\\|goto\\|if\\|else\\|case\\|default\\|switch\\|break\\|continue\\|while\\|do\\|for\\|public\\|protected\\|private\\|delete\\|new\\)\\>"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1176 nil keyword)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1177
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1178 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1179 'perl-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1180 '(("\\s #.*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1181 ("^#.*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1182 ("\"[^\\\"]*\\(\\\\\\(.\\|\n\\)[^\\\"]*\\)*\"" nil string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1183 ("^\\(__....?__\\|\\s *\\sw+:\\)" nil label)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1184 ("^require.*$" nil include)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1185 ("^package.*$" nil decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1186 ("^\\s *sub\\s +\\(\\w\\|[_']\\)+" nil defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1187 ("\\b\\(do\\|if\\|unless\\|while\\|until\\|else\\|elsif\\|for\\|foreach\\|continue\\|next\\|redo\\|last\\|goto\\|return\\|die\\|exit\\)\\b" nil keyword)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1188
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1189 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1190 'ada-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1191 '(;; comments
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1192 ("--.*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1193 ;; main structure
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1194 ("[ \t\n]procedure[ \t]" "\\([ \t]\\(is\\|renames\\)\\|);\\)" glob-struct)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1195 ("[ \t\n]task[ \t]" "[ \t]is" glob-struct)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1196 ("[ \t\n]function[ \t]" "return[ \t]+[A-Za-z_0-9]+[ \t]*\\(is\\|;\\|renames\\)" glob-struct)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1197 ("[ \t\n]package[ \t]" "[ \t]\\(is\\|renames\\)" glob-struct)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1198 ;; if there is nothing before "private", it is part of the structure
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1199 ("^[ \t]*private[ \t\n]" nil glob-struct)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1200 ;; if there is no indentation before the "end", then it is most
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1201 ;; probably the end of the package
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1202 ("^end.*$" ";" glob-struct)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1203 ;; program structure -- "null", "delay" and "terminate" omitted
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1204 ("[ \n\t]\\(in\\|out\\|select\\|if\\|else\\|case\\|when\\|and\\|or\\|not\\|accept\\|loop\\|do\\|then\\|elsif\\|else\\|for\\|while\\|exit\\)[ \n\t;]" nil struct)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1205 ;; block structure
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1206 ("[ \n\t]\\(begin\\|end\\|declare\\|exception\\|generic\\|raise\\|return\\|package\\|body\\)[ \n\t;]" nil struct)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1207 ;; type declaration
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1208 ("^[ \t]*\\(type\\|subtype\\).*$" ";" decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1209 ("[ \t]+is record.*$" "end record;" decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1210 ;; "pragma", "with", and "use" are close to C cpp directives
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1211 ("^[ \t]*\\(with\\|pragma\\|use\\)" ";" include)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1212 ;; nice for named parameters, but not so beautiful in case statements
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1213 ("[A-Za-z_0-9.]+[ \t]*=>" nil named-param)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1214 ;; string constants probably not everybody likes this one
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1215 ("\"" ".*\"" string)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1216
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1217 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1218 'fortran-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1219 '(("^[*Cc].*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1220 ("[ \t]\\(call\\|program\\|subroutine\\|function\\|stop\\|return\\|end\\|include\\)[ \t\n]" nil include)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1221 ("\\(^[ \t]*[0-9]+\\|[ \t]continue[ \t\n]\\|format\\)" nil define)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1222 ("[ \t]\\(do\\|do[ \t]*[0-9]+\\|go[ \t]*to[ \t]*[0-9]+\\|end[ \t]*do\\|if\\|else[ \t]*if\\|then\\|else\\|end[ \t]*if\\)[ \t\n(]" nil define)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1223 ("[ \t]\\(parameter[\t\n ]*([^)]*)\\|data\\|save\\|common[ \t\n]*/[^/]*/\\)"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1224 nil decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1225 ("^ ." nil type)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1226 ("implicit[ \t]*none" nil decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1227 ("\\([ \t]\\|implicit[ \t]*\\)\\(dimension\\|integer\\|real\\|double[ \t]*precision\\|character\\|logical\\|complex\\|double[ \t]*complex\\)\\([*][0-9]*\\|[ \t\n]\\)" nil keyword)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1228 ("'[^'\n]*'" nil string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1229 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1230
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1231 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1232 '(m2-mode modula-2-mode)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1233 '(("(\\*" "\\*)" comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1234 (hilit-string-find ?\\ string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1235 ("^[ \t]*PROCEDURE[ \t]+\\w+[^ \t(;]*" nil defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1236 ("\\<\\(RECORD\\|ARRAY\\|OF\\|POINTER\\|TO\\|BEGIN\\|END\\|FOR\\|IF\\|THEN\\|ELSE\\|ELSIF\\|CASE\\|WHILE\\|DO\\|MODULE\\|FROM\\|RETURN\\|IMPORT\\|EXPORT\\|VAR\\|LOOP\\|UNTIL\\|\\DEFINITION\\|IMPLEMENTATION\\|AND\\|OR\\|NOT\\|CONST\\|TYPE\\|QUALIFIED\\)\\>" nil keyword)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1237 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1238
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1239 (hilit-set-mode-patterns 'prolog-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1240 '(("/\\*" "\\*/" comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1241 ("%.*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1242 (":-" nil defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1243 ("!" nil label)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1244 ("\"[^\\\"]*\\(\\\\\\(.\\|\n\\)[^\\\"]*\\)*\"" nil string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1245 ("\\b\\(is\\|mod\\)\\b" nil keyword)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1246 ("\\(->\\|-->\\|;\\|==\\|\\\\==\\|=<\\|>=\\|<\\|>\\|=\\|\\\\=\\|=:=\\|=\\\.\\\.\\|\\\\\\\+\\)" nil decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1247 ("\\(\\\[\\||\\|\\\]\\)" nil include)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1248
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1249 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1250 '(
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1251 LaTeX-mode japanese-LaTeX-mode SliTeX-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1252 japanese-SliTeX-mode FoilTeX-mode latex-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1253 )
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1254 '(
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1255 ;; comments
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1256 ("[^\\]%.*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1257
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1258 ;; the following two match \foo[xx]{xx} or \foo*{xx} or \foo{xx}
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1259 ("\\\\\\(sub\\)*\\(paragraph\\|section\\)\\(\*\\|\\[.*\\]\\)?{" "}"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1260 keyword)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1261 ("\\\\\\(chapter\\|part\\)\\(\*\\|\\[.*\\]\\)?{" "}" keyword)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1262 ("\\\\footnote\\(mark\\|text\\)?{" "}" keyword)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1263 ("\\\\[a-z]+box" nil keyword)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1264 ("\\\\\\(v\\|h\\)space\\(\*\\)?{" "}" keyword)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1265
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1266 ;; (re-)define new commands/environments/counters
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1267 ("\\\\\\(re\\)?new\\(environment\\|command\\){" "}" defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1268 ("\\\\new\\(length\\|theorem\\|counter\\){" "}" defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1269
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1270 ;; various declarations/definitions
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1271 ("\\\\\\(setlength\\|settowidth\\|addtolength\\|setcounter\\|addtocounter\\)" nil define)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1272 ("\\\\\\(\\|title\\|author\\|date\\|thanks\\){" "}" define)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1273
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1274 ("\\\\documentstyle\\(\\[.*\\]\\)?{" "}" decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1275 ("\\\\\\(begin\\|end\\|nofiles\\|includeonly\\){" "}" decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1276 ("\\\\\\(raggedright\\|makeindex\\|makeglossary\\|maketitle\\)\\b" nil
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1277 decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1278 ("\\\\\\(pagestyle\\|thispagestyle\\|pagenumbering\\){" "}" decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1279 ("\\\\\\(normalsize\\|small\\|footnotesize\\|scriptsize\\|tiny\\|large\\|Large\\|LARGE\\|huge\\|Huge\\)\\b" nil decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1280 ("\\\\\\(appendix\\|tableofcontents\\|listoffigures\\|listoftables\\)\\b"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1281 nil decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1282 ("\\\\\\(bf\\|em\\|it\\|rm\\|sf\\|sl\\|ss\\|tt\\)\\b" nil decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1283
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1284 ;; label-like things
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1285 ("\\\\item\\[" "\\]" label)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1286 ("\\\\item\\b" nil label)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1287 ("\\\\caption\\(\\[.*\\]\\)?{" "}" label)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1288
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1289 ;; things that bring in external files
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1290 ("\\\\\\(include\\|input\\|bibliography\\){" "}" include)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1291
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1292 ;; "wysiwyg" emphasis
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1293 ("{\\\\\\(em\\|it\\|sl\\)" "}" italic)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1294 ("{\\\\bf" "}" bold)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1295
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1296 ("``" "''" string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1297
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1298 ;; things that do some sort of cross-reference
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1299 ("\\\\\\(\\(no\\)?cite\\|\\(page\\)?ref\\|label\\|index\\|glossary\\){" "}" crossref)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1300 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1301
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1302 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1303 'bibtex-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1304 '(;;(";.*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1305 ("%.*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1306 ("@[a-zA-Z]+" nil keyword)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1307 ("{[ \t]*[-a-z:_A-Z0-9]+," nil label) ; is wrong sometimes
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1308 ("^[ \t]*[a-zA-Z]+[ \t]*=" nil define)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1309
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1310 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1311 'compilation-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1312 '(("^[^ \t]*:[0-9]+:.*$" nil error)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1313 ("^[^ \t]*:[0-9]+: warning:.*$" nil warning)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1314
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1315 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1316 'makefile-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1317 '(("^#.*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1318 ("[^$]#.*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1319 ;; rules
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1320 ("^%.*$" nil rule)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1321 ("^[.][A-Za-z][A-Za-z]?\..*$" nil rule)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1322 ;; variable definition
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1323 ("^[_A-Za-z0-9]+ *\+?=" nil define)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1324 ("\\( \\|:=\\)[_A-Za-z0-9]+ *\\+=" nil define)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1325 ;; variable references
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1326 ("\$[_A-Za-z0-9]" nil type)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1327 ("\${[_A-Za-z0-9]+}" nil type)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1328 ("\$\([_A-Za-z0-9]+\)" nil type)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1329 ("^include " nil include)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1330
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1331 (let* ((header-patterns '(("^Subject:.*$" nil msg-subject)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1332 ("^From:.*$" nil msg-from)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1333 ("^--text follows this line--$" nil msg-separator)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1334 ("^[A-Za-z][A-Za-z0-9-]+:" nil msg-header)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1335 (body-patterns '(("^\\(In article\\|[ \t]*\\w*[]>}|]\\).*$"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1336 nil msg-quote)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1337 (message-patterns (append header-patterns body-patterns)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1338 (hilit-set-mode-patterns 'msg-header header-patterns)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1339 (hilit-set-mode-patterns 'msg-body body-patterns)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1340 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1341 '(vm-mode text-mode mail-mode rmail-mode gnus-article-mode news-reply-mode)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1342 message-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1343 'hilit-rehighlight-message))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1344
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1345 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1346 'gnus-group-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1347 '(("^U.*$" nil gnus-group-unsubscribed)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1348 ("^ +[01]?[0-9]:.*$" nil gnus-group-empty)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1349 ("^ +[2-9][0-9]:.*$" nil gnus-group-full)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1350 ("^ +[0-9][0-9][0-9]+:.*$" nil gnus-group-overflowing)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1351
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1352 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1353 'gnus-summary-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1354 '(("^D +[0-9]+: \\[.*$" nil summary-seen)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1355 ("^K +[0-9]+: \\[.*$" nil summary-killed)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1356 ("^X +[0-9]+: \\[.*$" nil summary-Xed)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1357 ("^- +[0-9]+: \\[.*$" nil summary-unread)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1358 ("^. +[0-9]+:\\+\\[.*$" nil summary-current)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1359 ("^ +[0-9]+: \\[.*$" nil summary-new)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1360 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1361
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1362 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1363 'vm-summary-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1364 '(("^ .*$" nil summary-seen)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1365 ("^->.*$" nil summary-current)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1366 ("^ D.*$" nil summary-deleted)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1367 ("^ U.*$" nil summary-unread)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1368 ("^ N.*$" nil summary-new)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1369
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1370
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1371 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1372 '(emacs-lisp-mode lisp-mode)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1373 '(
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1374 (";.*" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1375 ;;; ("^;.*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1376 ;;; ("\\s ;+[ ;].*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1377 (hilit-string-find ?\\ string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1378 ("^\\s *(def\\(un\\|macro\\|advice\\|subst\\)\\s " "\\()\\|nil\\)" defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1379 ("^\\s *(defvar\\s +\\S +" nil decl)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1380 ("^\\s *(defconst\\s +\\S +" nil define)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1381 ("^\\s *(\\(provide\\|require\\|\\(auto\\)?load\\).*$" nil include)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1382 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1383
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1384
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1385 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1386 'plain-tex-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1387 '(("^%%.*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1388 ("{\\\\em\\([^}]+\\)}" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1389 ("\\(\\\\\\w+\\)" nil keyword)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1390 ("{\\\\bf\\([^}]+\\)}" nil keyword)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1391 ("^[ \t\n]*\\\\def[\\\\@]\\(\\w+\\)" nil defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1392 ("\\\\\\(begin\\|end\\){\\([A-Za-z0-9\\*]+\\)}" nil defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1393 ; ("[^\\\\]\\$\\([^$]*\\)\\$" nil string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1394 ("\\$\\([^$]*\\)\\$" nil string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1395 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1396
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1397 ;; Reasonable extensions would include smarter parameter handling for such
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1398 ;; things as the .IX and .I macros, which alternate the handling of following
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1399 ;; arguments.
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1400
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1401 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1402 'nroff-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1403 '(("^\\.[\\\][\\\"].*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1404 ("^\\.so .*$" nil include)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1405 ("^\\.[ST]H.*$" nil defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1406 ;; ("^[^\\.].*\"[^\\\"]*\\(\\\\\\(.\\)[^\\\"]*\\)*\"" nil string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1407 ("\"" "[^\\]\"" string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1408 ("^\\.[A-Za-z12\\\\].*$" nil define)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1409 ("\\([\\\][^ ]*\\)" nil keyword)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1410 ("^\\.[a-zA-Z].*$" nil keyword)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1411
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1412 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1413 'texinfo-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1414 '(("^\\(@c\\|@comment\\)\\>.*$" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1415 ("@\\(emph\\|strong\\|b\\|i\\){[^}]+}" nil comment)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1416 ; seems broken
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1417 ; ("\\$[^$]*\\$" nil string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1418 ("@\\(file\\|kbd\\|key\\){[^}]+}" nil string)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1419 ("^\\*.*$" nil defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1420 ("@\\(if\\w+\\|format\\|item\\)\\b.*$" nil defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1421 ("@end +[A-Za-z0-9]+[ \t]*$" nil defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1422 ("@\\(samp\\|code\\|var\\){[^}]+}" nil defun)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1423 ("@\\w+\\({[^}]+}\\)?" nil keyword)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1424 ))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1425
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1426 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1427 'dired-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1428 (append
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1429 '(("^D.*$" nil dired-deleted)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1430 ("^\\*.*$" nil dired-marked)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1431 ("^ d.*$" nil dired-directory)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1432 ("^ l.*$" nil dired-link)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1433 ("^ -.*#.*#$" nil dired-ignored))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1434 (list (cons
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1435 (concat "^ .*\\("
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1436 (mapconcat 'regexp-quote completion-ignored-extensions "\\|")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1437 "\\)$")
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1438 '(nil dired-ignored)))))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1439
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1440 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1441 'jargon-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1442 '(("^:[^:]*:" nil jargon-entry)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1443 ("{[^}]*}+" nil jargon-xref)))
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1444
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1445 (hilit-set-mode-patterns
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1446 'Info-mode
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1447 '(("^\\* [^:]+:+" nil jargon-entry)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1448 ("\\*[Nn]ote\\b[^:]+:+" nil jargon-xref)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1449 (" \\(Next\\|Prev\\|Up\\):" nil jargon-xref)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1450 ("- \\(Variable\\|Function\\|Macro\\|Command\\|Special Form\\|User Option\\):.*$"
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1451 nil jargon-keyword))) ; lisp manual
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1452
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1453 (provide 'hilit19)
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1454
c9141f3f859c Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1455 ;;; hilit19 ends here.