annotate lisp/modes/whitespace-mode.el @ 48:56c54cf7c5b6 r19-16b90

Import from CVS: tag r19-16b90
author cvs
date Mon, 13 Aug 2007 08:56:04 +0200
parents 4103f0995bd7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
1 ;;; whitespace-mode.el -- minor mode for making whitespace visible
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
2
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
3 ;; Copyright (C) 1994, 1995, 1996 Heiko Muenkel
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
4
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
5 ;; Author: Heiko Muenkel <muenkel@tnt.uni-hannover.de>
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
6 ;; Keywords: modes, extensions
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
7
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
8 ;; This file is part of XEmacs.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
9
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
10 ;; XEmacs is free software; you can redistribute it and/or modify it
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
11 ;; under the terms of the GNU General Public License as published by
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
13 ;; option) any later version.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
14
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
15 ;; XEmacs is distributed in the hope that it will be useful, but
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
18 ;; General Public License for more details.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
19
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
21 ;; along with XEmacs; if not, write to the Free Software
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
22 ;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
23 ;; 02111-1307, USA.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
25 ;;; Synched up with: FSF 19.34.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
26
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
27 ;;; Commentary:
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
28
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
29 ;; $Id: whitespace-mode.el,v 1.2 1997/02/22 22:07:27 steve Exp $
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
30 ;; Description:
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
31 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
32 ;; This is a minor mode, which highlights whitespaces (blanks and
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
33 ;; tabs) with different faces, so that it is easier to
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
34 ;; distinguish between them.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
35 ;; Toggle the mode with: M-x whitespace-mode
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
36 ;; or with: M-x whitespace-incremental-mode
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
37 ;; The second one should be used in big files.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
38 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
39 ;; If you want to know how the whitespaces are highlighted then
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
40 ;; type: M-x whitespace-show-faces
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
41 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
42 ;; There are 2 hook variables `whitespace-incremental-mode-hook'
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
43 ;; and `whitespace-mode-hook' to customize the mode.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
44 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
45 ;; Look at the variable `whitespace-chars', if you only want to
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
46 ;; highlight tabs or blanks and not both.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
47 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
48 ;; Set `whitespace-install-toolbar-icon' to t, if you want a
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
49 ;; toolbar icon for this mode.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
50 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
51 ;; Set `whitespace-install-submenu' to t, if you want a submenu
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
52 ;; for this mode. Sorry, at the moment there is no menu for the
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
53 ;; Emacs 19.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
54 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
55 ;; Thanks to Mike Scheidler for the toolbar icon code.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
56 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
57 ;; Installation:
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
58 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
59 ;; Put the files whitespace-mode.el and adapt.el in one of your
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
60 ;; load-path directories and the following lines (without the
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
61 ;; comment signs) in your .emacs (adapt.el is already in the
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
62 ;; XEmacs 19.12).
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
63 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
64 ;; (autoload 'whitespace-mode "whitespace-mode"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
65 ;; "Toggle whitespace mode.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
66 ;; With arg, turn whitespace mode on iff arg is positive.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
67 ;; In whitespace mode the different whitespaces (tab, blank return)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
68 ;; are highlighted with different faces. The faces are:
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
69 ;; `whitespace-blank-face', `whitespace-tab-face' and
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
70 ;; `whitespace-return-face'."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
71 ;; t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
72 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
73 ;; (autoload 'whitespace-incremental-mode "whitespace-mode"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
74 ;; "Toggle whitespace incremental mode.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
75 ;; With arg, turn whitespace incremental mode on iff arg is positive.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
76 ;; In whitespace incremental mode the different whitespaces (tab and
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
77 ;; blank) are highlighted with different faces. The faces are:
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
78 ;; `whitespace-blank-face' and `whitespace-tab-face'.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
79 ;; Use the command `whitespace-show-faces' to show their values.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
80 ;; In this mode only these tabs and blanks are highlighted, which are in
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
81 ;; the region from (point) - (window-heigh) to (point) + (window-heigh)."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
82
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
83 ;;; Code:
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
84
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
85 (provide 'whitespace-mode)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
86 (require 'adapt)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
87
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
88 ;;; variables:
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
89
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
90 (defvar whitespace-chars 'tabs-and-blanks
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
91 "*Determines, which whitespaces are highlighted.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
92 Valid values are:
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
93 'tabs-and-blanks => tabs and blanks are highlighted;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
94 'tabs => only tabs are highlighted;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
95 'blanks => only blanks are highlighted;.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
96
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
97 Changing this variable during the whitespace-*-mode is active could lead
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
98 to wrong highlighted whitespaces.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
99
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
100 (make-variable-buffer-local 'whitespace-chars)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
101
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
102 (defvar whitespace-mode-hook nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
103 "*Run after the `whitespace-mode' is switched on.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
104
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
105 (defvar whitespace-incremental-mode-hook nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
106 "*Run after the `whitespace-incremental-mode' is switched on.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
107
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
108
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
109 (if (adapt-xemacsp)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
110 (progn
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
111
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
112 (defvar whitespace-install-toolbar-icon nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
113 "Set it to t, if a toolbar icon should be installed during loading this file.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
114 The icon calls the function 'whitespace-toolbar-function'.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
115
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
116 (defvar whitespace-install-submenu nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
117 "Set it to t, if a submenu should be installed during loading this file.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
118
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
119 ))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
120
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
121
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
122 (defvar whitespace-toolbar-function 'whitespace-incremental-mode
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
123 "*The toolbar icon for the whitespace mode calls this function.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
124 Valid values are: 'whitespace--mode and 'whitespace-incremental-mode.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
125
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
126 (defvar whitespace-blank-and-tab-search-string "\\( \\)\\|\\(\t\\)"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
127 "The regexp used to search for tabs and blanks.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
128
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
129 (defvar whitespace-tab-search-string "\t"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
130 "The search string used to find tabs.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
131
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
132 (defvar whitespace-blank-search-string " "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
133 "The search string used to find blanks.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
134
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
135 ;;; Defining faces
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
136 (if (facep 'whitespace-blank-face)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
137 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
138 (make-face 'whitespace-blank-face)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
139 (set-face-background 'whitespace-blank-face "LightBlue1"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
140
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
141 (if (facep 'whitespace-tab-face)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
142 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
143 (make-face 'whitespace-tab-face)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
144 (set-face-background 'whitespace-tab-face "yellow")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
145 (set-face-underline-p 'whitespace-tab-face t))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
146
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
147 (defun whitespace-show-faces ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
148 "Shows the faces used by the `whitespace-mode'."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
149 (interactive)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
150 (save-excursion
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
151 (let ((actual-buffer-name (buffer-name (current-buffer)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
152 (actual-whitespace-chars whitespace-chars)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
153 (whitespace-mode-active (or whitespace-mode
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
154 whitespace-incremental-mode))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
155 (buffer (get-buffer-create "*Help*")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
156 (set-buffer buffer)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
157 (setq whitespace-chars actual-whitespace-chars)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
158 (delete-region (point-min) (point-max))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
159 (insert "In the whitespace minor mode\n"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
160 " this \" ")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
161 (whitespace-highlight-region (1- (point)) (point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
162 (insert "\" is a blank, highlighted with `whitespace-blank-face' and\n"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
163 " this \"\t")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
164 (whitespace-highlight-region (1- (point)) (point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
165 (insert "\" is a tab, highlighted with `whitespace-tab-face'.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
166
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
167 (newline 2)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
168 (if (eq whitespace-chars 'blanks)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
169 (insert
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
170 "The highlighting of tabs is switched off.\n")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
171 (if (eq whitespace-chars 'tabs)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
172 (insert
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
173 "The highlighting of blanks is switched off.\n")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
174 (newline)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
175 (if whitespace-mode-active
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
176 (insert "A whitespace minor mode is active in the buffer\n "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
177 actual-buffer-name
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
178 ".\n")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
179 (insert "No whitespace minor mode is active in the buffer\n "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
180 actual-buffer-name
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
181 ".\n"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
182 (show-temp-buffer-in-current-frame buffer)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
183 )))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
184
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
185 ;;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
186 (defun whitespace-highlight-chars-in-region (char-string from to face)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
187 "Highlights the CHAR-STRING in the region from FROM to TO with the FACE."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
188 (while (search-forward char-string end t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
189 (let ((extent))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
190 (cond ((match-beginning 0)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
191 (setq extent (make-extent (match-beginning 0) (match-end 0)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
192 (set-extent-face extent face)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
193 ))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
194 (set-extent-property extent 'start-open t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
195 (set-extent-property extent 'end-open t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
196 )))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
197
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
198 (defun whitespace-highlight-region (from to)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
199 "Highlights the whitespaces in the region from FROM to TO."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
200 (let ((start (min from to))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
201 (end (max from to)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
202 (save-excursion
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
203 ;; (message "Highlighting tabs and blanks...")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
204 (goto-char start)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
205 (cond ((eq whitespace-chars 'tabs-and-blanks)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
206 (while (search-forward-regexp
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
207 whitespace-blank-and-tab-search-string end t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
208 (let ((extent))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
209 (cond ((match-beginning 1) ; blanks ?
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
210 (setq extent (make-extent (match-beginning 1)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
211 (match-end 1)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
212 (set-extent-face extent 'whitespace-blank-face)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
213 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
214 ((match-beginning 2) ; tabs ?
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
215 (setq extent (make-extent (match-beginning 2)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
216 (match-end 2)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
217 (set-extent-face extent 'whitespace-tab-face)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
218 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
219 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
220 (set-extent-property extent 'start-open t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
221 (set-extent-property extent 'end-open t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
222 )))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
223 ((eq whitespace-chars 'tabs)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
224 (whitespace-highlight-chars-in-region whitespace-tab-search-string
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
225 from
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
226 to
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
227 'whitespace-tab-face))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
228 ((eq whitespace-chars 'blanks)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
229 (whitespace-highlight-chars-in-region
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
230 whitespace-blank-search-string
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
231 from
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
232 to
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
233 'whitespace-blank-face))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
234 (t (error "ERROR: Bad value of whitespace-highlight-char")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
235 ;; (message "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
236 )))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
237
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
238 (defun whitespace-highlight-buffer ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
239 "Highlights the whitespaces in the current buffer."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
240 (whitespace-highlight-region (point-min) (point-max))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
241 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
242
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
243 (defsubst whitespace-find-next-highlighted-region (from to)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
244 "Returns nil or the next highlighted region."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
245 (map-extents '(lambda (extent dummy)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
246 (if (extent-property extent 'whitespace-highlighted-region)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
247 extent))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
248 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
249 from
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
250 to))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
251
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
252 (defun whitespace-incremental-highlight (from to)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
253 "Highligthts the region from FROM to TO incremental."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
254 (save-excursion
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
255 (goto-char from)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
256 (let ((extent (extent-at (point) nil 'whitespace-highlighted-region))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
257 (next-extent nil)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
258 (start nil))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
259 (while (< (point) to)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
260 (if extent
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
261 (goto-char (extent-end-position extent)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
262 (if (< (point) to)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
263 (progn
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
264 (setq start (point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
265
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
266 (setq next-extent (whitespace-find-next-highlighted-region
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
267 start
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
268 to))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
269 (if extent
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
270 (if next-extent
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
271 (progn
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
272 (set-extent-endpoints extent
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
273 (extent-start-position extent)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
274 (extent-end-position next-extent)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
275 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
276 (whitespace-highlight-region start
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
277 (1-
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
278 (extent-start-position
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
279 next-extent)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
280 (delete-extent next-extent))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
281 (set-extent-endpoints extent
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
282 (extent-start-position extent)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
283 to)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
284 (whitespace-highlight-region start to))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
285 (if next-extent
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
286 (progn
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
287 (setq extent next-extent)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
288 (whitespace-highlight-region start
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
289 (1- (extent-start-position
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
290 next-extent)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
291 (set-extent-endpoints extent
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
292 start
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
293 (extent-end-position next-extent)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
294 (setq extent (make-extent start to))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
295 (set-extent-property extent 'whitespace-highlighted-region t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
296 (whitespace-highlight-region start to)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
297 ))))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
298
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
299
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
300 (defun whitespace-highlight-window ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
301 "Highlights the whitespaces in the current window."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
302 (whitespace-incremental-highlight (save-excursion
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
303 (forward-line (- (window-height)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
304 (point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
305 (save-excursion
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
306 (forward-line (window-height))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
307 (point))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
308
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
309 (defun whitespace-dehighlight-region (start end)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
310 "Dehighlights the whitespaces in the region from START to END."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
311 (map-extents '(lambda (extent dummy)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
312 (if (or (eq (extent-face extent) 'whitespace-blank-face)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
313 (eq (extent-face extent) 'whitespace-tab-face)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
314 (extent-property extent
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
315 'whitespace-highlighted-region))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
316 (progn
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
317 (delete-extent extent)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
318 nil)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
319 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
320 start
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
321 end
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
322 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
323 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
324
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
325 (defun whitespace-dehighlight-buffer ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
326 "Dehighlights the whitespaces in the current buffer."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
327 (whitespace-dehighlight-region (point-min) (point-max))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
328 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
329
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
330 (defun whitespace-highlight-after-change-function (beg end old-len)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
331 "Called, when any modification is made to buffer text. Highlights
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
332 the whitespaces (blanks and tabs) in the region from BEG to
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
333 END. OLD-LEN isn't used, but provided from the after-change hook."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
334 (if (or (eq beg end)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
335 (null whitespace-mode))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
336 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
337 (whitespace-dehighlight-region beg end)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
338 (whitespace-highlight-region beg end)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
339
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
340 (defvar whitespace-mode nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
341 "Non-nil, if the `whitespace-mode' is active.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
342
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
343 (make-variable-buffer-local 'whitespace-mode)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
344
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
345 (defun whitespace-mode (&optional arg)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
346 "Toggle whitespace mode.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
347 With arg, turn whitespace mode on iff arg is positive.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
348 In whitespace mode the different whitespaces (tab and blank)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
349 are highlighted with different faces. The faces are:
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
350 `whitespace-blank-face' and `whitespace-tab-face'.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
351 Use the command `whitespace-show-faces' to show their values."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
352 (interactive "P")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
353 (setq whitespace-mode
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
354 (if (null arg) (not whitespace-mode)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
355 (> (prefix-numeric-value arg) 0)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
356 (if (and whitespace-mode whitespace-incremental-mode)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
357 (progn
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
358 (whitespace-incremental-highlight (point-min) (point-max))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
359 (setq whitespace-incremental-mode nil)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
360 (remove-hook 'post-command-hook 'whitespace-highlight-window)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
361 (run-hooks 'whitespace-mode-hook)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
362 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
363 (setq whitespace-incremental-mode nil)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
364 (remove-hook 'post-command-hook 'whitespace-highlight-window)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
365 (redraw-modeline) ;(force-mode-line-update)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
366 (if whitespace-mode
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
367 (progn
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
368 (whitespace-highlight-buffer)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
369 (make-local-variable 'after-change-functions)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
370 (add-hook 'after-change-functions
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
371 'whitespace-highlight-after-change-function)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
372 (run-hooks 'whitespace-mode-hook))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
373 (whitespace-dehighlight-buffer)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
374 (remove-hook 'after-change-functions
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
375 'whitespace-highlight-after-change-function)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
376 (remove-hook 'post-command-hook 'whitespace-highlight-window)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
377 )))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
378
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
379 (defvar whitespace-incremental-mode nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
380 "Non-nil, if the `whitespace-incremental-mode' is active.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
381
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
382 (make-variable-buffer-local 'whitespace-incremental-mode)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
383
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
384 (defun whitespace-incremental-mode (&optional arg)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
385 "Toggle whitespace incremental mode.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
386 With arg, turn whitespace incremental mode on iff arg is positive.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
387 In whitespace incremental mode the different whitespaces (tab and blank)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
388 are highlighted with different faces. The faces are:
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
389 `whitespace-blank-face' and `whitespace-tab-face'.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
390 Use the command `whitespace-show-faces' to show their values.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
391 In this mode only these tabs and blanks are highlighted, which are in
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
392 the region from (point) - (window-heigh) to (point) + (window-heigh)."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
393 (interactive "P")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
394 (setq whitespace-incremental-mode
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
395 (if (null arg) (not whitespace-incremental-mode)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
396 (> (prefix-numeric-value arg) 0)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
397 (if (and whitespace-mode whitespace-incremental-mode)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
398 (set-extent-property (make-extent (point-min) (point-max))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
399 'whitespace-highlighted-region
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
400 t))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
401 (setq whitespace-mode nil)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
402 (redraw-modeline) ;(force-mode-line-update)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
403 ;(set-buffer-modified-p (buffer-modified-p)) ;No-op, but updates mode line.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
404 (if whitespace-incremental-mode
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
405 (progn
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
406 (whitespace-highlight-window)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
407 (make-local-variable 'post-command-hook)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
408 (add-hook 'post-command-hook 'whitespace-highlight-window)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
409 (make-local-variable 'after-change-functions)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
410 (add-hook 'after-change-functions
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
411 'whitespace-highlight-after-change-function)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
412 (run-hooks 'whitespace-incremental-mode-hook))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
413 (whitespace-dehighlight-buffer)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
414 (remove-hook 'after-change-functions
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
415 'whitespace-highlight-after-change-function)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
416 (remove-hook 'post-command-hook 'whitespace-highlight-window)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
417 ))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
418
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
419
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
420 ;;; Add whitespace-mode and whitespace-incremental-mode to the minor-mode-alist
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
421
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
422 (or (assq 'whitespace-mode minor-mode-alist)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
423 (setq minor-mode-alist
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
424 (cons '(whitespace-mode " WSP") minor-mode-alist)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
425
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
426 (or (assq 'whitespace-incremental-mode minor-mode-alist)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
427 (setq minor-mode-alist
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
428 (cons '(whitespace-incremental-mode " WSPI") minor-mode-alist)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
429
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
430
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
431 ;;; Menu for the whitespace mode
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
432
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
433 (defun whitespace-set-whitespace-chars (new-whitespace-chars)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
434 "Sets the variable `whitespace-chars' and activates the change."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
435 (interactive (list (read (completing-read "Whitespaces to highlight: "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
436 '(("tabs-and-blanks")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
437 ("tabs")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
438 ("blanks"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
439 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
440 t
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
441 (symbol-name 'whitespace-chars)))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
442 (if (eq whitespace-chars new-whitespace-chars)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
443 nil ; nothing to do
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
444 (setq whitespace-chars new-whitespace-chars)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
445 (setq-default whitespace-chars new-whitespace-chars)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
446 (cond (whitespace-mode (whitespace-mode)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
447 (whitespace-mode))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
448 (whitespace-incremental-mode (whitespace-incremental-mode)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
449 (whitespace-incremental-mode))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
450 )))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
451
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
452 (defvar whitespace-menu nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
453 "A menu for the whitespace minor mode.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
454
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
455 (setq whitespace-menu
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
456 '("Whitespace Menu"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
457 ["Highlight Whitespaces"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
458 whitespace-mode
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
459 :style toggle
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
460 :selected whitespace-mode]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
461 ["Incremental Highlighting"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
462 whitespace-incremental-mode
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
463 :style toggle
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
464 :selected whitespace-incremental-mode
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
465 ]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
466 "---"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
467 ["Show Whitespace Faces" whitespace-show-faces t]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
468 "---"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
469 ["Highlight Tabs & Blanks"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
470 (whitespace-set-whitespace-chars 'tabs-and-blanks)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
471 :style radio
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
472 :selected (eq whitespace-chars 'tabs-and-blanks)]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
473 ["Highlight Only Tabs"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
474 (whitespace-set-whitespace-chars 'tabs)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
475 :style radio
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
476 :selected (eq whitespace-chars 'tabs)]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
477 ["Highlight Only Blanks"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
478 (whitespace-set-whitespace-chars 'blanks)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
479 :style radio
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
480 :selected (eq whitespace-chars 'blanks)]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
481 ))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
482
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
483 (if (and (boundp 'whitespace-install-submenu) whitespace-install-submenu)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
484 (add-submenu '("Apps") whitespace-menu))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
485
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
486 ;;; Toolbar icon for the XEmacs
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
487
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
488 (if (featurep 'toolbar)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
489
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
490 (defvar toolbar-wspace-icon
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
491 (toolbar-make-button-list
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
492 "/* XPM */
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
493 static char * whitespace[] = {
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
494 \"28 28 4 1\",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
495 \" c Gray75 s backgroundToolBarColor\",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
496 \". c black\",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
497 \"X c Gray60\",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
498 \"o c white\",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
499 \" \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
500 \" \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
501 \" \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
502 \" \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
503 \" .. . \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
504 \" XXX.XXXXXX . \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
505 \" Xoo.oooooXX . \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
506 \" .. .. ..o.o..oo..X... .. \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
507 \" . . X.o..o.ooX. X. . . \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
508 \" . . .oo.oo.ooX.XX. .... \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
509 \" ... .oo.oo.ooo.oo. . \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
510 \" . .Xoo.oo.ooo.oo. . . \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
511 \" . .Xo...o..o...o.. .. \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
512 \" XooooooooooooX \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
513 \" XooooooooooooX \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
514 \" .... ....ooo...ooo... .. \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
515 \" . . .oo.o.oo.oo.oX. . . \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
516 \" . .oo.ooo..oo.oX .... \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
517 \" .. .oo.o..o.oo.oX . \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
518 \" . . .oo.o.oo.oo.oX. . . \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
519 \" .... ...oo.....oo.. .. \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
520 \" .ooooooooooooX \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
521 \" .XXXXXXXXXXXXX \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
522 \" . \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
523 \" ... \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
524 \" \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
525 \" \",
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
526 \" \"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
527 };")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
528 "A whitespace icon.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
529 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
530
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
531 (defun whitespace-toolbar-function ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
532 "Calls the function determined by `whitespace-toolbar-function'."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
533 (interactive)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
534 (call-interactively whitespace-toolbar-function))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
535
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
536 (if (and (adapt-xemacsp)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
537 whitespace-install-toolbar-icon
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
538 (featurep 'toolbar)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
539 (eq (device-type (selected-device)) 'x))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
540 (add-spec-list-to-specifier
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
541 default-toolbar
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
542 '((global
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
543 (nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
544 [toolbar-file-icon find-file t "Open a file" ]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
545 [toolbar-folder-icon dired t "View directory"]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
546 [toolbar-disk-icon save-buffer t "Save buffer" ]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
547 [toolbar-printer-icon print-buffer t "Print buffer" ]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
548 [toolbar-cut-icon x-kill-primary-selection t "Kill region"]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
549 [toolbar-copy-icon x-copy-primary-selection t "Copy region"]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
550 [toolbar-paste-icon
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
551 x-yank-clipboard-selection t "Paste from clipboard"]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
552 [toolbar-undo-icon undo t "Undo edit" ]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
553 [toolbar-replace-icon query-replace t "Replace text" ]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
554 [toolbar-wspace-icon
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
555 whitespace-toolbar-function t "Toggle whitespace mode"]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
556 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
557 [toolbar-compile-icon toolbar-compile t "Compile" ]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
558 [toolbar-debug-icon toolbar-debug t "Debug" ]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
559 [toolbar-spell-icon toolbar-ispell t "Spellcheck" ]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
560 [toolbar-mail-icon toolbar-mail t "Mail" ]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
561 [toolbar-news-icon toolbar-news t "News" ]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
562 [toolbar-info-icon toolbar-info t "Information" ]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
563 )))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
564
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
565 ;;; whitespace-mode.el ends here