annotate lisp/obsolete/hilit19.el @ 86933:553d66dcf5fd

(math-compose-var): Fix declaration.
author Jay Belanger <jay.p.belanger@gmail.com>
date Sun, 02 Dec 2007 03:45:14 +0000
parents e98988d20549
children 107ccd98fa12 d38543a1c0f9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 35063
diff changeset
1 ;;; hilit19.el --- customizable highlighting for Emacs 19
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
2
64751
5b1a238fcbb4 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64085
diff changeset
3 ;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004,
75347
e3694f1cb928 Add 2007 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 68640
diff changeset
4 ;; 2005, 2006, 2007 Free Software Foundation, Inc.
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
5
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
6 ;; Author: Jonathan Stigelman <stig@hackvan.com>
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
7 ;; Maintainer: FSF
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
8 ;; (actually no longer maintained)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
9 ;; Keywords: faces
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
10
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
11 ;; This file is part of GNU Emacs.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
12
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
13 ;; GNU Emacs is free software; you can redistribute it and/or modify
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
14 ;; it under the terms of the GNU General Public License as published by
78228
1e016d63f292 Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents: 75347
diff changeset
15 ;; the Free Software Foundation; either version 3, or (at your option)
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
16 ;; any later version.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
17
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
18 ;; GNU Emacs is distributed in the hope that it will be useful,
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
21 ;; GNU General Public License for more details.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
22
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64085
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 62195
diff changeset
25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 62195
diff changeset
26 ;; Boston, MA 02110-1301, USA.
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
27
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
28 ;;; Commentary:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
29
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 35063
diff changeset
30 ;; Hilit19.el is a customizable highlighting package for Emacs 19. It supports
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
31 ;; not only source code highlighting, but also Info, RMAIL, VM, gnus...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
32 ;; Hilit19 knows (or thinks it knows) how to highlight emacs buffers in
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
33 ;; about 25 different modes.
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
34 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
35 ;; WHERE TO GET THE LATEST VERSIONS OF HILIT19.EL (beta and release):
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
36 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
37 ;; http://hackvan.com/pub/stig/src/elisp/
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
38 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
39 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
40 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
41 ;; TO SUBMIT BUG REPORTS (or feedback of any sort)...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
42 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
43 ;; M-x hilit-submit-feedback RET
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
44 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
45 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
46 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
47 ;; hilit19.el,v 2.19 1993/09/08 18:44:10 stig Release
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
48 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
49 ;; LCD Archive Entry:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
50 ;; hilit19|Jonathan Stigelman|stig@hackvan.com|
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
51 ;; Comprehensive (and comparatively fast) regex-based highlighting for Emacs 19|
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
52 ;; 1993/09/08 18:44:10|Release 2.19|~/packages/hilit19.el.Z|
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
53 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
54 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
55 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
56 ;; GENERAL OVERVIEW
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
57 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
58 ;; This package installs numerous hooks to colorfully highlight your
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
59 ;; source code buffers as well as mail and news buffers. Most
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
60 ;; programming languages have predefined highlighting patterns.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
61 ;; Just load hilit19 and files will be automatically highlighted as
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
62 ;; they're loaded.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
63 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
64 ;; Rehighlight a buffer by typing C-S-l (control-shift-lowercase-L).
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
65 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
66 ;; If, when you edit the buffer, the coloring gets messed up, just
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
67 ;; redraw and the coloring will be adjusted. If automatic highlighting
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
68 ;; in the current buffer has been turned off, then typing C-u C-S-l will
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
69 ;; force a rehighlight of the entire buffer.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
70 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
71 ;; Hilit19 can build faces by examining the names that you give to them
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
72 ;; For example, green/black-bold-italic-underline would be created as
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
73 ;; a face with a green foreground, and a black background, using a
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
74 ;; bold-italic font...with underlining for good measure.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
75 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
76 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
77 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
78 ;; SETUP -- In your .emacs:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
79 ;;
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
80 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
81 ;; (cond (window-system
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
82 ;; (setq hilit-mode-enable-list '(not text-mode)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
83 ;; hilit-background-mode 'light
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
84 ;; hilit-inhibit-hooks nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
85 ;; hilit-inhibit-rebinding nil)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
86 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
87 ;; (require 'hilit19)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
88 ;; ))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
89 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
90 ;; If you like font-lock-mode and want to use both packages, then you can
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
91 ;; disable hilit for the modes in which you want to use font-lock by listing
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
92 ;; said modes in hilit-mode-enable-list.
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
93 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
94 ;; (hilit-translate type 'RoyalBlue ; enable highlighting in C/C++
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
95 ;; string nil) ; disable string highlighting
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
96 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
97 ;; To get 100% of the utility of hilit19, you may also have to apply the
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
98 ;; patches below for info.el and vm5.33L_19/vm-summary.el
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
99 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
100 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
101 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
102 ;; SETUP -- Are you using the right font for Emacs?
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
103 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
104 ;; Emacs cannot properly find bold and italic fonts unless you specify a
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
105 ;; verbose X11 font name. If you specify a font for emacs in your
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
106 ;; .Xdefaults, it *MUST* be specified using the long form of the font name.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
107 ;; Here's a good font menu:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
108 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
109 ;; (setq
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
110 ;; x-fixed-font-alist
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
111 ;; '("Font Menu"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
112 ;; ("Misc"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
113 ;; ("6x12" "-misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
114 ;; ("6x13" "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
115 ;; ("lucida 13"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
116 ;; "-b&h-lucidatypewriter-medium-r-normal-sans-0-0-0-0-m-0-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
117 ;; ("7x13" "-misc-fixed-medium-r-normal--13-120-75-75-c-70-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
118 ;; ("7x14" "-misc-fixed-medium-r-normal--14-130-75-75-c-70-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
119 ;; ("9x15" "-misc-fixed-medium-r-normal--15-140-*-*-c-*-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
120 ;; ("")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
121 ;; ("clean 8x8" "-schumacher-clean-medium-r-normal--*-80-*-*-c-*-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
122 ;; ("clean 8x14" "-schumacher-clean-medium-r-normal--*-140-*-*-c-*-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
123 ;; ("clean 8x10" "-schumacher-clean-medium-r-normal--*-100-*-*-c-*-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
124 ;; ("clean 8x16" "-schumacher-clean-medium-r-normal--*-160-*-*-c-*-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
125 ;; ("")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
126 ;; ("sony 8x16" "-sony-fixed-medium-r-normal--16-120-100-100-c-80-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
127 ;; ("")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
128 ;; ("-- Courier --")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
129 ;; ("Courier 10" "-adobe-courier-medium-r-normal--*-100-*-*-m-*-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
130 ;; ("Courier 12" "-adobe-courier-medium-r-normal--*-120-*-*-m-*-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
131 ;; ("Courier 14" "-adobe-courier-medium-r-normal--*-140-*-*-m-*-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
132 ;; ("Courier 18" "-adobe-courier-medium-r-normal--*-180-*-*-m-*-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
133 ;; ("Courier 18-b" "-adobe-courier-bold-r-normal--*-180-*-*-m-*-*-1")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
134 ;; )))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
135 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
136 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
137 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
138 ;; KNOWN BUGS/TO DO LIST/HELP WANTED/APPLY WITHIN
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
139 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
140 ;; * unbalanced, unescaped double quote characters can confuse hilit19.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
141 ;; This will be fixed someday, so don't bug me about it.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
142 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
143 ;; * ALTHOUGH HILIT19 IS FASTER THAN FONT-LOCK-MODE...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
144 ;; For various reasons, the speed of the package could still stand to be
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
145 ;; improved. If you care to do a little profiling and make things tighter...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
146 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
147 ;; * hilit-toggle-highlight is flaky when auto-rehighlight is neither t nor nil.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
148 ;; Does anyone actually USE this? I think I might just remove it.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
149 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
150 ;; PROJECTS THAT YOU CAN TAKE OVER BECAUSE I DON'T MUCH CARE ABOUT THEM...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
151 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
152 ;; * Moved hilit-wysiwyg-replace here from my version of man.el, this is not
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
153 ;; a bug. The bug is that I don't have a reverse operation yet...just a
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
154 ;; stub Wysiwyg-anything really belongs in a package of its own.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
155 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
156 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
157 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
158 ;; Thanks to the following people for their input:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
159 ;; ebert@enpc.enpc.fr (Rolf EBERT), ada, LaTeX & bibtex highlights
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
160 ;; Vivek Khera <khera@cs.duke.edu>, gnus hooks + random advice & patches
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
161 ;; brian@athe.WUstl.EDU (Brian Dunford-Shore), prolog highlights
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
162 ;; John Ladwig <jladwig@soils.umn.edu>, 1st pass nroff highlights
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
163 ;; campo@sunthpi3.difi.unipi.it (Massimo Campostrini), fortran highlights
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
164 ;; jayb@laplace.MATH.ColoState.EDU (Jay Bourland), 1st pass dired
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
165 ;; Yoshio Turner <yoshio@CS.UCLA.EDU>, modula 2 highlights
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
166 ;; Fritz Knabe <knabe@ecrc.de>, advice & patches
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
167 ;; Alon Albert <alon@milcse.rtsg.mot.com>, advice & patches
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
168 ;; dana@thumper.bellcore.com (Dana A. Chee), working on the multi-frame bug
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
169 ;; derway@ndc.com (Don Erway), for breaking it...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
170 ;; moss_r@summer.chem.su.oz.au (Richard Moss), first pass at add-pattern
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
171 ;; Olivier Lecarme <ol@aiguemarine.unice.fr>, Pascal & Icon patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
172 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
173 ;; With suggestions and minor regex patches from numerous others...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
174 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
175 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
176 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
177 ;; hilit19.el,v
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
178 ;; Revision 2.19 1993/09/08 18:44:10 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
179 ;; installed patch for elusive bug in hilit-rehighlight-region that caused
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
180 ;; hilit-unhighlight-region to hang in an infinite loop.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
181 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
182 ;; Revision 2.18 1993/08/27 03:51:00 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
183 ;; minor mods to lisp-mode and c/c++ mode patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
184 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
185 ;; Revision 2.17 1993/08/25 02:19:17 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
186 ;; work-around for bug in next-overlay-change that caused dired and jargon-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
187 ;; to hang in an endless loop. Perhaps other modes were doing this too.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
188 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
189 ;; Revision 2.16 1993/08/22 19:46:00 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
190 ;; bug fix for next-overlay-change and accompanying change to
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
191 ;; hilit-unhighlight-region
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
192 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
193 ;; Revision 2.15 1993/08/20 12:16:22 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
194 ;; minor change to fortran patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
195 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
196 ;; Revision 2.14 1993/08/17 14:12:10 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
197 ;; added default face mapping for 'formula' which is needed for new latex
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
198 ;; patterns.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
199 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
200 ;; twiddled the calendar-mode patterns a bit.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
201 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
202 ;; Revision 2.13 1993/08/16 04:33:54 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
203 ;; hilit-set-mode-patterns was screwing up two part patterns. it doesn't now.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
204 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
205 ;; Revision 2.12 1993/08/16 00:16:41 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
206 ;; changed references to default-bold-italic to just bold-italic because the
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
207 ;; font for that face is maintained by emacs.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
208 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
209 ;; the pattern matcher now starts its searches from the end of the most
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
210 ;; recently highlighted region (which is not necessarily the end of the most
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
211 ;; recently matched regex).
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
212 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
213 ;; multiple errors in pattern matcher now just give an error instead of lots of
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
214 ;; annoying messages and dings.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
215 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
216 ;; no longer use vm-summary-mode-hooks.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
217 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
218 ;; some code moved from hilit-highlight-region to hilit-set-mode-patterns.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
219 ;; This will affect you if you pass your patterns directly to
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
220 ;; hilit-highlight-region....use a pseudo-mode instead.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
221 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
222 ;; pattern changes to C/C++, latex, texinfo, fortran, nroff, etc.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
223 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
224 ;; Revision 2.11 1993/08/13 12:12:37 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
225 ;; removed some crufty commented-out code
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
226 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
227 ;; diverged lisp-mode and emacs-lisp-mode...also added lisp keywords.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
228 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
229 ;; Revision 2.10 1993/08/13 09:47:06 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
230 ;; added calendar-mode, icon-mode and pascal-mode patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
231 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
232 ;; commented out hilit-toggle-highlight because I want to phase it out entirely
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
233 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
234 ;; Revision 2.9 1993/08/13 08:44:22 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
235 ;; added optional case-fold argument to hilit-set-mode-patterns, this case-fold
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
236 ;; parameter is now stored in hilit-patterns-alist.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
237 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
238 ;; Revision 2.8 1993/08/12 22:05:03 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
239 ;; fixed some typos in documentation
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
240 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
241 ;; twiddled some of the color defaults for dark backgrounds
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
242 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
243 ;; always get 'mono color defaults if (not (x-display-color-p))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
244 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
245 ;; added hilit-rehighlight-buffer-quietly to dired-after-readin-hook
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
246 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
247 ;; fixed bug in hilit-string-find that mishandled strings of the form: "\\"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
248 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
249 ;; NEW FUNCTION: hilit-add-mode-pattern... kinda like add-hook for patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
250 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
251 ;; fixed minor pattern bugs for latex-mode and emacs-lisp-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
252 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
253 ;; Revision 2.7 1993/07/30 02:43:01 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
254 ;; added const to the list of modifiers for C/C++ types
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
255 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
256 ;; Revision 2.6 1993/07/30 00:30:54 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
257 ;; now permit selection of arbitrary subexpressions for highlighting...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
258 ;; fixed keyword patterns for C/C++ using this technique.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
259 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
260 ;; Revision 2.5 1993/07/28 05:02:56 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
261 ;; improvements to makefile regular expressions
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
262 ;; removed about 130 lines just by compacting the big defconst for
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
263 ;; hilit-face-translation-table into a mapcar and defining a separate table
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
264 ;; of default faces.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
265 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
266 ;; Revision 2.4 1993/07/27 14:09:05 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
267 ;; documented another "known problem" to "head off gripe mail at the pass."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
268 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
269 ;; Revision 2.3 1993/07/27 02:15:49 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
270 ;; (hilit-lookup-face-create) incorporated patch which improves its behavior
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
271 ;; with more than one frame... Still can't have bold on the same face in two
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
272 ;; different fonts sizes at the same time...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
273 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
274 ;; Revision 2.2 1993/07/27 02:02:59 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
275 ;; vastly improved the makefile patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
276 ;; added hook for mh-show-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
277 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
278 ;; Revision 2.1 1993/07/24 17:46:21 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
279 ;; Phasing out Info-select-hook... Version 19.18 will use Info-selection-hook.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
280 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
281 ;; Revision 2.0 1993/07/24 13:50:10 stig
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
282 ;; better documentation and added the function hilit-submit-feedback.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
283 ;; C-S-l (control shift l) repaints the buffer. Other bindings are optional.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
284 ;; multi-line highlights no longer cause problems when
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
285 ;; hilit-auto-rehighlight is 'visible
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
286 ;; added hilit-predefined-face-list...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
287 ;; changed name of hilit-mode-alist to hilit-patterns-alist
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
288 ;; added hilit-message-quietly to mail-setup-hook
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
289 ;; added hilit-parser-alist which can be used to apply different patterns to
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
290 ;; different parts of a buffer. This could be integrated in a far more
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
291 ;; elegant manner, but it presently serves the purpose of not applying
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
292 ;; message header patterns to message bodies in mail-mode and its kin.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
293 ;; hilit-set-mode-patterns now takes a list of modes and an optional parse-fn
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
294 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
295
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
296 ;;;;;; AND THIS CAN BE APPLIED TO VM 5.33L_19
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
297 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
298 ;; *** ../site/vm5.33L_19/vm-summary.el Fri Jun 4 22:17:11 1993
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
299 ;; --- ./vm-summary.el Tue Jun 22 16:39:30 1993
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
300 ;; ***************
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
301 ;; *** 152,158 ****
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
302 ;; (insert "->")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
303 ;; (delete-char 2)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
304 ;; (forward-char -2)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
305 ;; ! (and w vm-auto-center-summary (vm-auto-center-summary))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
306 ;; (and old-window (select-window old-window)))))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
307 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
308 ;; (defun vm-mark-for-display-update (message)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
309 ;; --- 152,159 ----
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
310 ;; (insert "->")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
311 ;; (delete-char 2)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
312 ;; (forward-char -2)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
313 ;; ! (and w vm-auto-center-summary (vm-auto-center-summary))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
314 ;; ! (run-hooks 'vm-summary-pointer-hook)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
315 ;; (and old-window (select-window old-window)))))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
316 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
317 ;; (defun vm-mark-for-display-update (message)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
318 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
319 ;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
320
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
321 ;;; Code:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
322
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
323 ;; User Options:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
324
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
325 (defvar hilit-quietly nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
326 "* If non-nil, this inhibits progress indicators during highlighting")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
327
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
328 (defvar hilit-auto-highlight t
42205
7308bbc423d5 Doc fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 40024
diff changeset
329 "* t if we should highlight all buffers as we find 'em, nil to disable
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
330 automatic highlighting by the find-file hook.")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
331
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
332 (defvar hilit-auto-highlight-maxout 60000 ; hilit19 keeps getting bigger...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
333 "* auto-highlight is disabled in buffers larger than this")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
334
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
335 (defvar hilit-auto-rehighlight t
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
336 "* If this is non-nil, then hilit-redraw and hilit-recenter will also
42205
7308bbc423d5 Doc fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 40024
diff changeset
337 rehighlight part or all of the current buffer. t will rehighlight the
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
338 whole buffer, a NUMBER will rehighlight that many lines before and after
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
339 the cursor, and the symbol 'visible' will rehighlight only the visible
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
340 portion of the current buffer. This variable is buffer-local.")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
341
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
342 (make-variable-buffer-local 'hilit-auto-rehighlight)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
343
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
344 (defvar hilit-auto-rehighlight-fallback '(20000 . 100)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
345 "* Cons of the form (THRESHOLD . FALLBACK), where FALLBACK is assigned to
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
346 hilit-auto-rehighlight if the size of a newly opened buffer is larger than
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
347 THRESHOLD.")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
348
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
349 (defvar hilit-face-check t
42205
7308bbc423d5 Doc fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 40024
diff changeset
350 "* t slows down highlighting but permits the user to change fonts without
7308bbc423d5 Doc fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 40024
diff changeset
351 losing bold and italic faces... t causes hilit-lookup-face-create to dig
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
352 through the frame parameters for the current window every time it's called.
42205
7308bbc423d5 Doc fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 40024
diff changeset
353 If you never change fonts in emacs, set this to nil.")
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
354
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
355 ;; Variables which must be set before loading hilit19.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
356
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
357 (defvar hilit-inhibit-rebinding nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
358 "If non-nil, this inhibits replacement of recenter, yank, and yank-pop.")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
359
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
360 (defvar hilit-inhibit-hooks nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
361 "If non-nil, this inhibits installation of hooks for Info, gnus, & vm.")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
362
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
363 (defvar hilit-background-mode 'light
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
364 "'mono inhibits color, 'dark or 'light indicate the background brightness.")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
365
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
366 (defvar hilit-mode-enable-list nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
367 "If a list of modes to exclusively enable or specifically disable.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
368 The sense of the list is negated if it begins with the symbol 'not'.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
369 Set this variable before you load hilit19.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
370
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
371 Ex: (perl-mode jargon-mode c-mode) ; just perl, C, and jargon modes
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
372 (not text-mode) ; all modes except text mode")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
373
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
374 ;; Variables that are not generally modified directly
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
375
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
376 (defvar hilit-parser-alist nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
377 "alist of major-mode values and parsers called by hilit-rehighlight-buffer.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
378
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
379 Parsers for a given mode are IGNORED for partial rehighlights...maybe you'd
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
380 like to make this more universal?")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
381
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
382 (defvar hilit-patterns-alist nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
383 "alist of major-mode values and default highlighting patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
384
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
385 A highlighting pattern is a list of the form (start end face), where
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
386 start is a regex, end is either a regex or a match number for start, and face
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
387 is the name of an entry in hilit-face-translation-table, the name of a face,
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
388 or nil (which disables the pattern).
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
389
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
390 Each entry in the alist is of the form:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
391 (mode . (case-fold pattern [pattern ...]))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
392
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
393 See the hilit-lookup-face-create documentation for valid face names.")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
394
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
395 (defvar hilit-predefined-face-list (face-list)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
396 "List of faces with which hilit-lookup-face-create will NOT tamper.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
397
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
398 If hilit19 is dumped into emacs at your site, you may have to set this in
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
399 your init file.")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
400
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
401 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
402 ;; Use this to report bugs:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
403
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
404 (eval-when-compile (require 'reporter)) ; no compilation gripes
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
405
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
406 (defun hilit-submit-feedback ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
407 "Submit feedback on hilit19 to hilit@hackvan.com"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
408 (interactive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
409 (require 'reporter)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
410 (and (y-or-n-p "Do you really want to submit a report on hilit19? ")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
411 (reporter-submit-bug-report
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
412 "Jonathan Stigelman <hilit@hackvan.com>"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
413 "hilit19.el (Release 2.19)"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
414 (and (y-or-n-p "Do you need to include a dump hilit variables? ")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
415 (append
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
416 '(
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
417 hilit-quietly hilit-inhibit-hooks
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
418 hilit-background-mode hilit-mode-enable-list
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
419 hilit-auto-highlight hilit-auto-highlight-maxout
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
420 hilit-auto-rehighlight hilit-auto-rehighlight-fallback
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
421 hilit-face-check
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
422 )
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
423 (and (y-or-n-p "Have you modified the standard patterns? ")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
424 (yes-or-no-p "Are your patterns *REALLY* relevant? ")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
425 '(hilit-parser-alist
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
426 hilit-patterns-alist
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
427 hilit-predefined-face-list
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
428 ))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
429 (function
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
430 (lambda ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
431 (and (y-or-n-p "Is this a problem with font display? ")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
432 (insert "\nFrame Configuration:\n====================\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
433 (prin1-to-string (frame-configuration-to-register ?F))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
434 "\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
435 ))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
436 nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
437 (concat
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
438 "This is (check all that apply, and delete what's irrelevant):\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
439 " [ ] a _MASSIVE_THANK_YOU_ for writing hilit19.el\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
440 " [ ] An invitation to attend the next Hackers Conference\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
441 " [ ] You're a RIGHTEOUS HACKER, what are your rates?\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
442 " [ ] I've used the force and read the source, but I'M CONFUSED\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
443 " [ ] a PATCH. (output of 'diff -uw old.el new.el' or 'diff -cw')\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
444 " [ ] a SERIOUS AND REPRODUCIBLE BUG that is not an EMACS bug\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
445 " - I *swear* that it's not already mentioned in the KNOWN BUGS\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
446 " - I HAVE CHECKED ftp.hackvan.com:/pub/stig/src/elisp/hilit19.el.gz\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
447 " for a newer release that fixes the problem.\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
448 " >> I HAVE ALSO CHECKED ftp.hackvan.com:/pub/stig/src/elisp/hl319.el.gz\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
449 " This is the alpha version...what will become hilit19 (Beta 3.0).\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
450 "\n"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
451 "Hey Stig, I *know* you're busy but...\n"))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
452
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
453 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
454 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
455 ;; These faces are either a valid face name, or nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
456 ;; if you want to change them, you must do so AFTER hilit19 is loaded
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
457
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
458 (defconst hilit-default-face-table
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
459 '(
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
460 ;; used for C/C++ and Emacs Lisp and perl
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
461 (comment firebrick-italic moccasin italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
462 (include purple Plum1 bold-italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
463 (define ForestGreen-bold green bold)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
464 (defun blue-bold cyan-bold bold-italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
465 (decl RoyalBlue cyan bold)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
466 (type nil yellow nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
467 (keyword RoyalBlue cyan bold-italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
468 (label red-underline orange-underlined underline)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
469 (string grey40 orange underline)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
470
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
471 ;; some further faces for Ada
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
472 (struct black-bold white-bold bold)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
473 (glob-struct magenta Plum1 default-bold-underline)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
474 (named-param DarkGoldenrod Goldenrod underline)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
475
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
476 ;; and another one for LaTeX
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
477 (crossref DarkGoldenrod Goldenrod underline)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
478 (formula Goldenrod DarkGoldenrod underline)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
479
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
480 ;; compilation buffers
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
481 (active-error default/pink-bold default/DeepPink-bold default-underline)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
482 (error red-bold yellow bold)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
483 (warning blue-italic green italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
484
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
485 ;; Makefiles (some faces borrowed from C/C++ too)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
486 (rule blue-bold-underline cyan-underline default-bold-underline)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
487
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
488 ;; VM, GNUS and Text mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
489 (msg-subject blue-bold yellow bold)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
490 (msg-from purple-bold green bold)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
491 (msg-header firebrick-bold cyan italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
492 (msg-separator black/tan-bold black/lightblue nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
493 (msg-quote ForestGreen pink italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
494
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
495 (summary-seen grey40 white nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
496 (summary-killed grey50 white nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
497 (summary-Xed OliveDrab2 green nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
498 (summary-deleted firebrick white italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
499 (summary-unread RoyalBlue yellow bold)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
500 (summary-new blue-bold yellow-bold bold-italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
501 (summary-current default/skyblue-bold green/dimgrey-bold reverse-default)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
502
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
503 (gnus-group-unsubscribed grey50 white nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
504 (gnus-group-empty nil nil nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
505 (gnus-group-full ForestGreen green italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
506 (gnus-group-overflowing firebrick red bold-italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
507
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
508 ;; dired mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
509 (dired-directory blue-bold cyan bold)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
510 (dired-link firebrick-italic green italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
511 (dired-ignored ForestGreen moccasin nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
512 (dired-deleted red-bold-italic orange bold-italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
513 (dired-marked purple Plum1 nil)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
514
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
515 ;; Info-mode, and jargon-mode.el and prep.ai.mit.edu:/pub/gnu/jargon*
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
516 (jargon-entry blue-bold cyan bold)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
517 (jargon-xref purple-bold Plum1 italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
518 (jargon-keyword firebrick-underline yellow underline)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
519 )
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
520 "alist of default faces (face . (light-default dark-default mono-default))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
521
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
522 There is no way for the user to modify this table such that it will have any
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
523 effect upon the translations used by hilit19. Instead, use the function
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
524 hilit-translate AFTER hilit19 has been loaded.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
525
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
526 See also the documentation for hilit-lookup-face-create.")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
527
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
528 (defconst hilit-face-translation-table
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
529 (let ((index (or (and (x-display-color-p)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
530 (cdr (assq hilit-background-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
531 '((light . 1) (dark . 2)))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
532 3)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
533 (mapcar (function (lambda (x) (cons (car x) (nth index x))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
534 hilit-default-face-table))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
535 "alist that maps symbolic face-names to real face names")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
536
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
537 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
538 ;; To translate one face to another...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
539 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
540
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
541 (defmacro hilit-translate (&rest args)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
542 "(hilit-translate FROM TO FROM TO ...): translate each face FROM to the
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
543 value of its TO face. This is like setq for faces.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
544
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
545 The function hilit-lookup-face-create will repeatedly translate until no more
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
546 translations for the face exist in the translation table.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
547
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
548 See the documentation for hilit-lookup-face-create for names of valid faces."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
549 (or (zerop (% (length args) 2))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
550 (error "wrong number of args"))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
551 (let (cmdl from to)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
552 (while args
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
553 (setq from (car args) to (nth 1 args) args (nthcdr 2 args)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
554 cmdl (cons (list 'hilit-associate ''hilit-face-translation-table
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
555 (list 'quote from) to)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
556 cmdl)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
557 (cons 'progn cmdl)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
558
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
559 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
560 ;; This function actually translates and then creates the faces...
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
561 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
562
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
563 (defun hilit-lookup-face-create (face &optional force)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
564 "Get a FACE, or create it if it doesn't exist. In order for it to
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
565 properly create the face, the following naming convention must be used:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
566 [reverse-](fgcolor[/bgcolor])[-bold][-italic][-underline]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
567 Example: (hilit-lookup-face-create 'comment-face) might create and return 'red
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
568
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
569 Each color is either the name of an X color (see .../X11/lib/X11/rgb.txt),
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
570 a hexadecimal specification of the form \"hex-[0-9A-Fa-f]+\", or \"default\".
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
571
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
572 An optional argument, FORCE, will cause the face to be recopied from the
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
573 default...which is probably of use only if you've changed fonts.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
574
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
575 See the documentation for hilit-translate and hilit-face-translation-table."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
576
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
577 ;; translate the face ...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
578 (let ((trec t) visited)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
579 (while trec
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
580 (cond ((memq face visited) (error "face translation loop: %S" visited))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
581 (t (setq visited (cons face visited)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
582 trec (assq face hilit-face-translation-table))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
583 (and trec (setq face (cdr trec)))))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
584
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
585 ;; make the face if we need to...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
586 (let* ((fn (symbol-name face))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
587 (frame (selected-frame))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
588 (basefont (cdr (assq 'font (frame-parameters frame))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
589 error fgcolor bgcolor)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
590 (cond
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
591 ((or (null face)
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
592 (memq face hilit-predefined-face-list))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
593 ;; do nothing if the face is nil or if it's predefined.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
594 )
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
595 ((or force
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
596 (not (memq face (face-list)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
597 (and hilit-face-check
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
598 (not (string= (get face 'basefont) basefont))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
599 (copy-face 'default 'scratch-face)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
600 (if (string-match "^reverse-?" fn)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
601 (progn (invert-face 'scratch-face)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
602 (setq fn (substring fn (match-end 0)))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
603
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
604 ;; parse foreground color
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
605 (if (string-match "^\\(hex-\\)?\\([A-Za-z0-9]+\\)" fn)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
606 (setq fgcolor (concat
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
607 (if (match-beginning 1) "#")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
608 (substring fn (match-beginning 2) (match-end 2)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
609 fn (substring fn (match-end 0)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
610 (error "bad face name %S" face))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
611
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
612 ;; parse background color
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
613 (if (string-match "^/\\(hex-\\)?\\([A-Za-z0-9]+\\)" fn)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
614 (setq bgcolor (concat
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
615 (and (match-beginning 1) "#")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
616 (substring fn (match-beginning 2) (match-end 2)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
617 fn (substring fn (match-end 0))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
618
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
619 (and (string= "default" fgcolor) (setq fgcolor nil))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
620 (and (string= "default" bgcolor) (setq bgcolor nil))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
621
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
622 ;; catch errors if we can't allocate the color(s)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
623 (condition-case nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
624 (progn (and fgcolor (set-face-foreground 'scratch-face fgcolor))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
625 (and bgcolor (set-face-background 'scratch-face bgcolor))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
626 (copy-face 'scratch-face face)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
627 (put face 'basefont basefont))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
628 (error (message "couldn't allocate color for '%s'"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
629 (symbol-name face))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
630 (setq face 'default)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
631 (setq error t)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
632 (or error
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
633 ;; don't bother w/ bold or italic if we didn't get the color
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
634 ;; we wanted, but ignore errors making the face bold or italic
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
635 ;; if the font isn't available, there's nothing to do about it...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
636 (progn
40024
2dee495c21db (hilit-lookup-face-create): Call
Gerd Moellmann <gerd@gnu.org>
parents: 38412
diff changeset
637 (when (display-graphic-p frame)
2dee495c21db (hilit-lookup-face-create): Call
Gerd Moellmann <gerd@gnu.org>
parents: 38412
diff changeset
638 (set-face-font face basefont frame))
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
639 (set-face-underline-p face (string-match "underline" fn))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
640 (if (string-match ".*bold" fn)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
641 ;; make face bold in all frames
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
642 (make-face-bold face nil 'noerr))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
643 (if (string-match ".*italic" fn)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
644 ;; make face italic in all frames
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
645 (make-face-italic face nil 'noerr))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
646 ))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
647 )))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
648 face)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
649
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
650 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
651 ;; Region Highlight/Unhighlight code (Both overlay and text-property versions)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
652 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
653
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
654 (defsubst hilit-region-set-face (start end face-name &optional prio prop)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
655 "Highlight region from START to END using FACE and, optionally, PRIO.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
656 The optional 5th arg, PROP is a property to set instead of 'hilit."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
657 (let ((overlay (make-overlay start end)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
658 (overlay-put overlay 'face face-name)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
659 (overlay-put overlay (or prop 'hilit) t)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
660 (and prio (overlay-put overlay 'priority prio))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
661
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
662 (defun hilit-unhighlight-region (start end &optional quietly)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
663 "Unhighlights the region from START to END, optionally in a QUIET way"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
664 (interactive "r")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
665 (or quietly hilit-quietly (message "Unhighlighting"))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
666 (let ((lstart 0))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
667 (while (and start (> start lstart) (< start end))
84914
0306d3c580c6 (hilit-unhighlight-region, hilit-set-mode-patterns):
Juanma Barranquero <lekktu@gmail.com>
parents: 78228
diff changeset
668 (mapc (function (lambda (ovr)
0306d3c580c6 (hilit-unhighlight-region, hilit-set-mode-patterns):
Juanma Barranquero <lekktu@gmail.com>
parents: 78228
diff changeset
669 (and (overlay-get ovr 'hilit) (delete-overlay ovr))))
0306d3c580c6 (hilit-unhighlight-region, hilit-set-mode-patterns):
Juanma Barranquero <lekktu@gmail.com>
parents: 78228
diff changeset
670 (overlays-at start))
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
671 (setq lstart start start (next-overlay-change start))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
672 (or quietly hilit-quietly (message "Done unhighlighting")))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
673
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
674 ;;;; These functions use text properties instead of overlays. Text properties
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
675 ;;;; are copied through kill and yank...which might be convenient, but is not
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
676 ;;;; terribly efficient as of 19.12, ERGO it's been disabled
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
677 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
678 ;;(defsubst hilit-region-set-face (start end face-name &optional prio prop)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
679 ;; "Highlight region from START to END using FACE and, optionally, PRIO.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
680 ;;The optional 5th arg, PROP is a property to set instead of 'hilit."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
681 ;; (put-text-property start end 'face face-name)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
682 ;; )
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
683 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
684 ;;(defun hilit-unhighlight-region (start end &optional quietly)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
685 ;; "Unhighlights the region from START to END, optionally in a QUIET way"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
686 ;; (interactive "r")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
687 ;; (let ((buffer-read-only nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
688 ;; (bm (buffer-modified-p)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
689 ;; (remove-text-properties start end '(face))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
690 ;; (set-buffer-modified-p bm)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
691 ;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
692
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
693 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
694 ;; Pattern Application code and user functions
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
695 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
696
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
697 (defun hilit-highlight-region (start end &optional patterns quietly)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
698 "Highlights the area of the buffer between START and END (the region when
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
699 interactive). Without the optional PATTERNS argument, the pattern for
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
700 major-mode is used. If PATTERNS is a symbol, then the patterns associated
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
701 with that symbol are used. QUIETLY suppresses progress messages if
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
702 non-nil."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
703 (interactive "r")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
704 (cond ((null patterns)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
705 (setq patterns (cdr (assq major-mode hilit-patterns-alist))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
706 ((symbolp patterns)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
707 (setq patterns (cdr (assq patterns hilit-patterns-alist)))))
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
708 ;; txt prop: (setq patterns (reverse patterns))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
709 (let ((case-fold-search (car patterns))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
710 (prio (1- (length patterns)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
711 ;; txt prop: (buffer-read-only nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
712 ;; txt prop: (bm (buffer-modified-p))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
713 p pstart pend face mstart (puke-count 0))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
714 ;; txt prop: (unwind-protect
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
715 (setq patterns (cdr patterns)) ; remove case-fold from head of pattern
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
716 (save-excursion
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
717 (save-restriction
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
718 (narrow-to-region start end)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
719 (while patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
720 (setq p (car patterns))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
721 (setq pstart (car p)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
722 pend (nth 1 p)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
723 face (hilit-lookup-face-create (nth 2 p)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
724 (if (not face) ; skipped if nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
725 nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
726 (or quietly hilit-quietly
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
727 (message "highlighting %d: %s%s" prio pstart
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
728 (if (stringp pend) (concat " ... " pend) "")))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
729 (goto-char (point-min))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
730 (condition-case msg
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
731 (cond
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
732 ((symbolp pstart)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
733 ;; inner loop -- special function to find pattern
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
734 (let (region)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
735 (while (setq region (funcall pstart pend))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
736 (hilit-region-set-face (car region) (cdr region)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
737 face prio))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
738 ((stringp pend)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
739 ;; inner loop -- regex-start ... regex-end
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
740 (while (re-search-forward pstart nil t nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
741 (goto-char (setq mstart (match-beginning 0)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
742 (if (re-search-forward pend nil t nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
743 (hilit-region-set-face mstart (match-end 0)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
744 face prio)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
745 (forward-char 1))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
746 ((numberp pend)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
747 ;; inner loop -- just one regex to match whole pattern
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
748 (while (re-search-forward pstart nil t nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
749 (goto-char (match-end pend))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
750 (hilit-region-set-face (match-beginning pend)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
751 (match-end pend) face prio)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
752 (t (error "malformed pattern")))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
753 (error (if (> (setq puke-count (1+ puke-count)) 1)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
754 (error msg)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
755 (message "Error: '%s'" msg)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
756 (ding) (sit-for 4)))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
757 (setq prio (1- prio)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
758 patterns (cdr patterns)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
759 ))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
760 (or quietly hilit-quietly (message "")) ; "Done highlighting"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
761 ;; txt prop: (set-buffer-modified-p bm)) ; unwind protection
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
762 ))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
763
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
764 (defun hilit-rehighlight-region (start end &optional quietly)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
765 "Re-highlights the region, optionally in a QUIET way"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
766 (interactive "r")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
767 (save-restriction
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
768 (widen)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
769 (setq start (apply 'min start (mapcar 'overlay-start (overlays-at start)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
770 end (apply 'max end (mapcar 'overlay-end (overlays-at end))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
771 (hilit-unhighlight-region start end quietly)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
772 (hilit-highlight-region start end nil quietly)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
773
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
774 (defun hilit-rehighlight-buffer (&optional quietly)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
775 "Re-highlights the buffer, optionally in a QUIET way"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
776 (interactive "")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
777 (let ((parse-fn (cdr (assq major-mode hilit-parser-alist))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
778 (if parse-fn
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
779 (funcall parse-fn quietly)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
780 (hilit-rehighlight-region (point-min) (point-max) quietly)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
781 nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
782
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
783 (defun hilit-rehighlight-buffer-quietly ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
784 (hilit-rehighlight-buffer t))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
785
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
786 (defun hilit-rehighlight-message (quietly)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
787 "Highlight a buffer containing a news article or mail message."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
788 (save-excursion
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
789 (goto-char (point-min))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
790 ;; find separation between headers and body (either a blank line or
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
791 ;; the message separator line in mail-mode)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
792 (re-search-forward "^\\(\\|--text follows this line--\\)$" nil 'noerr)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
793 (hilit-unhighlight-region (point-min) (point-max) quietly)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
794 (hilit-highlight-region (point-min) (point) 'msg-header quietly)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
795 (hilit-highlight-region (point) (point-max) 'msg-body quietly)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
796
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
797 (defalias 'hilit-highlight-buffer 'hilit-rehighlight-buffer)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
798
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
799 ;; Well, I want to remove this function...there's one sure way to find out if
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
800 ;; anyone uses it or not...and that's to comment it out.
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
801 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
802 ;; (defun hilit-toggle-highlight (arg)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
803 ;; "Locally toggle highlighting. With arg, forces highlighting off."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
804 ;; (interactive "P")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
805 ;; ;; FIXME -- this loses numeric information in hilit-auto-rehighlight
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
806 ;; (setq hilit-auto-rehighlight
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
807 ;; (and (not arg) (not hilit-auto-rehighlight)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
808 ;; (if hilit-auto-rehighlight
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
809 ;; (hilit-rehighlight-buffer)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
810 ;; (hilit-unhighlight-region (point-min) (point-max)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
811 ;; (message "Rehighlighting is set to %s" hilit-auto-rehighlight))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
812
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
813 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
814 ;; HOOKS
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
815 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
816
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
817 (defun hilit-find-file-hook ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
818 "Find-file hook for hilit package. See the variable hilit-auto-highlight."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
819 (cond ((and hilit-auto-highlight
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
820 (assq major-mode hilit-patterns-alist))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
821 (if (> buffer-saved-size (car hilit-auto-rehighlight-fallback))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
822 (setq hilit-auto-rehighlight
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
823 (cdr hilit-auto-rehighlight-fallback)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
824 (if (> buffer-saved-size hilit-auto-highlight-maxout)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
825 nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
826 (let ((bm (buffer-modified-p)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
827 (hilit-rehighlight-buffer)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
828 (set-buffer-modified-p bm))))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
829
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
830 (defun hilit-repaint-command (arg)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
831 "Rehighlights according to the value of hilit-auto-rehighlight, or the
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
832 prefix argument if that is specified.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
833 \t\\[hilit-repaint-command]\t\trepaint according to hilit-auto-rehighlight
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
834 \t^U \\[hilit-repaint-command]\trepaint entire buffer
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
835 \t^U - \\[hilit-repaint-command]\trepaint visible portion of buffer
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
836 \t^U n \\[hilit-repaint-command]\trepaint n lines to either side of point"
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
837 (interactive "P")
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
838 (let (st en quietly)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
839 (or arg (setq arg hilit-auto-rehighlight))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
840 (cond ((or (eq arg 'visible) (eq arg '-))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
841 (setq st (window-start) en (window-end) quietly t))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
842 ((numberp arg)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
843 (setq st (save-excursion (forward-line (- arg)) (point))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
844 en (save-excursion (forward-line arg) (point))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
845 (arg
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
846 (hilit-rehighlight-buffer)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
847 (if st
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
848 (hilit-rehighlight-region st en quietly))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
849
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
850 (defun hilit-recenter (arg)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
851 "Recenter, then rehighlight according to hilit-auto-rehighlight. If called
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
852 with an unspecified prefix argument (^U but no number), then a rehighlight of
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
853 the entire buffer is forced."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
854 (interactive "P")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
855 (recenter arg)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
856 ;; force display update
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
857 (sit-for 0)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
858 (hilit-repaint-command (consp arg)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
859
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
860 (defun hilit-yank (arg)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
861 "Yank with rehighlighting"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
862 (interactive "*P")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
863 (let ((transient-mark-mode nil))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
864 (yank arg)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
865 (and hilit-auto-rehighlight
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
866 (hilit-rehighlight-region (region-beginning) (region-end) t))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
867 (setq this-command 'yank)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
868
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
869 (defun hilit-yank-pop (arg)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
870 "Yank-pop with rehighlighting"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
871 (interactive "*p")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
872 (let ((transient-mark-mode nil))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
873 (yank-pop arg)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
874 (and hilit-auto-rehighlight
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
875 (hilit-rehighlight-region (region-beginning) (region-end) t))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
876 (setq this-command 'yank)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
877
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
878 ;;; this line highlighting stuff is untested. play with it only if you feel
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
879 ;;; adventurous...don't ask me to fix it...though you're welcome to. -- Stig
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
880 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
881 ;; (defun hilit-rehighlight-line-quietly (&rest args)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
882 ;; "Quietly rehighlight just this line.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
883 ;; Useful as an after change hook in VM/gnus summary buffers and dired buffers.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
884 ;; If only there were an after-change-function, that is..."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
885 ;; (save-excursion
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
886 ;; (push-mark nil t)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
887 ;; (hilit-rehighlight-yank-region)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
888 ;; (and orig-achange-function (apply orig-achange-function args))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
889 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
890 ;; (defun hilit-install-line-hooks ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
891 ;; (make-variable-buffer-local 'after-change-function)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
892 ;; (make-local-variable 'orig-achange-function)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
893 ;; (setq orig-achange-function after-change-function)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
894 ;; (setq after-change-function 'hilit-rehighlight-line-quietly))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
895
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
896 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
897 ;; Wysiwyg Stuff... take it away and build a whole package around it!
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
898 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
899 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
900 ;; ; For the Jargon-impaired, WYSIWYG === What You See Is What You Get
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
901 ;; ; Sure, it sucks to type. Oh, well.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
902 ;; (defun hilit-wysiwyg-replace ()
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
903 ;; "Replace overstruck text with normal text that's been overlaid with the
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
904 ;; appropriate text attribute. Suitable for a find-file hook."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
905 ;; (save-excursion
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
906 ;; (goto-char (point-min))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
907 ;; (let ((wysb (hilit-lookup-face-create 'wysiwyg-bold))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
908 ;; (wysu (hilit-lookup-face-create 'wysiwyg-underline))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
909 ;; (bmod (buffer-modified-p)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
910 ;; (while (re-search-forward "\\(.\b.\\)+" nil t)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
911 ;; (let ((st (match-beginning 0)) (en (match-end 0)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
912 ;; (goto-char st)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
913 ;; (if (looking-at "_")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
914 ;; (hilit-region-set-face st en wysu 100 'wysiwyg)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
915 ;; (hilit-region-set-face st en wysb 100 'wysiwyg))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
916 ;; (while (and (< (point) en) (looking-at ".\b"))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
917 ;; (replace-match "") (forward-char))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
918 ;; ))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
919 ;; (set-buffer-modified-p bmod))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
920 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
921 ;; ; is this more appropriate as a write-file-hook or a write-contents-hook?
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
922 ;; (defun hilit-wysiwyg-write-repair ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
923 ;; "Replace wysiwyg overlays with overstrike text."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
924 ;; (message "*sigh* hilit-wysiwyg-write-repair not implemented yet")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
925 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
926 ;; For efficiency, this hook should copy the current buffer to a scratch
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
927 ;; buffer and do its overstriking there. Overlays are not copied, so it'll
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
928 ;; be necessary to hop back and forth. This is OK since you're not fiddling
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
929 ;; with--making or deleting--any overlays. THEN write the new buffer,
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
930 ;; delete it, and RETURN T. << important
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
931 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
932 ;; Just so you know...there is already an emacs function called
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
933 ;; underline-region that does underlining. I think that the thing to do is
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
934 ;; extend that to do overstriking as well.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
935 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
936 ;; (while (< start end)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
937 ;; (mapcar (function (lambda (ovr)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
938 ;; (and (overlay-get ovr 'hilit) (delete-overlay ovr))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
939 ;; (overlays-at start))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
940 ;; (setq start (next-overlay-change start)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
941 ;; nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
942
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
943 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
944 ;; Initialization.
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
945 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
946
57754
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
947 (define-minor-mode hilit-mode
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
948 "Obsolete minor mode. Use `global-font-lock-mode' instead."
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
949 :global t
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
950
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
951 (unless (and hilit-inhibit-rebinding hilit-mode)
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
952 (substitute-key-definition
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
953 (if hilit-mode 'yank 'hilit-yank)
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
954 (if hilit-mode 'hilit-yank 'yank)
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
955 (current-global-map))
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
956 (substitute-key-definition
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
957 (if hilit-mode 'yank-pop 'hilit-yank-pop)
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
958 (if hilit-mode 'hilit-yank-pop 'yank-pop)
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
959 (current-global-map))
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
960 (substitute-key-definition
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
961 (if hilit-mode 'recenter 'hilit-recenter)
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
962 (if hilit-mode 'hilit-recenter 'recenter)
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
963 (current-global-map)))
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
964
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
965 (if hilit-mode
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
966 (global-set-key [?\C-\S-l] 'hilit-repaint-command)
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
967 (global-unset-key [?\C-\S-l]))
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
968
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
969 (if hilit-mode
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
970 (add-hook 'find-file-hook 'hilit-find-file-hook t)
57755
6e18b0aebeb3 (hilit-mode): Typo.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 57754
diff changeset
971 (remove-hook 'find-file-hook 'hilit-find-file-hook))
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
972
57754
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
973 (unless (and hilit-inhibit-hooks hilit-mode)
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
974 (condition-case c
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
975 (progn
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
976
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
977 ;; BUFFER highlights...
85187
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
978 (mapc (lambda (hook)
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
979 (if hilit-mode
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
980 (add-hook hook 'hilit-rehighlight-buffer-quietly)
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
981 (remove-hook hook 'hilit-rehighlight-buffer-quietly)))
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
982 '(
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
983 Info-selection-hook
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
984
85187
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
985 ;; runs too early vm-summary-mode-hooks
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
986 vm-summary-pointer-hook
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
987 vm-preview-message-hook
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
988 vm-show-message-hook
57754
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
989
85187
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
990 rmail-show-message-hook
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
991 mail-setup-hook
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
992 mh-show-mode-hook
57754
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
993
85187
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
994 dired-after-readin-hook
e98988d20549 (hilit-mode): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents: 84914
diff changeset
995 ))
57754
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
996 )
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
997 (error (message "Error loading highlight hooks: %s" c)
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
998 (ding) (sit-for 1)))))
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
999
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1000 (eval-when-compile (require 'gnus)) ; no compilation gripes
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1001
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1002 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1003 ;; Default patterns for various modes.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1004 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1005
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1006 ;;; do I need this? I changed the defconst to a defvar because defconst is
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1007 ;;; inappropriate, but I don't know why I wanted hilit-patterns-alist to be
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1008 ;;; reset on every reload...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1009
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
1010 (setq hilit-patterns-alist nil)
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1011
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1012 (defun hilit-associate (alist key val)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1013 "creates, or destructively replaces, the pair (key . val) in alist"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1014 (let ((oldentry (assq key (eval alist))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1015 (if oldentry
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1016 (setcdr oldentry val)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1017 (set alist (cons (cons key val) (eval alist))))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
1018
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1019 (defun hilit-set-mode-patterns (modelist patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1020 &optional parse-fn case-fold)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1021 "Sets the default highlighting patterns for MODE to PATTERNS.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1022 See the variable hilit-mode-enable-list.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1023
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1024 Takes optional arguments PARSE-FN and CASE-FOLD."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1025 ;; change pattern
84914
0306d3c580c6 (hilit-unhighlight-region, hilit-set-mode-patterns):
Juanma Barranquero <lekktu@gmail.com>
parents: 78228
diff changeset
1026 (mapc (function (lambda (p)
0306d3c580c6 (hilit-unhighlight-region, hilit-set-mode-patterns):
Juanma Barranquero <lekktu@gmail.com>
parents: 78228
diff changeset
1027 (and (stringp (car p))
0306d3c580c6 (hilit-unhighlight-region, hilit-set-mode-patterns):
Juanma Barranquero <lekktu@gmail.com>
parents: 78228
diff changeset
1028 (null (nth 1 p))
0306d3c580c6 (hilit-unhighlight-region, hilit-set-mode-patterns):
Juanma Barranquero <lekktu@gmail.com>
parents: 78228
diff changeset
1029 (setcar (cdr p) 0))))
0306d3c580c6 (hilit-unhighlight-region, hilit-set-mode-patterns):
Juanma Barranquero <lekktu@gmail.com>
parents: 78228
diff changeset
1030 patterns)
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1031 (setq patterns (cons case-fold patterns))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
1032
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1033 (or (consp modelist) (setq modelist (list modelist)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1034 (let (ok (flip (eq (car hilit-mode-enable-list) 'not)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1035 (mapcar (function
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1036 (lambda (m)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1037 (setq ok (or (null hilit-mode-enable-list)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1038 (memq m hilit-mode-enable-list)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1039 (and flip (setq ok (not ok)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1040 (and ok
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1041 (progn
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1042 (and parse-fn
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1043 (hilit-associate 'hilit-parser-alist m parse-fn))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1044 (hilit-associate 'hilit-patterns-alist m patterns)))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1045 modelist)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1046
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1047 (defun hilit-add-pattern (pstart pend face &optional mode first)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1048 "Highlight pstart with face for the current major-mode.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1049 Optionally, place the new pattern first in the pattern list"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1050 (interactive "sPattern start regex: \nsPattern end regex (default none): \nxFace: ")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1051
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1052 (and (equal pstart "") (error "Must specify starting regex"))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1053 (cond ((equal pend "") (setq pend 0))
62195
db28615c678a (hilit-add-pattern): Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 57755
diff changeset
1054 ((string-match "^[0-9]+$" pend) (setq pend (string-to-number pend))))
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1055 (or mode (setq mode major-mode))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1056 (let ((old-patterns (cdr (assq mode hilit-patterns-alist)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1057 (new-pat (list pstart pend face)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1058 (cond ((not old-patterns)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1059 (hilit-set-mode-patterns mode (list new-pat)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1060 (first
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1061 (setcdr old-patterns (cons new-pat (cdr old-patterns))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
1062 (t
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1063 (nconc old-patterns (list new-pat)))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1064 (and (interactive-p) (hilit-rehighlight-buffer)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1065
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1066 (defun hilit-string-find (qchar)
42205
7308bbc423d5 Doc fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 40024
diff changeset
1067 "Looks for a string and returns (start . end) or nil. The argument QCHAR
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1068 is the character that would precede a character constant double quote.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1069 Finds strings delimited by double quotes. The first double quote may not be
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1070 preceded by QCHAR and the closing double quote may not be preceded by an odd
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1071 number of backslashes."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1072 (let (st en)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1073 (while (and (search-forward "\"" nil t)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1074 (eq qchar (char-after (1- (setq st (match-beginning 0)))))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1075 (while (and (search-forward "\"" nil t)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1076 (save-excursion
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1077 (setq en (point))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1078 (forward-char -1)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1079 (skip-chars-backward "\\\\")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1080 (forward-char 1)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1081 (not (zerop (% (- en (point)) 2))))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
1082 (and en (cons st en))))
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1083
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1084 ;; return types on same line...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1085 ;; ("^[a-zA-z].*\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1086
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1087 ;; On another note, a working pattern for grabbing function definitions for C is
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
1088 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1089 ;; ("^[a-zA-Z_]+.*[;{]$" nil ForestGreen) ; global defns ( start at col 1 )
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1090 ;; ("^[a-zA-Z_]+.*(" ")" defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1091 ;; ; defuns assumed to start at col 1, not with # or {
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
1092 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1093 ;; this will make external declarations/definitions green, and function
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1094 ;; definitions the defun face. Hmmm - seems to work for me anyway.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1095
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1096 (let ((comments '(("/\\*" "\\*/" comment)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1097 (c++-comments '(("//.*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1098 ("^/.*$" nil comment)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1099 (strings '((hilit-string-find ?' string)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1100 (preprocessor '(("^#[ \t]*\\(undef\\|define\\).*$" "[^\\]$" define)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1101 ("^#.*$" nil include))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1102
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1103 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1104 '(c-mode c++-c-mode elec-c-mode)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1105 (append
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1106 comments strings preprocessor
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1107 '(
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1108 ;; function decls are expected to have types on the previous line
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1109 ("^\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1110 ("^\\(typedef\\|struct\\|union\\|enum\\).*$" nil decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1111 ;; datatype -- black magic regular expression
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1112 ("[ \n\t({]\\(\\(const\\|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)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1113 ;; key words
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1114 ("[^_]\\<\\(return\\|goto\\|if\\|else\\|case\\|default\\|switch\\|break\\|continue\\|while\\|do\\|for\\)\\>[^_]" 1 keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1115 )))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1116
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1117 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1118 'c++-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1119 (append
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1120 comments c++-comments strings preprocessor
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1121 '(
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1122 ;; function decls are expected to have types on the previous line
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1123 ("^\\(\\(\\w\\|[$_]\\)+::\\)?\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1124 ("^\\(\\(\\w\\|[$_]\\)+[ \t]*::[ \t]*\\)?\\(\\(\\w\\|[$_]\\)+\\|operator.*\\)\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1125 ("^\\(template\\|typedef\\|struct\\|union\\|class\\|enum\\|public\\|private\\|protected\\).*$" nil decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1126 ;; datatype -- black magic regular expression
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1127 ("[ \n\t({]\\(\\(const\\|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)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1128 ;; key words
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1129 ("[^_]\\<\\(return\\|goto\\|if\\|else\\|case\\|default\\|switch\\|break\\|continue\\|while\\|do\\|for\\|public\\|protected\\|private\\|delete\\|new\\)\\>[^_]"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1130 1 keyword))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1131
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1132 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1133 '(objc-mode objective-C-mode)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1134 (append
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1135 comments c++-comments strings preprocessor
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1136 '(
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1137 ;; function decls are expected to have types on the previous line
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1138 ("^\\(\\(\\w\\|[$_]\\)+::\\)?\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1139 ("^\\(\\(\\w\\|[$_]\\)+[ \t]*::[ \t]*\\)?\\(\\(\\w\\|[$_]\\)+\\|operator.*\\)\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1140
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1141 ("^\\(template\\|typedef\\|struct\\|union\\|class\\|enum\\|public\\|private\\|protected\\).*$" nil decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1142 ;; datatype -- black magic regular expression
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1143 ("[ \n\t({]\\(\\(const\\|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)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1144 ;; key words
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1145 ("[^_]\\<\\(return\\|goto\\|if\\|else\\|case\\|default\\|switch\\|break\\|continue\\|while\\|do\\|for\\|public\\|protected\\|private\\|interface\\|implementation\\|end\\|super\\|self\\)\\>[^_]"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1146 1 keyword))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1147 )
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1148
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1149 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1150 'perl-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1151 '(("\\s #.*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1152 ("^#.*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1153 ("\"[^\\\"]*\\(\\\\\\(.\\|\n\\)[^\\\"]*\\)*\"" nil string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1154 ("^\\(__....?__\\|\\s *\\sw+:\\)" nil label)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1155 ("^require.*$" nil include)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1156 ("^package.*$" nil decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1157 ("^\\s *sub\\s +\\(\\w\\|[_']\\)+" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1158 ("\\b\\(do\\|if\\|unless\\|while\\|until\\|else\\|elsif\\|for\\|foreach\\|continue\\|next\\|redo\\|last\\|goto\\|return\\|die\\|exit\\)\\b" nil keyword)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1159
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1160 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1161 'ada-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1162 '(;; comments
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1163 ("--.*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1164 ;; main structure
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1165 ("[ \t\n]procedure[ \t]" "\\([ \t]\\(is\\|renames\\)\\|);\\)" glob-struct)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1166 ("[ \t\n]task[ \t]" "[ \t]is" glob-struct)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1167 ("[ \t\n]function[ \t]" "return[ \t]+[A-Za-z_0-9]+[ \t]*\\(is\\|;\\|renames\\)" glob-struct)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1168 ("[ \t\n]package[ \t]" "[ \t]\\(is\\|renames\\)" glob-struct)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1169 ;; if there is nothing before "private", it is part of the structure
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1170 ("^[ \t]*private[ \t\n]" nil glob-struct)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1171 ;; if there is no indentation before the "end", then it is most
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1172 ;; probably the end of the package
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1173 ("^end.*$" ";" glob-struct)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1174 ;; program structure -- "null", "delay" and "terminate" omitted
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1175 ("[ \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)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1176 ;; block structure
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1177 ("[ \n\t]\\(begin\\|end\\|declare\\|exception\\|generic\\|raise\\|return\\|package\\|body\\)[ \n\t;]" nil struct)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1178 ;; type declaration
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1179 ("^[ \t]*\\(type\\|subtype\\).*$" ";" decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1180 ("[ \t]+is record.*$" "end record;" decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1181 ;; "pragma", "with", and "use" are close to C cpp directives
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1182 ("^[ \t]*\\(with\\|pragma\\|use\\)" ";" include)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1183 ;; nice for named parameters, but not so beautiful in case statements
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1184 ("[A-Za-z_0-9.]+[ \t]*=>" nil named-param)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1185 ;; string constants probably not everybody likes this one
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1186 ("\"" ".*\"" string)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1187
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1188 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1189 'fortran-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1190 '(("^[*Cc].*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1191 ("'[^'\n]*'" nil string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1192 ("\\(^[ \t]*[0-9]+\\|[ \t]continue[ \t\n]\\|format\\)" nil define)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1193 ("[ \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)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1194 ("[ \t]\\(call\\|program\\|subroutine\\|function\\|stop\\|return\\|end\\|include\\)[ \t\n]" nil include)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
1195 ("[ \t]\\(parameter[\t\n ]*([^)]*)\\|data\\|save\\|common[ \t\n]*/[^/]*/\\)"
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1196 nil decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1197 ("^ ." nil type)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1198 ("implicit[ \t]*none" nil decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1199 ("\\([ \t]\\|implicit[ \t]*\\)\\(dimension\\|integer\\|real\\|double[ \t]*precision\\|character\\|logical\\|complex\\|double[ \t]*complex\\)\\([*][0-9]*\\|[ \t\n]\\)" nil keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1200 )
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1201 nil 'case-insensitive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1202
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1203 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1204 '(m2-mode modula-2-mode)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1205 '(("(\\*" "\\*)" comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1206 (hilit-string-find ?\\ string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1207 ("^[ \t]*PROCEDURE[ \t]+\\w+[^ \t(;]*" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1208 ("\\<\\(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)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1209 )
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1210 nil 'case-insensitive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1211
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1212 (hilit-set-mode-patterns 'prolog-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1213 '(("/\\*" "\\*/" comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1214 ("%.*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1215 (":-" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1216 ("!" nil label)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1217 ("\"[^\\\"]*\\(\\\\\\(.\\|\n\\)[^\\\"]*\\)*\"" nil string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1218 ("\\b\\(is\\|mod\\)\\b" nil keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1219 ("\\(->\\|-->\\|;\\|==\\|\\\\==\\|=<\\|>=\\|<\\|>\\|=\\|\\\\=\\|=:=\\|=\\\.\\\.\\|\\\\\\\+\\)" nil decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1220 ("\\(\\\[\\||\\|\\\]\\)" nil include)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1221
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1222 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1223 '(
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1224 LaTeX-mode japanese-LaTeX-mode SliTeX-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1225 japanese-SliTeX-mode FoilTeX-mode latex-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1226 )
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1227 '(
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1228 ;; comments
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1229 ("[^\\]%.*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1230
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1231 ;; the following two match \foo[xx]{xx} or \foo*{xx} or \foo{xx}
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1232 ("\\\\\\(sub\\)*\\(paragraph\\|section\\)\\(\*\\|\\[.*\\]\\)?{" "}"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1233 keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1234 ("\\\\\\(chapter\\|part\\)\\(\*\\|\\[.*\\]\\)?{" "}" keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1235 ("\\\\footnote\\(mark\\|text\\)?{" "}" keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1236 ("\\\\[a-z]+box" nil keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1237 ("\\\\\\(v\\|h\\)space\\(\*\\)?{" "}" keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1238
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1239 ;; (re-)define new commands/environments/counters
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1240 ("\\\\\\(re\\)?new\\(environment\\|command\\){" "}" defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1241 ("\\\\new\\(length\\|theorem\\|counter\\){" "}" defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1242
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1243 ;; various declarations/definitions
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1244 ("\\\\\\(setlength\\|settowidth\\|addtolength\\|setcounter\\|addtocounter\\)" nil define)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1245 ("\\\\\\(title\\|author\\|date\\|thanks\\){" "}" define)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1246
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1247 ("\\\\documentstyle\\(\\[.*\\]\\)?{" "}" decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1248 ("\\\\\\(begin\\|end\\|nofiles\\|includeonly\\){" "}" decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1249 ("\\\\\\(raggedright\\|makeindex\\|makeglossary\\|maketitle\\)\\b" nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1250 decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1251 ("\\\\\\(pagestyle\\|thispagestyle\\|pagenumbering\\){" "}" decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1252 ("\\\\\\(normalsize\\|small\\|footnotesize\\|scriptsize\\|tiny\\|large\\|Large\\|LARGE\\|huge\\|Huge\\)\\b" nil decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1253 ("\\\\\\(appendix\\|tableofcontents\\|listoffigures\\|listoftables\\)\\b"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1254 nil decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1255 ("\\\\\\(bf\\|em\\|it\\|rm\\|sf\\|sl\\|ss\\|tt\\)\\b" nil decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1256
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1257 ;; label-like things
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1258 ("\\\\item\\(\\[[^]]*\\]\\)?" nil label)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1259 ("\\\\caption\\(\\[[^]]*\\]\\)?{" "}" label)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1260
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1261 ;; formulas
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1262 ("[^\\]\\\\(" "\\\\)" formula) ; \( \)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1263 ("[^\\]\\\\\\[" "\\\\\\]" formula) ; \[ \]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1264 ("[^\\$]\\(\\$\\(\\$[^$]*\\$\\|[^$]*\\)\\$\\)" 1 formula) ; '$...$' or '$$...$$'
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
1265
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1266 ;; things that bring in external files
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1267 ("\\\\\\(include\\|input\\|bibliography\\){" "}" include)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1268
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1269 ;; "wysiwyg" emphasis -- these don't work with nested expressions
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1270 ;; ("{\\\\\\(em\\|it\\|sl\\)" "}" italic)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1271 ;; ("{\\\\bf" "}" bold)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1272
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1273 ("``" "''" string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1274
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1275 ;; things that do some sort of cross-reference
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1276 ("\\\\\\(\\(no\\)?cite\\|\\(page\\)?ref\\|label\\|index\\|glossary\\){" "}" crossref)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1277 ))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1278
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1279 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1280 'bibtex-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1281 '(;;(";.*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1282 ("%.*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1283 ("@[a-zA-Z]+" nil keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1284 ("{[ \t]*[-a-z:_A-Z0-9]+," nil label) ; is wrong sometimes
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1285 ("^[ \t]*[a-zA-Z]+[ \t]*=" nil define)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1286
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1287 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1288 'compilation-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1289 '(
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1290 ("^[-_.\"A-Za-z0-9]+\\(:\\|, line \\)[0-9]+: warning:.*$" nil warning)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1291 ("^[-_.\"A-Za-z0-9]+\\(:\\|, line \\)[0-9]+:.*$" nil error)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1292 ))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1293
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1294 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1295 'makefile-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1296 '(("^#.*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1297 ("[^$]#.*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1298 ;; rules
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1299 ("^[^ \t\n]*%[^ \t\n]*[ \t]*::?[ \t]*[^ \t\n]*[ \t]*\\(#.*\\)?$" nil rule)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1300 ("^[.][A-Za-z][A-Za-z]?\..*$" nil rule)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1301 ;; variable definition
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1302 ("^[_A-Za-z0-9]+[ \t]*\+?=" nil define)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1303 ("\\( \\|:=\\)[_A-Za-z0-9]+[ \t]*\\+=" nil define)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1304 ;; variable references
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1305 ("\\$\\([^ \t\n{(]\\|[{(]@?[_A-Za-z0-9:.,%/=]+[)}]\\)" nil keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1306 ("^[A-Za-z0-9.,/_-]+[ \t]*:.*$" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1307 ("^include " nil include)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1308
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1309 (let* ((header-patterns '(("^Subject:.*$" nil msg-subject)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1310 ("^From:.*$" nil msg-from)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1311 ("^--text follows this line--$" nil msg-separator)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1312 ("^[A-Za-z][A-Za-z0-9-]+:" nil msg-header)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1313 (body-patterns '(("^\\(In article\\|[ \t]*\\w*[]<>}|]\\).*$"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1314 nil msg-quote)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1315 (message-patterns (append header-patterns body-patterns)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1316 (hilit-set-mode-patterns 'msg-header header-patterns)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1317 (hilit-set-mode-patterns 'msg-body body-patterns)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1318 (hilit-set-mode-patterns '(vm-mode text-mode mail-mode rmail-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1319 gnus-article-mode news-reply-mode mh-show-mode)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1320 message-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1321 'hilit-rehighlight-message))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1322
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1323 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1324 'gnus-group-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1325 '(("^ U.*$" nil gnus-group-unsubscribed)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1326 ("^\\*? +[01]?[0-9]:.*$" nil gnus-group-empty)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1327 ("^ +[2-9][0-9]:.*$" nil gnus-group-full)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1328 ("^ +[0-9][0-9][0-9]+:.*$" nil gnus-group-overflowing)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1329
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1330 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1331 'vm-summary-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1332 '(("^ .*$" nil summary-seen)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1333 ("^->.*$" nil summary-current)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1334 ("^ D.*$" nil summary-deleted)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1335 ("^ U.*$" nil summary-unread)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1336 ("^ N.*$" nil summary-new)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1337
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1338
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1339 ;;; this will match only comments w/ an even (zero is even) number of quotes...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1340 ;;; which is still inadequate because it matches comments in multi-line strings
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1341 ;;; how anal do you want to get about never highlighting comments in strings?
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1342 ;;; I could twiddle with this forever and still it wouldn't be perfect.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1343 ;;; (";\\([^\"\n]*\"[^\"\n]*\"\\)*[^\"\n]*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1344
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1345 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1346 '(emacs-lisp-mode lisp-interaction-mode)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1347 '(
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1348 (";.*" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1349
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
1350 ;;; This almost works...but I think I'll stick with the parser function
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1351 ;;;("[^?]\\(\"\\(\"\\||\\([^\"]+\\|[\\]\\([\\][\\]\\)*\"\\)*\"\\)\\)" 1 string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1352 (hilit-string-find ?\\ string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1353
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1354 ("^\\s *(def\\(un\\|macro\\|advice\\|alias\\|subst\\)[ \t\n]"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1355 "\\()\\|nil\\)" defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1356 ("^\\s *(defvar\\s +\\S +" nil decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1357 ("^\\s *(defconst\\s +\\S +" nil define)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1358 ("^\\s *(\\(provide\\|require\\|\\(auto\\)?load\\).*$" nil include)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1359 ("\\s *\\&\\(rest\\|optional\\)\\s *" nil keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1360 ("(\\(let\\*?\\|cond\\|if\\|or\\|and\\|map\\(car\\|concat\\)\\|prog[n1*]?\\|while\\|lambda\\|function\\|set\\([qf]\\|car\\|cdr\\)?\\|nconc\\|eval-when-compile\\|condition-case\\|unwind-protect\\|catch\\|throw\\|error\\)[ \t\n]" 1 keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1361 ))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1362
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1363 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1364 '(lisp-mode ilisp-mode)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1365 '(
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1366 (";.*" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1367 ("#|" "|#" comment)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
1368 ;;; This almost works...but I think I'll stick with the parser function
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1369 ;;;("[^?]\\(\"\\(\"\\||\\([^\"]+\\|[\\]\\([\\][\\]\\)*\"\\)*\"\\)\\)" 1 string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1370 (hilit-string-find ?\\ string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1371
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1372 ;; this is waaaaaaaay too slow
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1373 ;; ("^\\s *(def\\(un\\|macro\\|advice\\|alias\\|method\\|subst\\)\\s \\S +[ \t\n]+\\(nil\\|(\\(([^()]*)\\|[^()]+\\)*)\\)" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1374 ("^\\s *(def\\(un\\|macro\\|advice\\|subst\\|method\\)\\s " "\\()\\|nil\\)" defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1375
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1376 ("^\\s *(\\(def\\(var\\|type\\|parameter\\)\\|declare\\)\\s +\\S +" nil decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1377 ("^\\s *(def\\(const\\(ant\\)?\\|class\\|struct\\)\\s \\S +[ \t\n]+" nil define)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1378 ("^\\s *(\\(provide\\|require\\|\\(auto\\)?load\\).*$" nil include)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1379 ("[ \t]\\&\\(key\\|rest\\|optional\\|aux\\)\\s *" nil keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1380 ("(\\(let\\*?\\|locally\\|cond\\|if\\*?\\|or\\|and\\|map\\(car\\|c[ao]n\\)?\\|prog[nv1*]?\\|while\\|when\\|unless\\|do\\(\\*\\|list\\|times\\)\\|list\\|lambda\\|function\\|values\\|set\\([qf]\\|car\\|cdr\\)?\\|rplac[ad]\\|nconc\\|block\\|go\\|return\\(-from\\)?\\|[ec]?\\(type\\)?case\\|multiple-value-\\(bind\\|setq\\|list\\|call\\|prog1\\)\\|unwind-protect\\|handler-case\\|catch\\|throw\\|eval-when\\(-compile\\)?\\)[ \t\n]" 1 keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1381 ))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1382
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1383
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1384 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1385 'plain-tex-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1386 '(("^%%.*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1387 ("{\\\\em\\([^}]+\\)}" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1388 ("\\(\\\\\\w+\\)" nil keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1389 ("{\\\\bf\\([^}]+\\)}" nil keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1390 ("^[ \t\n]*\\\\def[\\\\@]\\(\\w+\\)" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1391 ("\\\\\\(begin\\|end\\){\\([A-Za-z0-9\\*]+\\)}" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1392 ;; ("[^\\\\]\\$\\([^$]*\\)\\$" nil string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1393 ("\\$\\([^$]*\\)\\$" nil string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1394 ))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1395
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1396 ;; Reasonable extensions would include smarter parameter handling for such
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1397 ;; things as the .IX and .I macros, which alternate the handling of following
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1398 ;; arguments.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1399
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1400 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1401 'nroff-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1402 '(("^\\.[\\\][\\\"].*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1403 ("^\\.so .*$" nil include)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1404 ("^\\.[ST]H.*$" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1405 ;; ("^[^\\.].*\"[^\\\"]*\\(\\\\\\(.\\)[^\\\"]*\\)*\"" nil string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1406 ("\"" "[^\\]\"" string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1407 ("^\\.[A-Z12\\\\].*$" nil define)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1408 ("\\([\\\][^ ]*\\)" nil keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1409 ("^\\.[A-Z].*$" nil keyword))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1410 nil 'case-insensitive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1411
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1412 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1413 'texinfo-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1414 '(("^\\(@c\\|@comment\\)\\>.*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1415 ("@\\(emph\\|strong\\|b\\|i\\){[^}]+}" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1416 ;; seems broken
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1417 ;; ("\\$[^$]*\\$" nil string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1418 ("@\\(file\\|kbd\\|key\\){[^}]+}" nil string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1419 ("^\\*.*$" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1420 ("@\\(if\\w+\\|format\\|item\\)\\b.*$" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1421 ("@end +[A-Za-z0-9]+[ \t]*$" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1422 ("@\\(samp\\|code\\|var\\){[^}]+}" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1423 ("@\\w+\\({[^}]+}\\)?" nil keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1424 ))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1425
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1426 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1427 'dired-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1428 (append
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1429 '(("^D.*$" nil dired-deleted)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1430 ("^\\*.*$" nil dired-marked)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1431 ("^ d.*$" nil dired-directory)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1432 ("^ l.*$" nil dired-link)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1433 ("^ -.*#.*#$" nil dired-ignored))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1434 (list (cons
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1435 (concat "^ .*\\("
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1436 (mapconcat 'regexp-quote completion-ignored-extensions "\\|")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1437 "\\)$")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1438 '(nil dired-ignored)))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1439
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1440 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1441 'jargon-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1442 '(("^:[^:]*:" nil jargon-entry)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1443 ("{[^}]*}+" nil jargon-xref)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1444
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1445 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1446 'Info-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1447 '(("^\\* [^:]+:+" nil jargon-entry)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1448 ("\\*[Nn]ote\\b[^:]+:+" nil jargon-xref)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1449 (" \\(Next\\|Prev\\|Up\\):" nil jargon-xref)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1450 ("- \\(Variable\\|Function\\|Macro\\|Command\\|Special Form\\|User Option\\):.*$"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1451 nil jargon-keyword))) ; lisp manual
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1452
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1453 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1454 'calendar-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1455 '(("[A-Z][a-z]+ [0-9]+" nil define) ; month and year
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1456 ("S M Tu W Th F S" nil label))) ; week days
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1457
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1458 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1459 'asm-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1460 '(("/\\*" "\\*/" comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1461 ("^#[ \t]*\\(undef\\|define\\).*$" "[^\\]$" define)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1462 ("^#.*$" nil include)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1463 ;; labels
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1464 ("^.+:" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1465 ;; assembler directives
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1466 ("^[ \t]*\\..*$" nil decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1467 ;; register names
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1468 ("\\$[a-z0-9]+" nil string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1469 ;; mnemonics
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1470 ("^[ \t]*[a-z]+" nil struct)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1471
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1472 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1473 'pascal-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1474 '(("(\\*" "\\*)" comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1475 ("{" "}" comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1476 ;; Doesn't work when there are strings in comments....
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1477 ;; ("'[^']*'" nil string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1478 ("^#.*$" nil include)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1479 ("^[ \t]*\\(procedure\\|function\\)[ \t]+\\w+[^ \t(;]*" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1480 ("\\<\\(program\\|begin\\|end\\)\\>" nil defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1481 ("\\<\\(external\\|forward\\)\\>" nil include)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1482 ("\\<\\(label\\|const\\|type\\|var\\)\\>" nil define)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1483 ("\\<\\(record\\|array\\|file\\)\\>" nil type)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1484 ("\\<\\(of\\|to\\|for\\|if\\|then\\|else\\|case\\|while\\|do\\|until\\|and\\|or\\|not\\|with\\|repeat\\)\\>" nil keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1485 )
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1486 nil 'case-insensitive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1487
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1488 (hilit-set-mode-patterns
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1489 'icon-mode
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1490 '(("#.*$" nil comment)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1491 ("\"[^\\\"]*\\(\\\\.[^\\\"]*\\)*\"" nil string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1492 ;; charsets: these do not work because of a conflict with strings
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1493 ;; ("'[^\\']*\\(\\\\.[^\\']*\\)*'" nil string)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1494 ("^[ \t]*procedure[ \t]+\\w+[ \t]*(" ")" defun)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1495 ("^[ \t]*record.*(" ")" include)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1496 ("^[ \t]*\\(global\\|link\\)[ \t\n]+[A-Za-z_0-9]+\\([ \t\n]*,[ \t\n]*[A-Za-z_0-9]+\\)*" nil include)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1497 ("^[ \t]*\\(local\\|static\\)[ \t\n]+[A-Za-z_0-9]+\\([ \t\n]*,[ \t\n]*[A-Za-z_0-9]+\\)*" nil decl)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1498 ("\\<\\(initial\\|end\\)\\>" nil glob-struct)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1499 ("\\<\\(while\\|until\\|return\\|every\\|if\\|then\\|else\\|to\\|case\\|of\\|suspend\\|create\\|do\\|repeat\\|break\\)\\>" nil keyword)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1500 ))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1501
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1502 ;; as you can see, I had two similar problems for Pascal and Icon. In
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1503 ;; Pascal, strings are delimited with ' and an embedded quote is doubled,
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1504 ;; thus string syntax would be extremely simple. However, if a string
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1505 ;; occurs within a comment, the following text is considered a string.
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46899
diff changeset
1506 ;;
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1507 ;; In Icon, strings are similar to C ones, but there are also charsets,
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1508 ;; delimited with simple quotes. I could not manage to use both regexps at
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1509 ;; the same time.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1510
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1511 ;; The problem I have with my patterns for Icon is that this language has a
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1512 ;; string similar constant to the C one (but a string can be cut on several
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1513 ;; lines, if terminated by a dash and continued with initial blanks, like
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1514 ;; this:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1515 ;; "This is a somewhat long -
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1516 ;; string, written on three -
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1517 ;; successive lines"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1518 ;; in order to insert a double quote in a string, you have to escape it
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1519 ;; with a \), bu also a character set constant (named a charset), which
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1520 ;; uses single quotes instead of double ones. It would seem intuitive to
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1521 ;; highlight both constants in the same way.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1522
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1523
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1524 (provide 'hilit19)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1525
57754
5062636cfe37 (hilit-mode): New function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52401
diff changeset
1526 ;; arch-tag: db99739a-4837-41ee-ad02-3baced8ae71d
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 35063
diff changeset
1527 ;;; hilit19.el ends here