Mercurial > emacs
annotate lisp/blank-mode.el @ 88018:4e0d27f39575
*** empty log message ***
author | Thien-Thi Nguyen <ttn@gnuvola.org> |
---|---|
date | Sun, 27 Jan 2008 11:06:45 +0000 |
parents | 1b9cb6c86c8c |
children | c3209403990d |
rev | line source |
---|---|
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1 ;;; blank-mode.el --- minor mode to visualize TAB, (HARD) SPACE, NEWLINE |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
2 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
3 ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
4 ;; Free Software Foundation, Inc. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
5 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
6 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
7 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
8 ;; Keywords: data, wp |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
9 ;; Version: 9.1 |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
10 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
11 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
12 ;; This file is part of GNU Emacs. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
13 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
14 ;; GNU Emacs is free software; you can redistribute it and/or modify |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
15 ;; it under the terms of the GNU General Public License as published |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
16 ;; by the Free Software Foundation; either version 3, or (at your |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
17 ;; option) any later version. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
18 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
19 ;; GNU Emacs is distributed in the hope that it will be useful, but |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
20 ;; WITHOUT ANY WARRANTY; without even the implied warranty of |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
22 ;; General Public License for more details. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
23 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
24 ;; You should have received a copy of the GNU General Public License |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
26 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
27 ;; Boston, MA 02110-1301, USA. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
28 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
29 ;;; Commentary: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
30 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
31 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
32 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
33 ;; Introduction |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
34 ;; ------------ |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
35 ;; |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
36 ;; This package is a minor mode to visualize blanks (TAB, (HARD) SPACE |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
37 ;; and NEWLINE). |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
38 ;; |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
39 ;; blank-mode uses two ways to visualize blanks: faces and display |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
40 ;; table. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
41 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
42 ;; * Faces are used to highlight the background with a color. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
43 ;; blank-mode uses font-lock to highlight blank characters. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
44 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
45 ;; * Display table changes the way a character is displayed, that is, |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
46 ;; it provides a visual mark for characters, for example, at the end |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
47 ;; of line (?\xB6), at SPACEs (?\xB7) and at TABs (?\xBB). |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
48 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
49 ;; The `blank-style' and `blank-chars' variables are used to select |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
50 ;; which way should be used to visualize blanks. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
51 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
52 ;; Note that when blank-mode is turned on, blank-mode saves the |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
53 ;; font-lock state, that is, if font-lock is on or off. And |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
54 ;; blank-mode restores the font-lock state when it is turned off. So, |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
55 ;; if blank-mode is turned on and font-lock is off, blank-mode also |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
56 ;; turns on the font-lock to highlight blanks, but the font-lock will |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
57 ;; be turned off when blank-mode is turned off. Thus, turn on |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
58 ;; font-lock before blank-mode is on, if you want that font-lock |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
59 ;; continues on after blank-mode is turned off. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
60 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
61 ;; When blank-mode is on, it takes care of highlighting some special |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
62 ;; characters over the default mechanism of `nobreak-char-display' |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
63 ;; (which see) and `show-trailing-whitespace' (which see). |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
64 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
65 ;; There are two ways of using blank-mode: local and global. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
66 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
67 ;; * Local blank-mode affects only the current buffer. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
68 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
69 ;; * Global blank-mode affects all current and future buffers. That |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
70 ;; is, if you turn on global blank-mode and then create a new |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
71 ;; buffer, the new buffer will also have blank-mode on. The |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
72 ;; `blank-global-modes' variable controls which major-mode will be |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
73 ;; automagically turned on. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
74 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
75 ;; You can mix the local and global usage without any conflict. But |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
76 ;; local blank-mode has priority over global blank-mode. Blank mode |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
77 ;; is active in a buffer if you have enabled it in that buffer or if |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
78 ;; you have enabled it globally. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
79 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
80 ;; When global and local blank-mode are on: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
81 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
82 ;; * if local blank-mode is turned off, blank-mode is turned off for |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
83 ;; the current buffer only. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
84 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
85 ;; * if global blank-mode is turned off, blank-mode continues on only |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
86 ;; in the buffers in which local blank-mode is on. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
87 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
88 ;; To use blank-mode, insert in your ~/.emacs: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
89 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
90 ;; (require 'blank-mode) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
91 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
92 ;; Or autoload at least one of the commands`blank-mode', |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
93 ;; `blank-toggle-options', `global-blank-mode' or |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
94 ;; `global-blank-toggle-options'. For example: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
95 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
96 ;; (autoload 'blank-mode "blank-mode" |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
97 ;; "Toggle blank visualization." t) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
98 ;; (autoload 'blank-toggle-options "blank-mode" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
99 ;; "Toggle local `blank-mode' options." t) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
100 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
101 ;; blank-mode was inspired by: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
102 ;; |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
103 ;; whitespace.el Rajesh Vaidheeswarran <rv@gnu.org> |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
104 ;; Warn about and clean bogus whitespaces in the file |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
105 ;; (inspired the idea to warn and clean some blanks) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
106 ;; |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
107 ;; show-whitespace-mode.el Aurelien Tisne <aurelien.tisne@free.fr> |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
108 ;; Simple mode to highlight whitespaces |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
109 ;; (inspired the idea to use font-lock) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
110 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
111 ;; whitespace-mode.el Lawrence Mitchell <wence@gmx.li> |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
112 ;; Major mode for editing Whitespace |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
113 ;; (inspired the idea to use display table) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
114 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
115 ;; visws.el Miles Bader <miles@gnu.org> |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
116 ;; Make whitespace visible |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
117 ;; (handle display table, his code was modified, but the main |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
118 ;; idea was kept) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
119 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
120 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
121 ;; Using blank-mode |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
122 ;; ---------------- |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
123 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
124 ;; There is no problem if you mix local and global minor mode usage. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
125 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
126 ;; * LOCAL blank-mode: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
127 ;; + To toggle blank-mode options locally, type: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
128 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
129 ;; M-x blank-toggle-options RET |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
130 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
131 ;; + To activate blank-mode locally, type: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
132 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
133 ;; C-u 1 M-x blank-mode RET |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
134 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
135 ;; + To deactivate blank-mode locally, type: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
136 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
137 ;; C-u 0 M-x blank-mode RET |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
138 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
139 ;; + To toggle blank-mode locally, type: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
140 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
141 ;; M-x blank-mode RET |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
142 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
143 ;; * GLOBAL blank-mode: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
144 ;; + To toggle blank-mode options globally, type: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
145 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
146 ;; M-x global-blank-toggle-options RET |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
147 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
148 ;; + To activate blank-mode globally, type: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
149 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
150 ;; C-u 1 M-x global-blank-mode RET |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
151 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
152 ;; + To deactivate blank-mode globally, type: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
153 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
154 ;; C-u 0 M-x global-blank-mode RET |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
155 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
156 ;; + To toggle blank-mode globally, type: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
157 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
158 ;; M-x global-blank-mode RET |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
159 ;; |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
160 ;; There are also the following useful commands: |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
161 ;; |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
162 ;; `blank-cleanup' |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
163 ;; Cleanup some blank problems in all buffer or at region. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
164 ;; |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
165 ;; `blank-cleanup-region' |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
166 ;; Cleanup some blank problems at region. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
167 ;; |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
168 ;; The problems, which are cleaned up, are: |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
169 ;; |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
170 ;; 1. empty lines at beginning of buffer. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
171 ;; 2. empty lines at end of buffer. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
172 ;; If `blank-chars' has `empty' as an element, remove all empty |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
173 ;; lines at beginning and/or end of buffer. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
174 ;; |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
175 ;; 3. 8 or more SPACEs at beginning of line. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
176 ;; If `blank-chars' has `indentation' as an element, replace 8 or |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
177 ;; more SPACEs at beginning of line by TABs. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
178 ;; |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
179 ;; 4. SPACEs before TAB. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
180 ;; If `blank-chars' has `space-before-tab' as an element, replace |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
181 ;; SPACEs by TABs. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
182 ;; |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
183 ;; 5. SPACEs or TABs at end of line. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
184 ;; If `blank-chars' has `trailing' as an element, remove all |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
185 ;; SPACEs or TABs at end of line." |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
186 ;; |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
187 ;; 6. 8 or more SPACEs after TAB. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
188 ;; If `blank-chars' has `space-after-tab' as an element, replace |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
189 ;; SPACEs by TABs. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
190 ;; |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
191 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
192 ;; Hooks |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
193 ;; ----- |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
194 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
195 ;; blank-mode has the following hook variables: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
196 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
197 ;; `blank-mode-hook' |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
198 ;; It is evaluated always when blank-mode is turned on locally. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
199 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
200 ;; `global-blank-mode-hook' |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
201 ;; It is evaluated always when blank-mode is turned on globally. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
202 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
203 ;; `blank-load-hook' |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
204 ;; It is evaluated after blank-mode package is loaded. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
205 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
206 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
207 ;; Options |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
208 ;; ------- |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
209 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
210 ;; Below it's shown a brief description of blank-mode options, please, |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
211 ;; see the options declaration in the code for a long documentation. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
212 ;; |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
213 ;; `blank-style' Specify the visualization style. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
214 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
215 ;; `blank-chars' Specify which kind of blank is |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
216 ;; visualized. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
217 ;; |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
218 ;; `blank-space' Face used to visualize SPACE. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
219 ;; |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
220 ;; `blank-hspace' Face used to visualize HARD SPACE. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
221 ;; |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
222 ;; `blank-tab' Face used to visualize TAB. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
223 ;; |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
224 ;; `blank-newline' Face used to visualize NEWLINE char |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
225 ;; mapping. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
226 ;; |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
227 ;; `blank-trailing' Face used to visualize trailing |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
228 ;; blanks. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
229 ;; |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
230 ;; `blank-line' Face used to visualize "long" lines. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
231 ;; |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
232 ;; `blank-space-before-tab' Face used to visualize SPACEs before |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
233 ;; TAB. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
234 ;; |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
235 ;; `blank-indentation' Face used to visualize 8 or more |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
236 ;; SPACEs at beginning of line. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
237 ;; |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
238 ;; `blank-empty' Face used to visualize empty lines at |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
239 ;; beginning and/or end of buffer. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
240 ;; |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
241 ;; `blank-space-after-tab' Face used to visualize 8 or more |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
242 ;; SPACEs after TAB. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
243 ;; |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
244 ;; `blank-space-regexp' Specify SPACE characters regexp. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
245 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
246 ;; `blank-hspace-regexp' Specify HARD SPACE characters regexp. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
247 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
248 ;; `blank-tab-regexp' Specify TAB characters regexp. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
249 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
250 ;; `blank-trailing-regexp' Specify trailing characters regexp. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
251 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
252 ;; `blank-space-before-tab-regexp' Specify SPACEs before TAB |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
253 ;; regexp. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
254 ;; |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
255 ;; `blank-indentation-regexp' Specify regexp for 8 or more SPACEs at |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
256 ;; beginning of line. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
257 ;; |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
258 ;; `blank-empty-at-bob-regexp' Specify regexp for empty lines at |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
259 ;; beginning of buffer. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
260 ;; |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
261 ;; `blank-empty-at-eob-regexp' Specify regexp for empty lines at end |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
262 ;; of buffer. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
263 ;; |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
264 ;; `blank-space-after-tab-regexp' Specify regexp for 8 or more |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
265 ;; SPACEs after TAB. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
266 ;; |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
267 ;; `blank-line-column' Specify column beyond which the line |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
268 ;; is highlighted. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
269 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
270 ;; `blank-display-mappings' Specify an alist of mappings for |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
271 ;; displaying characters. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
272 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
273 ;; `blank-global-modes' Modes for which global `blank-mode' is |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
274 ;; automagically turned on. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
275 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
276 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
277 ;; Acknowledgements |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
278 ;; ---------------- |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
279 ;; |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
280 ;; Thanks to nschum (EmacsWiki) for the idea about highlight "long" |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
281 ;; lines tail. See EightyColumnRule (EmacsWiki). |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
282 ;; |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
283 ;; Thanks to Juri Linkov <juri@jurta.org> for suggesting: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
284 ;; * `define-minor-mode'. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
285 ;; * `global-blank-*' name for global commands. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
286 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
287 ;; Thanks to Robert J. Chassell <bob@gnu.org> for doc fix and testing. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
288 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
289 ;; Thanks to Drew Adams <drew.adams@oracle.com> for toggle commands |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
290 ;; suggestion. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
291 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
292 ;; Thanks to Antti Kaihola <antti.kaihola@linux-aktivaattori.org> for |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
293 ;; helping to fix `find-file-hooks' reference. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
294 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
295 ;; Thanks to Andreas Roehler <andreas.roehler@easy-emacs.de> for |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
296 ;; indicating defface byte-compilation warnings. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
297 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
298 ;; Thanks to TimOCallaghan (EmacsWiki) for the idea about highlight |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
299 ;; "long" lines. See EightyColumnRule (EmacsWiki). |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
300 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
301 ;; Thanks to Yanghui Bian <yanghuibian@gmail.com> for indicating a new |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
302 ;; newline character mapping. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
303 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
304 ;; Thanks to Pete Forman <pete.forman@westgeo.com> for indicating |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
305 ;; whitespace-mode on XEmacs. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
306 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
307 ;; Thanks to Miles Bader <miles@gnu.org> for handling display table via |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
308 ;; visws.el (his code was modified, but the main idea was kept). |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
309 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
310 ;; Thanks to: |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
311 ;; Rajesh Vaidheeswarran <rv@gnu.org> whitespace.el |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
312 ;; Aurelien Tisne <aurelien.tisne@free.fr> show-whitespace-mode.el |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
313 ;; Lawrence Mitchell <wence@gmx.li> whitespace-mode.el |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
314 ;; Miles Bader <miles@gnu.org> visws.el |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
315 ;; And to all people who contributed with them. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
316 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
317 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
318 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
319 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
320 ;;; code: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
321 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
322 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
323 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
324 ;;;; User Variables: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
325 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
326 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
327 ;;; Interface to the command system |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
328 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
329 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
330 (defgroup blank nil |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
331 "Visualize blanks (TAB, (HARD) SPACE and NEWLINE)." |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
332 :link '(emacs-library-link :tag "Source Lisp File" "blank-mode.el") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
333 :version "22.2" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
334 :group 'wp |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
335 :group 'data) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
336 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
337 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
338 (defcustom blank-style '(mark color) |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
339 "*Specify the visualization style. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
340 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
341 It's a list which element value can be: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
342 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
343 mark display mappings are visualized. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
344 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
345 color faces are visualized. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
346 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
347 Any other value is ignored. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
348 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
349 If nil, don't visualize TABs, (HARD) SPACEs and NEWLINEs. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
350 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
351 See also `blank-display-mappings' for documentation." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
352 :type '(repeat :tag "Style of Blank" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
353 (choice :tag "Style of Blank" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
354 (const :tag "Display Table" mark) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
355 (const :tag "Faces" color))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
356 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
357 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
358 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
359 (defcustom blank-chars |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
360 '(tabs spaces trailing lines space-before-tab newline |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
361 indentation empty space-after-tab) |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
362 "*Specify which kind of blank is visualized. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
363 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
364 It's a list which element value can be: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
365 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
366 trailing trailing blanks are visualized. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
367 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
368 tabs TABs are visualized. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
369 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
370 spaces SPACEs and HARD SPACEs are visualized. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
371 |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
372 lines lines whose have columns beyond |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
373 `blank-line-column' are highlighted. |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
374 Whole line is highlighted. |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
375 It has precedence over |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
376 `lines-tail' (see below). |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
377 |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
378 lines-tail lines whose have columns beyond |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
379 `blank-line-column' are highlighted. |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
380 But only the part of line which goes |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
381 beyond `blank-line-column' column. |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
382 It has effect only if `lines' (see above) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
383 is not present in `blank-chars'. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
384 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
385 space-before-tab SPACEs before TAB are visualized. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
386 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
387 newline NEWLINEs are visualized. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
388 |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
389 indentation 8 or more SPACEs at beginning of line are |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
390 visualized. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
391 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
392 empty empty lines at beginning and/or end of buffer |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
393 are visualized. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
394 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
395 space-after-tab 8 or more SPACEs after a TAB are visualized. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
396 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
397 Any other value is ignored. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
398 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
399 If nil, don't visualize TABs, (HARD) SPACEs and NEWLINEs. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
400 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
401 Used when `blank-style' has `color' as an element. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
402 If `blank-chars' has `newline' as an element, used when `blank-style' |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
403 has `mark' as an element." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
404 :type '(repeat :tag "Kind of Blank" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
405 (choice :tag "Kind of Blank" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
406 (const :tag "Trailing TABs, SPACEs and HARD SPACEs" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
407 trailing) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
408 (const :tag "SPACEs and HARD SPACEs" spaces) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
409 (const :tag "TABs" tabs) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
410 (const :tag "Lines" lines) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
411 (const :tag "SPACEs before TAB" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
412 space-before-tab) |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
413 (const :tag "NEWLINEs" newline) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
414 (const :tag "Indentation SPACEs" indentation) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
415 (const :tag "Empty Lines At BOB And/Or EOB" |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
416 empty) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
417 (const :tag "SPACEs after TAB" |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
418 space-after-tab))) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
419 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
420 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
421 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
422 (defcustom blank-space 'blank-space |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
423 "*Symbol face used to visualize SPACE. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
424 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
425 Used when `blank-style' has `color' as an element." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
426 :type 'face |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
427 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
428 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
429 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
430 (defface blank-space |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
431 '((((class color) (background dark)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
432 (:background "grey20" :foreground "aquamarine3")) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
433 (((class color) (background light)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
434 (:background "LightYellow" :foreground "aquamarine3")) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
435 (t (:inverse-video t))) |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
436 "Face used to visualize SPACE." |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
437 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
438 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
439 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
440 (defcustom blank-hspace 'blank-hspace |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
441 "*Symbol face used to visualize HARD SPACE. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
442 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
443 Used when `blank-style' has `color' as an element." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
444 :type 'face |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
445 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
446 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
447 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
448 (defface blank-hspace ; 'nobreak-space |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
449 '((((class color) (background dark)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
450 (:background "grey24" :foreground "aquamarine3")) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
451 (((class color) (background light)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
452 (:background "LemonChiffon3" :foreground "aquamarine3")) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
453 (t (:inverse-video t))) |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
454 "Face used to visualize HARD SPACE." |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
455 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
456 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
457 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
458 (defcustom blank-tab 'blank-tab |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
459 "*Symbol face used to visualize TAB. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
460 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
461 Used when `blank-style' has `color' as an element." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
462 :type 'face |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
463 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
464 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
465 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
466 (defface blank-tab |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
467 '((((class color) (background dark)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
468 (:background "grey22" :foreground "aquamarine3")) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
469 (((class color) (background light)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
470 (:background "beige" :foreground "aquamarine3")) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
471 (t (:inverse-video t))) |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
472 "Face used to visualize TAB." |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
473 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
474 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
475 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
476 (defcustom blank-newline 'blank-newline |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
477 "*Symbol face used to visualize NEWLINE char mapping. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
478 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
479 See `blank-display-mappings'. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
480 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
481 Used when `blank-style' has `mark' and `color' as elements |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
482 and `blank-chars' has `newline' as an element." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
483 :type 'face |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
484 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
485 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
486 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
487 (defface blank-newline |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
488 '((((class color) (background dark)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
489 (:background "grey26" :foreground "aquamarine3" :bold t)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
490 (((class color) (background light)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
491 (:background "linen" :foreground "aquamarine3" :bold t)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
492 (t (:bold t :underline t))) |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
493 "Face used to visualize NEWLINE char mapping. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
494 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
495 See `blank-display-mappings'." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
496 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
497 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
498 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
499 (defcustom blank-trailing 'blank-trailing |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
500 "*Symbol face used to visualize traling blanks. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
501 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
502 Used when `blank-style' has `color' as an element." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
503 :type 'face |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
504 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
505 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
506 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
507 (defface blank-trailing ; 'trailing-whitespace |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
508 '((((class mono)) (:inverse-video t :bold t :underline t)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
509 (t (:background "red1" :foreground "yellow" :bold t))) |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
510 "Face used to visualize trailing blanks." |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
511 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
512 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
513 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
514 (defcustom blank-line 'blank-line |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
515 "*Symbol face used to visualize \"long\" lines. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
516 |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
517 See `blank-line-column'. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
518 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
519 Used when `blank-style' has `color' as an element." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
520 :type 'face |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
521 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
522 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
523 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
524 (defface blank-line |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
525 '((((class mono)) (:inverse-video t :bold t :underline t)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
526 (t (:background "gray20" :foreground "violet"))) |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
527 "Face used to visualize \"long\" lines. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
528 |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
529 See `blank-line-column'." |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
530 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
531 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
532 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
533 (defcustom blank-space-before-tab 'blank-space-before-tab |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
534 "*Symbol face used to visualize SPACEs before TAB. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
535 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
536 Used when `blank-style' has `color' as an element." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
537 :type 'face |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
538 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
539 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
540 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
541 (defface blank-space-before-tab |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
542 '((((class mono)) (:inverse-video t :bold t :underline t)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
543 (t (:background "DarkOrange" :foreground "firebrick"))) |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
544 "Face used to visualize SPACEs before TAB." |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
545 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
546 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
547 |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
548 (defcustom blank-indentation 'blank-indentation |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
549 "*Symbol face used to visualize 8 or more SPACEs at beginning of line. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
550 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
551 Used when `blank-style' has `color' as an element." |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
552 :type 'face |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
553 :group 'blank) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
554 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
555 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
556 (defface blank-indentation |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
557 '((((class mono)) (:inverse-video t :bold t :underline t)) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
558 (t (:background "yellow" :foreground "firebrick"))) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
559 "Face used to visualize 8 or more SPACEs at beginning of line." |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
560 :group 'blank) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
561 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
562 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
563 (defcustom blank-empty 'blank-empty |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
564 "*Symbol face used to visualize empty lines at beginning and/or end of buffer. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
565 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
566 Used when `blank-style' has `color' as an element." |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
567 :type 'face |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
568 :group 'blank) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
569 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
570 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
571 (defface blank-empty |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
572 '((((class mono)) (:inverse-video t :bold t :underline t)) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
573 (t (:background "yellow" :foreground "firebrick"))) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
574 "Face used to visualize empty lines at beginning and/or end of buffer." |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
575 :group 'blank) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
576 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
577 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
578 (defcustom blank-space-after-tab 'blank-space-after-tab |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
579 "*Symbol face used to visualize 8 or more SPACEs after TAB. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
580 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
581 Used when `blank-style' has `color' as an element." |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
582 :type 'face |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
583 :group 'blank) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
584 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
585 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
586 (defface blank-space-after-tab |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
587 '((((class mono)) (:inverse-video t :bold t :underline t)) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
588 (t (:background "yellow" :foreground "firebrick"))) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
589 "Face used to visualize 8 or more SPACEs after TAB." |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
590 :group 'blank) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
591 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
592 |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
593 (defcustom blank-hspace-regexp |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
594 "\\(\\(\xA0\\|\x8A0\\|\x920\\|\xE20\\|\xF20\\)+\\)" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
595 "*Specify HARD SPACE characters regexp. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
596 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
597 If you're using `mule' package, it may exist other characters besides: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
598 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
599 \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \"\\xF20\" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
600 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
601 that should be considered HARD SPACE. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
602 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
603 Here are some examples: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
604 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
605 \"\\\\(^\\xA0+\\\\)\" \ |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
606 visualize only leading HARD SPACEs. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
607 \"\\\\(\\xA0+$\\\\)\" \ |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
608 visualize only trailing HARD SPACEs. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
609 \"\\\\(^\\xA0+\\\\|\\xA0+$\\\\)\" \ |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
610 visualize leading and/or trailing HARD SPACEs. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
611 \"\\t\\\\(\\xA0+\\\\)\\t\" \ |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
612 visualize only HARD SPACEs between TABs. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
613 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
614 NOTE: Enclose always by \\\\( and \\\\) the elements to highlight. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
615 Use exactly one pair of enclosing \\\\( and \\\\). |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
616 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
617 Used when `blank-style' has `color' as an element, and |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
618 `blank-chars' has `spaces' as an element." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
619 :type '(regexp :tag "HARD SPACE Chars") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
620 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
621 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
622 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
623 (defcustom blank-space-regexp "\\( +\\)" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
624 "*Specify SPACE characters regexp. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
625 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
626 If you're using `mule' package, it may exist other characters |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
627 besides \" \" that should be considered SPACE. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
628 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
629 Here are some examples: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
630 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
631 \"\\\\(^ +\\\\)\" visualize only leading SPACEs. |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
632 \"\\\\( +$\\\\)\" visualize only trailing SPACEs. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
633 \"\\\\(^ +\\\\| +$\\\\)\" \ |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
634 visualize leading and/or trailing SPACEs. |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
635 \"\\t\\\\( +\\\\)\\t\" visualize only SPACEs between TABs. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
636 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
637 NOTE: Enclose always by \\\\( and \\\\) the elements to highlight. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
638 Use exactly one pair of enclosing \\\\( and \\\\). |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
639 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
640 Used when `blank-style' has `color' as an element, and |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
641 `blank-chars' has `spaces' as an element." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
642 :type '(regexp :tag "SPACE Chars") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
643 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
644 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
645 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
646 (defcustom blank-tab-regexp "\\(\t+\\)" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
647 "*Specify TAB characters regexp. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
648 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
649 If you're using `mule' package, it may exist other characters |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
650 besides \"\\t\" that should be considered TAB. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
651 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
652 Here are some examples: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
653 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
654 \"\\\\(^\\t+\\\\)\" visualize only leading TABs. |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
655 \"\\\\(\\t+$\\\\)\" visualize only trailing TABs. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
656 \"\\\\(^\\t+\\\\|\\t+$\\\\)\" \ |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
657 visualize leading and/or trailing TABs. |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
658 \" \\\\(\\t+\\\\) \" visualize only TABs between SPACEs. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
659 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
660 NOTE: Enclose always by \\\\( and \\\\) the elements to highlight. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
661 Use exactly one pair of enclosing \\\\( and \\\\). |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
662 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
663 Used when `blank-style' has `color' as an element, and |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
664 `blank-chars' has `tabs' as an element." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
665 :type '(regexp :tag "TAB Chars") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
666 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
667 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
668 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
669 (defcustom blank-trailing-regexp |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
670 "\t\\| \\|\xA0\\|\x8A0\\|\x920\\|\xE20\\|\xF20" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
671 "*Specify trailing characters regexp. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
672 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
673 If you're using `mule' package, it may exist other characters besides: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
674 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
675 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \ |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
676 \"\\xF20\" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
677 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
678 that should be considered blank. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
679 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
680 NOTE: DO NOT enclose by \\\\( and \\\\) the elements to highlight. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
681 `blank-mode' surrounds this regexp by \"\\\\(\\\\(\" and |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
682 \"\\\\)+\\\\)$\". |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
683 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
684 Used when `blank-style' has `color' as an element, and |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
685 `blank-chars' has `trailing' as an element." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
686 :type '(regexp :tag "Trailing Chars") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
687 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
688 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
689 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
690 (defcustom blank-space-before-tab-regexp "\\( +\\)\t" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
691 "*Specify SPACEs before TAB regexp. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
692 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
693 If you're using `mule' package, it may exist other characters besides: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
694 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
695 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \ |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
696 \"\\xF20\" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
697 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
698 that should be considered blank. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
699 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
700 Used when `blank-style' has `color' as an element, and |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
701 `blank-chars' has `space-before-tab' as an element." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
702 :type '(regexp :tag "SPACEs Before TAB") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
703 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
704 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
705 |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
706 (defcustom blank-indentation-regexp "^\t*\\(\\( \\{8\\}\\)+\\)[^\n\t]" |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
707 "*Specify regexp for 8 or more SPACEs at beginning of line. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
708 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
709 If you're using `mule' package, it may exist other characters besides: |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
710 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
711 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \ |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
712 \"\\xF20\" |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
713 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
714 that should be considered blank. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
715 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
716 Used when `blank-style' has `color' as an element, and |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
717 `blank-chars' has `indentation' as an element." |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
718 :type '(regexp :tag "Indentation SPACEs") |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
719 :group 'blank) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
720 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
721 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
722 (defcustom blank-empty-at-bob-regexp "\\`\\(\\([ \t]*\n\\)+\\)" |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
723 "*Specify regexp for empty lines at beginning of buffer. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
724 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
725 If you're using `mule' package, it may exist other characters besides: |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
726 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
727 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \ |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
728 \"\\xF20\" |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
729 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
730 that should be considered blank. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
731 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
732 Used when `blank-style' has `color' as an element, and |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
733 `blank-chars' has `empty' as an element." |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
734 :type '(regexp :tag "Empty Lines At Beginning Of Buffer") |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
735 :group 'blank) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
736 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
737 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
738 (defcustom blank-empty-at-eob-regexp "^\\([ \t\n]+\\)\\'" |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
739 "*Specify regexp for empty lines at end of buffer. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
740 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
741 If you're using `mule' package, it may exist other characters besides: |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
742 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
743 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \ |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
744 \"\\xF20\" |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
745 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
746 that should be considered blank. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
747 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
748 Used when `blank-style' has `color' as an element, and |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
749 `blank-chars' has `empty' as an element." |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
750 :type '(regexp :tag "Empty Lines At End Of Buffer") |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
751 :group 'blank) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
752 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
753 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
754 (defcustom blank-space-after-tab-regexp "\t\\(\\( \\{8\\}\\)+\\)" |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
755 "*Specify regexp for 8 or more SPACEs after TAB. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
756 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
757 If you're using `mule' package, it may exist other characters besides: |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
758 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
759 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \ |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
760 \"\\xF20\" |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
761 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
762 that should be considered blank. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
763 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
764 Used when `blank-style' has `color' as an element, and |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
765 `blank-chars' has `space-after-tab' as an element." |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
766 :type '(regexp :tag "SPACEs After TAB") |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
767 :group 'blank) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
768 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
769 |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
770 (defcustom blank-line-column 80 |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
771 "*Specify column beyond which the line is highlighted. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
772 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
773 Used when `blank-style' has `color' as an element, and |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
774 `blank-chars' has `lines' or `lines-tail' as an element." |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
775 :type '(integer :tag "Line Length") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
776 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
777 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
778 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
779 ;; Hacked from `visible-whitespace-mappings' in visws.el |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
780 (defcustom blank-display-mappings |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
781 ;; Due to limitations of glyph representation, the char code can not |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
782 ;; be above ?\x1FFFF. Probably, this will be fixed after Emacs |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
783 ;; unicode merging. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
784 '( |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
785 (?\ [?\xB7] [?.]) ; space - centered dot |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
786 (?\xA0 [?\xA4] [?_]) ; hard space - currency |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
787 (?\x8A0 [?\x8A4] [?_]) ; hard space - currency |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
788 (?\x920 [?\x924] [?_]) ; hard space - currency |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
789 (?\xE20 [?\xE24] [?_]) ; hard space - currency |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
790 (?\xF20 [?\xF24] [?_]) ; hard space - currency |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
791 ;; NEWLINE is displayed using the face `blank-newline' |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
792 (?\n [?$ ?\n]) ; end-of-line - dollar sign |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
793 ;; (?\n [?\u21B5 ?\n] [?$ ?\n]) ; end-of-line - downwards arrow |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
794 ;; (?\n [?\xB6 ?\n] [?$ ?\n]) ; end-of-line - pilcrow |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
795 ;; (?\n [?\x8AF ?\n] [?$ ?\n]) ; end-of-line - overscore |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
796 ;; (?\n [?\x8AC ?\n] [?$ ?\n]) ; end-of-line - negation |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
797 ;; (?\n [?\x8B0 ?\n] [?$ ?\n]) ; end-of-line - grade |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
798 ;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
799 ;; WARNING: the mapping below has a problem. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
800 ;; When a TAB occupies exactly one column, it will display the |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
801 ;; character ?\xBB at that column followed by a TAB which goes to |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
802 ;; the next TAB column. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
803 ;; If this is a problem for you, please, comment the line below. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
804 (?\t [?\xBB ?\t] [?\\ ?\t]) ; tab - left quote mark |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
805 ) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
806 "*Specify an alist of mappings for displaying characters. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
807 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
808 Each element has the following form: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
809 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
810 (CHAR VECTOR...) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
811 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
812 Where: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
813 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
814 CHAR is the character to be mapped. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
815 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
816 VECTOR is a vector of characters to be displayed in place of CHAR. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
817 The first display vector that can be displayed is used; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
818 if no display vector for a mapping can be displayed, then |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
819 that character is displayed unmodified. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
820 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
821 The NEWLINE character is displayed using the face given by |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
822 `blank-newline' variable. The characters in the vector to be |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
823 displayed will not have this face applied if the character code |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
824 is above #x1FFFF. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
825 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
826 Used when `blank-style' has `mark' as an element." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
827 :type '(repeat |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
828 (list :tag "Character Mapping" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
829 (character :tag "Char") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
830 (repeat :inline t :tag "Vector List" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
831 (vector :tag "" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
832 (repeat :inline t |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
833 :tag "Vector Characters" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
834 (character :tag "Char")))))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
835 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
836 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
837 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
838 (defcustom blank-global-modes t |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
839 "*Modes for which global `blank-mode' is automagically turned on. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
840 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
841 Global `blank-mode' is controlled by the command `global-blank-mode'. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
842 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
843 If nil, means no modes have `blank-mode' automatically turned on. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
844 If t, all modes that support `blank-mode' have it automatically |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
845 turned on. |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
846 Else it should be a list of `major-mode' symbol names for |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
847 which `blank-mode' should be automatically turned on. The sense |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
848 of the list is negated if it begins with `not'. For example: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
849 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
850 (c-mode c++-mode) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
851 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
852 means that `blank-mode' is turned on for buffers in C and C++ |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
853 modes only." |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
854 :type '(choice (const :tag "None" nil) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
855 (const :tag "All" t) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
856 (set :menu-tag "Mode Specific" :tag "Modes" |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
857 :value (not) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
858 (const :tag "Except" not) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
859 (repeat :inline t |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
860 (symbol :tag "Mode")))) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
861 :group 'blank) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
862 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
863 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
864 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
865 ;;;; User commands - Local mode |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
866 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
867 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
868 ;;;###autoload |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
869 (define-minor-mode blank-mode |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
870 "Toggle blank minor mode visualization (\"bl\" on modeline). |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
871 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
872 If ARG is null, toggle blank visualization. |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
873 If ARG is a number greater than zero, turn on visualization; |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
874 otherwise, turn off visualization. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
875 Only useful with a windowing system." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
876 :lighter " bl" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
877 :init-value nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
878 :global nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
879 :group 'blank |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
880 (cond |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
881 (noninteractive ; running a batch job |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
882 (setq blank-mode nil)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
883 (blank-mode ; blank-mode on |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
884 (blank-turn-on)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
885 (t ; blank-mode off |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
886 (blank-turn-off)))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
887 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
888 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
889 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
890 ;;;; User commands - Global mode |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
891 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
892 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
893 (define-minor-mode global-blank-mode |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
894 "Toggle blank global minor mode visualization (\"BL\" on modeline). |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
895 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
896 If ARG is null, toggle blank visualization. |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
897 If ARG is a number greater than zero, turn on visualization; |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
898 otherwise, turn off visualization. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
899 Only useful with a windowing system." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
900 :lighter " BL" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
901 :init-value nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
902 :global t |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
903 :group 'blank |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
904 (cond |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
905 (noninteractive ; running a batch job |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
906 (setq global-blank-mode nil)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
907 (global-blank-mode ; global-blank-mode on |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
908 (save-excursion |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
909 (if (boundp 'find-file-hook) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
910 (add-hook 'find-file-hook 'blank-turn-on-if-enabled t) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
911 (add-hook 'find-file-hooks 'blank-turn-on-if-enabled t)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
912 (dolist (buffer (buffer-list)) ; adjust all local mode |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
913 (set-buffer buffer) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
914 (unless blank-mode |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
915 (blank-turn-on-if-enabled))))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
916 (t ; global-blank-mode off |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
917 (save-excursion |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
918 (if (boundp 'find-file-hook) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
919 (remove-hook 'find-file-hook 'blank-turn-on-if-enabled) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
920 (remove-hook 'find-file-hooks 'blank-turn-on-if-enabled)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
921 (dolist (buffer (buffer-list)) ; adjust all local mode |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
922 (set-buffer buffer) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
923 (unless blank-mode |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
924 (blank-turn-off))))))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
925 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
926 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
927 (defun blank-turn-on-if-enabled () |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
928 (when (cond |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
929 ((eq blank-global-modes t)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
930 ((listp blank-global-modes) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
931 (if (eq (car-safe blank-global-modes) 'not) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
932 (not (memq major-mode (cdr blank-global-modes))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
933 (memq major-mode blank-global-modes))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
934 (t nil)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
935 (let (inhibit-quit) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
936 ;; Don't turn on blank mode if... |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
937 (or |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
938 ;; ...we don't have a display (we're running a batch job) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
939 noninteractive |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
940 ;; ...or if the buffer is invisible (name starts with a space) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
941 (eq (aref (buffer-name) 0) ?\ ) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
942 ;; ...or if the buffer is temporary (name starts with *) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
943 (and (eq (aref (buffer-name) 0) ?*) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
944 ;; except the scratch buffer. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
945 (not (string= (buffer-name) "*scratch*"))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
946 ;; Otherwise, turn on blank mode. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
947 (blank-turn-on))))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
948 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
949 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
950 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
951 ;;;; User commands - Toggle |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
952 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
953 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
954 (defconst blank-chars-value-list |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
955 '(tabs |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
956 spaces |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
957 trailing |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
958 space-before-tab |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
959 lines |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
960 lines-tail |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
961 newline |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
962 indentation |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
963 empty |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
964 space-after-tab |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
965 ) |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
966 "List of valid `blank-chars' values.") |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
967 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
968 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
969 (defconst blank-style-value-list |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
970 '(color |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
971 mark |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
972 ) |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
973 "List of valid `blank-style' values.") |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
974 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
975 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
976 (defconst blank-toggle-option-alist |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
977 '((?t . tabs) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
978 (?s . spaces) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
979 (?r . trailing) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
980 (?b . space-before-tab) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
981 (?l . lines) |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
982 (?L . lines-tail) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
983 (?n . newline) |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
984 (?i . indentation) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
985 (?e . empty) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
986 (?a . space-after-tab) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
987 (?c . color) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
988 (?m . mark) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
989 (?x . blank-chars) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
990 (?z . blank-style) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
991 ) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
992 "Alist of toggle options. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
993 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
994 Each element has the form: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
995 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
996 (CHAR . SYMBOL) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
997 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
998 Where: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
999 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1000 CHAR is a char which the user will have to type. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1001 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1002 SYMBOL is a valid symbol associated with CHAR. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1003 See `blank-chars-value-list' and `blank-style-value-list'.") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1004 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1005 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1006 (defvar blank-active-chars nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1007 "Used to save locally `blank-chars' value.") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1008 (make-variable-buffer-local 'blank-active-chars) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1009 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1010 (defvar blank-active-style nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1011 "Used to save locally `blank-style' value.") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1012 (make-variable-buffer-local 'blank-active-style) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1013 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1014 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1015 ;;;###autoload |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1016 (defun blank-toggle-options (arg) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1017 "Toggle local `blank-mode' options. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1018 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1019 If local blank-mode is off, toggle the option given by ARG and |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1020 turn on local blank-mode. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1021 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1022 If local blank-mode is on, toggle the option given by ARG and |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1023 restart local blank-mode. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1024 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1025 Interactively, it reads one of the following chars: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1026 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1027 CHAR MEANING |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1028 t toggle TAB visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1029 s toggle SPACE and HARD SPACE visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1030 r toggle trailing blanks visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1031 b toggle SPACEs before TAB visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1032 l toggle \"long lines\" visualization |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1033 L toggle \"long lines\" tail visualization |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1034 n toggle NEWLINE visualization |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1035 i toggle indentation SPACEs visualization |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1036 e toggle empty line at bob and/or eob visualization |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1037 a toggle SPACEs after TAB visualization |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1038 c toggle color faces |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1039 m toggle visual mark |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1040 x restore `blank-chars' value |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1041 z restore `blank-style' value |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1042 ? display brief help |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1043 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1044 Non-interactively, ARG should be a symbol or a list of symbols. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1045 The valid symbols are: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1046 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1047 tabs toggle TAB visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1048 spaces toggle SPACE and HARD SPACE visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1049 trailing toggle trailing blanks visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1050 space-before-tab toggle SPACEs before TAB visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1051 lines toggle \"long lines\" visualization |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1052 lines-tail toggle \"long lines\" tail visualization |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1053 newline toggle NEWLINE visualization |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1054 indentation toggle indentation SPACEs visualization |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1055 empty toggle empty line at bob and/or eob visualization |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1056 space-after-tab toggle SPACEs after TAB visualization |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1057 color toggle color faces |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1058 mark toggle visual mark |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1059 blank-chars restore `blank-chars' value |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1060 blank-style restore `blank-style' value |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1061 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1062 Only useful with a windowing system." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1063 (interactive (blank-interactive-char t)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1064 (let ((blank-chars |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1065 (blank-toggle-list t arg blank-active-chars blank-chars |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1066 'blank-chars blank-chars-value-list)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1067 (blank-style |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1068 (blank-toggle-list t arg blank-active-style blank-style |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1069 'blank-style blank-style-value-list))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1070 (blank-mode 0) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1071 (blank-mode 1))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1072 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1073 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1074 (defvar blank-toggle-chars nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1075 "Used to toggle the global `blank-chars' value.") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1076 (defvar blank-toggle-style nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1077 "Used to toggle the global `blank-style' value.") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1078 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1079 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1080 ;;;###autoload |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1081 (defun global-blank-toggle-options (arg) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1082 "Toggle global `blank-mode' options. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1083 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1084 If global blank-mode is off, toggle the option given by ARG and |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1085 turn on global blank-mode. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1086 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1087 If global blank-mode is on, toggle the option given by ARG and |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1088 restart global blank-mode. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1089 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1090 Interactively, it reads one of the following chars: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1091 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1092 CHAR MEANING |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1093 t toggle TAB visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1094 s toggle SPACE and HARD SPACE visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1095 r toggle trailing blanks visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1096 b toggle SPACEs before TAB visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1097 l toggle \"long lines\" visualization |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1098 L toggle \"long lines\" tail visualization |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1099 n toggle NEWLINE visualization |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1100 i toggle indentation SPACEs visualization |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1101 e toggle empty line at bob and/or eob visualization |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1102 a toggle SPACEs after TAB visualization |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1103 c toggle color faces |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1104 m toggle visual mark |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1105 x restore `blank-chars' value |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1106 z restore `blank-style' value |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1107 ? display brief help |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1108 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1109 Non-interactively, ARG should be a symbol or a list of symbols. |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1110 The valid symbols are: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1111 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1112 tabs toggle TAB visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1113 spaces toggle SPACE and HARD SPACE visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1114 trailing toggle trailing blanks visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1115 space-before-tab toggle SPACEs before TAB visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1116 lines toggle \"long lines\" visualization |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1117 lines-tail toggle \"long lines\" tail visualization |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1118 newline toggle NEWLINE visualization |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1119 indentation toggle indentation SPACEs visualization |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1120 empty toggle empty line at bob and/or eob visualization |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1121 space-after-tab toggle SPACEs after TAB visualization |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1122 color toggle color faces |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1123 mark toggle visual mark |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1124 blank-chars restore `blank-chars' value |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1125 blank-style restore `blank-style' value |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1126 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1127 Only useful with a windowing system." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1128 (interactive (blank-interactive-char nil)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1129 (let ((blank-chars |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1130 (blank-toggle-list nil arg blank-toggle-chars blank-chars |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1131 'blank-chars blank-chars-value-list)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1132 (blank-style |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1133 (blank-toggle-list nil arg blank-toggle-style blank-style |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1134 'blank-style blank-style-value-list))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1135 (setq blank-toggle-chars blank-chars |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1136 blank-toggle-style blank-style) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1137 (global-blank-mode 0) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1138 (global-blank-mode 1))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1139 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1140 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1141 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1142 ;;;; User commands - Cleanup |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1143 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1144 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1145 ;;;###autoload |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1146 (defun blank-cleanup () |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1147 "Cleanup some blank problems in all buffer or at region. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1148 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1149 It usually applies to the whole buffer, but in transient mark |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1150 mode when the mark is active, it applies to the region. It also |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1151 applies to the region when it is not in transiente mark mode, the |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1152 mark is active and it was pressed `C-u' just before calling |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1153 `blank-cleanup' interactively. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1154 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1155 See also `blank-cleanup-region'. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1156 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1157 The problems, which are cleaned up, are: |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1158 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1159 1. empty lines at beginning of buffer. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1160 2. empty lines at end of buffer. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1161 If `blank-chars' has `empty' as an element, remove all empty |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1162 lines at beginning and/or end of buffer. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1163 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1164 3. 8 or more SPACEs at beginning of line. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1165 If `blank-chars' has `indentation' as an element, replace 8 or |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1166 more SPACEs at beginning of line by TABs. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1167 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1168 4. SPACEs before TAB. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1169 If `blank-chars' has `space-before-tab' as an element, replace |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1170 SPACEs by TABs. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1171 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1172 5. SPACEs or TABs at end of line. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1173 If `blank-chars' has `trailing' as an element, remove all |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1174 SPACEs or TABs at end of line. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1175 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1176 6. 8 or more SPACEs after TAB. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1177 If `blank-chars' has `space-after-tab' as an element, replace |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1178 SPACEs by TABs." |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1179 (interactive "@*") |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1180 (if (and (or transient-mark-mode |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1181 current-prefix-arg) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1182 mark-active) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1183 ;; region active |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1184 ;; problems 1 and 2 are not handled in region |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1185 ;; problem 3: 8 or more SPACEs at bol |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1186 ;; problem 4: SPACEs before TAB |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1187 ;; problem 5: SPACEs or TABs at eol |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1188 ;; problem 6: 8 or more SPACEs after TAB |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1189 (blank-cleanup-region (region-beginning) (region-end)) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1190 ;; whole buffer |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1191 (save-excursion |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1192 (save-match-data |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1193 ;; problem 1: empty lines at bob |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1194 ;; problem 2: empty lines at eob |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1195 ;; action: remove all empty lines at bob and/or eob |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1196 (when (memq 'empty blank-chars) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1197 (let (overwrite-mode) ; enforce no overwrite |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1198 (goto-char (point-min)) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1199 (when (re-search-forward blank-empty-at-bob-regexp nil t) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1200 (delete-region (match-beginning 1) (match-end 1))) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1201 (when (re-search-forward blank-empty-at-eob-regexp nil t) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1202 (delete-region (match-beginning 1) (match-end 1))))))) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1203 ;; problem 3: 8 or more SPACEs at bol |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1204 ;; problem 4: SPACEs before TAB |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1205 ;; problem 5: SPACEs or TABs at eol |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1206 ;; problem 6: 8 or more SPACEs after TAB |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1207 (blank-cleanup-region (point-min) (point-max)))) |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1208 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1209 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1210 ;;;###autoload |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1211 (defun blank-cleanup-region (start end) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1212 "Cleanup some blank problems at region. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1213 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1214 The problems, which are cleaned up, are: |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1215 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1216 1. 8 or more SPACEs at beginning of line. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1217 If `blank-chars' has `indentation' as an element, replace 8 or |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1218 more SPACEs at beginning of line by TABs. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1219 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1220 2. SPACEs before TAB. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1221 If `blank-chars' has `space-before-tab' as an element, replace |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1222 SPACEs by TABs. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1223 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1224 3. SPACEs or TABs at end of line. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1225 If `blank-chars' has `trailing' as an element, remove all |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1226 SPACEs or TABs at end of line. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1227 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1228 4. 8 or more SPACEs after TAB. |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1229 If `blank-chars' has `space-after-tab' as an element, replace |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1230 SPACEs by TABs." |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1231 (interactive "@*r") |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1232 (let ((rstart (min start end)) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1233 (rend (copy-marker (max start end))) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1234 (tab-width 8) ; assure TAB width |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1235 (indent-tabs-mode t) ; always insert TABs |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1236 overwrite-mode ; enforce no overwrite |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1237 tmp) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1238 (save-excursion |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1239 (save-match-data |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1240 ;; problem 1: 8 or more SPACEs at bol |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1241 ;; action: replace 8 or more SPACEs at bol by TABs |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1242 (when (memq 'indentation blank-chars) |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1243 (goto-char rstart) |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1244 (while (re-search-forward blank-indentation-regexp rend t) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1245 (setq tmp (current-indentation)) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1246 (delete-horizontal-space) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1247 (unless (eolp) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1248 (indent-to tmp)))) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1249 ;; problem 3: SPACEs or TABs at eol |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1250 ;; action: remove all SPACEs or TABs at eol |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1251 (when (memq 'trailing blank-chars) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1252 (let ((regexp (concat "\\(\\(" blank-trailing-regexp |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1253 "\\)+\\)$"))) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1254 (goto-char rstart) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1255 (while (re-search-forward regexp rend t) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1256 (delete-region (match-beginning 1) (match-end 1))))) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1257 ;; problem 4: 8 or more SPACEs after TAB |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1258 ;; action: replace 8 or more SPACEs by TABs |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1259 (when (memq 'space-after-tab blank-chars) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1260 (blank-replace-spaces-by-tabs |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1261 rstart rend blank-space-after-tab-regexp)) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1262 ;; problem 2: SPACEs before TAB |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1263 ;; action: replace SPACEs before TAB by TABs |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1264 (when (memq 'space-before-tab blank-chars) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1265 (blank-replace-spaces-by-tabs |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1266 rstart rend blank-space-before-tab-regexp)))) |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1267 (set-marker rend nil))) ; point marker to nowhere |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1268 |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1269 |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1270 (defun blank-replace-spaces-by-tabs (rstart rend regexp) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1271 "Replace all SPACEs by TABs matched by REGEXP between RSTART and REND." |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1272 (goto-char rstart) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1273 (while (re-search-forward regexp rend t) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1274 (goto-char (match-beginning 1)) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1275 (let* ((scol (current-column)) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1276 (ecol (save-excursion |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1277 (goto-char (match-end 1)) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1278 (current-column)))) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1279 (delete-region (match-beginning 1) (match-end 1)) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1280 (insert-char ?\t |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1281 (/ (- (- ecol (% ecol 8)) ; prev end col |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1282 (- scol (% scol 8))) ; prev start col |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1283 8))))) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1284 |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1285 |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1286 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1287 ;;;; Internal functions |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1288 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1289 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1290 (defvar blank-font-lock-mode nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1291 "Used to remember whether a buffer had font lock mode on or not.") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1292 (make-variable-buffer-local 'blank-font-lock-mode) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1293 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1294 (defvar blank-font-lock nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1295 "Used to remember whether a buffer initially had font lock on or not.") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1296 (make-variable-buffer-local 'blank-font-lock) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1297 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1298 (defvar blank-font-lock-keywords nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1299 "Used to save locally `font-lock-keywords' value.") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1300 (make-variable-buffer-local 'blank-font-lock-keywords) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1301 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1302 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1303 (defconst blank-help-text |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1304 "\ |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1305 blank-mode toggle options: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1306 |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1307 [] t - toggle TAB visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1308 [] s - toggle SPACE and HARD SPACE visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1309 [] r - toggle trailing blanks visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1310 [] b - toggle SPACEs before TAB visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1311 [] l - toggle \"long lines\" visualization |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1312 [] L - toggle \"long lines\" tail visualization |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1313 [] n - toggle NEWLINE visualization |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1314 [] i - toggle indentation SPACEs visualization |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1315 [] e - toggle empty line at bob and/or eob visualization |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1316 [] a - toggle SPACEs after TAB visualization |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1317 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1318 [] c - toggle color faces |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1319 [] m - toggle visual mark |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1320 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1321 x - restore `blank-chars' value |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1322 z - restore `blank-style' value |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1323 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1324 ? - display this text\n\n" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1325 "Text for blank toggle options.") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1326 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1327 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1328 (defconst blank-help-buffer-name "*Blank Toggle Options*" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1329 "The buffer name for blank toggle options.") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1330 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1331 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1332 (defun blank-insert-option-mark (the-list the-value) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1333 "Insert the option mark ('X' or ' ') in toggle options buffer." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1334 (forward-line 1) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1335 (dolist (sym the-list) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1336 (forward-line 1) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1337 (forward-char 2) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1338 (insert (if (memq sym the-value) "X" " ")))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1339 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1340 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1341 (defun blank-help-on (chars style) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1342 "Display the blank toggle options." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1343 (unless (get-buffer blank-help-buffer-name) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1344 (delete-other-windows) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1345 (let ((buffer (get-buffer-create blank-help-buffer-name))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1346 (save-excursion |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1347 (set-buffer buffer) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1348 (erase-buffer) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1349 (insert blank-help-text) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1350 (goto-char (point-min)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1351 (blank-insert-option-mark blank-chars-value-list chars) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1352 (blank-insert-option-mark blank-style-value-list style) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1353 (goto-char (point-min)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1354 (set-buffer-modified-p nil) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1355 (let ((size (- (window-height) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1356 (max window-min-height |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1357 (1+ (count-lines (point-min) (point-max))))))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1358 (when (<= size 0) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1359 (kill-buffer buffer) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1360 (error "Frame height is too small; \ |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1361 can't split window to display blank toggle options")) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1362 (set-window-buffer (split-window nil size) buffer)))))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1363 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1364 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1365 (defun blank-help-off () |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1366 "Remove the buffer and window of the blank toggle options." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1367 (let ((buffer (get-buffer blank-help-buffer-name))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1368 (when buffer |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1369 (delete-windows-on buffer) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1370 (kill-buffer buffer)))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1371 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1372 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1373 (defun blank-interactive-char (local-p) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1374 "Interactive function to read a char and return a symbol. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1375 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1376 If LOCAL-P is non-nil, it uses a local context; otherwise, it |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1377 uses a global context. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1378 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1379 It reads one of the following chars: |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1380 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1381 CHAR MEANING |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1382 t toggle TAB visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1383 s toggle SPACE and HARD SPACE visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1384 r toggle trailing blanks visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1385 b toggle SPACEs before TAB visualization |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1386 l toggle \"long lines\" visualization |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1387 L toggle \"long lines\" tail visualization |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1388 n toggle NEWLINE visualization |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1389 i toggle indentation SPACEs visualization |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1390 e toggle empty line at bob and/or eob visualization |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1391 a toggle SPACEs after TAB visualization |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1392 c toggle color faces |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1393 m toggle visual mark |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1394 x restore `blank-chars' value |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1395 z restore `blank-style' value |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1396 ? display brief help |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1397 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1398 See also `blank-toggle-option-alist'." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1399 (let* ((is-off (not (if local-p blank-mode global-blank-mode))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1400 (chars (cond (is-off blank-chars) ; use default value |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1401 (local-p blank-active-chars) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1402 (t blank-toggle-chars))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1403 (style (cond (is-off blank-style) ; use default value |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1404 (local-p blank-active-style) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1405 (t blank-toggle-style))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1406 (prompt |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1407 (format "Blank Toggle %s (type ? for further options)-" |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1408 (if local-p "Local" "Global"))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1409 ch sym) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1410 ;; read a valid option and get the corresponding symbol |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1411 (save-window-excursion |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1412 (condition-case data |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1413 (progn |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1414 (while |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1415 ;; while condition |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1416 (progn |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1417 (setq ch (read-char prompt)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1418 (not |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1419 (setq sym |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1420 (cdr (assq ch blank-toggle-option-alist))))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1421 ;; while body |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1422 (if (eq ch ?\?) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1423 (blank-help-on chars style) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1424 (ding))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1425 (blank-help-off) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1426 (message " ")) ; clean echo area |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1427 ;; handler |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1428 ((quit error) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1429 (blank-help-off) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1430 (error (error-message-string data))))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1431 (list sym))) ; return the apropriate symbol |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1432 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1433 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1434 (defun blank-toggle-list (local-p arg the-list default-list |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1435 sym-restore sym-list) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1436 "Toggle options in THE-LIST based on list ARG. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1437 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1438 If LOCAL-P is non-nil, it uses a local context; otherwise, it |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1439 uses a global context. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1440 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1441 ARG is a list of options to be toggled. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1442 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1443 THE-LIST is a list of options. This list will be toggled and the |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1444 resultant list will be returned. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1445 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1446 DEFAULT-LIST is the default list of options. It is used to |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1447 restore the options in THE-LIST. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1448 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1449 SYM-RESTORE is the symbol which indicates to restore the options |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1450 in THE-LIST. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1451 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1452 SYM-LIST is a list of valid options, used to check if the ARG's |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1453 options are valid." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1454 (unless (if local-p blank-mode global-blank-mode) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1455 (setq the-list default-list)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1456 (setq the-list (copy-sequence the-list)) ; keep original list |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1457 (dolist (sym (if (listp arg) arg (list arg))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1458 (cond |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1459 ;; restore default values |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1460 ((eq sym sym-restore) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1461 (setq the-list default-list)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1462 ;; toggle valid values |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1463 ((memq sym sym-list) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1464 (setq the-list (if (memq sym the-list) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1465 (delq sym the-list) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1466 (cons sym the-list)))))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1467 the-list) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1468 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1469 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1470 (defun blank-turn-on () |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1471 "Turn on blank visualization." |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1472 (setq blank-active-style (if (listp blank-style) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1473 blank-style |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1474 (list blank-style))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1475 (setq blank-active-chars (if (listp blank-chars) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1476 blank-chars |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1477 (list blank-chars))) |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1478 (when (memq 'color blank-active-style) |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1479 (blank-color-on)) |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1480 (when (memq 'mark blank-active-style) |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1481 (blank-display-char-on))) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1482 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1483 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1484 (defun blank-turn-off () |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1485 "Turn off blank visualization." |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1486 (when (memq 'color blank-active-style) |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1487 (blank-color-off)) |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1488 (when (memq 'mark blank-active-style) |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1489 (blank-display-char-off))) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1490 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1491 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1492 (defun blank-color-on () |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1493 "Turn on color visualization." |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1494 (when blank-active-chars |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1495 (unless blank-font-lock |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1496 (setq blank-font-lock t |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1497 blank-font-lock-keywords |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1498 (copy-sequence font-lock-keywords))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1499 ;; turn off font lock |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1500 (setq blank-font-lock-mode font-lock-mode) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1501 (font-lock-mode 0) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1502 ;; add blank-mode color into font lock |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1503 (when (memq 'spaces blank-active-chars) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1504 (font-lock-add-keywords |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1505 nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1506 (list |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1507 ;; Show SPACEs |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1508 (list blank-space-regexp 1 blank-space t) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1509 ;; Show HARD SPACEs |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1510 (list blank-hspace-regexp 1 blank-hspace t)) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1511 t)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1512 (when (memq 'tabs blank-active-chars) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1513 (font-lock-add-keywords |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1514 nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1515 (list |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1516 ;; Show TABs |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1517 (list blank-tab-regexp 1 blank-tab t)) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1518 t)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1519 (when (memq 'trailing blank-active-chars) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1520 (font-lock-add-keywords |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1521 nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1522 (list |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1523 ;; Show trailing blanks |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1524 (list (concat "\\(\\(" blank-trailing-regexp "\\)+\\)$") |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1525 1 blank-trailing t)) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1526 t)) |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1527 (when (or (memq 'lines blank-active-chars) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1528 (memq 'lines-tail blank-active-chars)) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1529 (font-lock-add-keywords |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1530 nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1531 (list |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1532 ;; Show "long" lines |
87987
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1533 (list |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1534 (format |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1535 "^\\([^\t\n]\\{%s\\}\\|[^\t\n]\\{0,%s\\}\t\\)\\{%d\\}%s\\(.+\\)$" |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1536 tab-width (1- tab-width) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1537 (/ blank-line-column tab-width) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1538 (let ((rem (% blank-line-column tab-width))) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1539 (if (zerop rem) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1540 "" |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1541 (format ".\\{%d\\}" rem)))) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1542 (if (memq 'lines blank-active-chars) |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1543 0 ; whole line |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1544 2) ; line tail |
1b9cb6c86c8c
Handle *long* lines tail visualization.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87963
diff
changeset
|
1545 blank-line t)) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1546 t)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1547 (when (memq 'space-before-tab blank-active-chars) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1548 (font-lock-add-keywords |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1549 nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1550 (list |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1551 ;; Show SPACEs before TAB |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1552 (list blank-space-before-tab-regexp |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1553 1 blank-space-before-tab t)) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1554 t)) |
87963
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1555 (when (memq 'indentation blank-active-chars) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1556 (font-lock-add-keywords |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1557 nil |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1558 (list |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1559 ;; Show indentation SPACEs |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1560 (list blank-indentation-regexp |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1561 1 blank-indentation t)) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1562 t)) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1563 (when (memq 'empty blank-active-chars) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1564 (font-lock-add-keywords |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1565 nil |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1566 (list |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1567 ;; Show empty lines at beginning of buffer |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1568 (list blank-empty-at-bob-regexp |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1569 1 blank-empty t)) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1570 t) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1571 (font-lock-add-keywords |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1572 nil |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1573 (list |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1574 ;; Show empty lines at end of buffer |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1575 (list blank-empty-at-eob-regexp |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1576 1 blank-empty t)) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1577 t)) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1578 (when (memq 'space-after-tab blank-active-chars) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1579 (font-lock-add-keywords |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1580 nil |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1581 (list |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1582 ;; Show SPACEs after TAB |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1583 (list blank-space-after-tab-regexp |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1584 1 blank-space-after-tab t)) |
10a88d763b88
New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
87878
diff
changeset
|
1585 t)) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1586 ;; now turn on font lock and highlight blanks |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1587 (font-lock-mode 1))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1588 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1589 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1590 (defun blank-color-off () |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1591 "Turn off color visualization." |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1592 (when blank-active-chars |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1593 ;; turn off font lock |
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1594 (font-lock-mode 0) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1595 (when blank-font-lock |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1596 (setq blank-font-lock nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1597 font-lock-keywords blank-font-lock-keywords)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1598 ;; restore original font lock state |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1599 (font-lock-mode blank-font-lock-mode))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1600 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1601 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1602 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1603 ;;;; Hacked from visws.el (Miles Bader <miles@gnu.org>) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1604 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1605 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1606 (defvar blank-display-table nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1607 "Used to save a local display table.") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1608 (make-variable-buffer-local 'blank-display-table) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1609 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1610 (defvar blank-display-table-was-local nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1611 "Used to remember whether a buffer initially had a local display table or not.") |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1612 (make-variable-buffer-local 'blank-display-table-was-local) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1613 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1614 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1615 (defsubst blank-char-valid-p (char) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1616 ;; This check should be improved!!! |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1617 (or (< char 256) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1618 (char-valid-p char))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1619 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1620 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1621 (defun blank-legal-display-vector-p (vec) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1622 "Return true if every character in vector VEC can be displayed." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1623 (let ((i (length vec))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1624 (when (> i 0) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1625 (while (and (>= (setq i (1- i)) 0) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1626 (blank-char-valid-p (aref vec i)))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1627 (< i 0)))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1628 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1629 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1630 (defun blank-display-char-on () |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1631 "Turn on character display mapping." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1632 (when blank-display-mappings |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1633 (let (vecs vec) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1634 ;; Remember whether a buffer has a local display table. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1635 (unless blank-display-table-was-local |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1636 (setq blank-display-table-was-local t |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1637 blank-display-table |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1638 (copy-sequence buffer-display-table))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1639 (unless buffer-display-table |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1640 (setq buffer-display-table (make-display-table))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1641 (dolist (entry blank-display-mappings) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1642 (setq vecs (cdr entry)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1643 ;; Get a displayable mapping. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1644 (while (and vecs |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1645 (not (blank-legal-display-vector-p (car vecs)))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1646 (setq vecs (cdr vecs))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1647 ;; Display a valid mapping. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1648 (when vecs |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1649 (setq vec (copy-sequence (car vecs))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1650 (cond |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1651 ;; Any char except newline |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1652 ((not (eq (car entry) ?\n)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1653 (aset buffer-display-table (car entry) vec)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1654 ;; Newline char - display it |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1655 ((memq 'newline blank-active-chars) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1656 ;; Only insert face bits on NEWLINE char mapping to avoid |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1657 ;; obstruction of other faces like TABs and (HARD) SPACEs |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1658 ;; faces, font-lock faces, etc. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1659 (when (memq 'color blank-active-style) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1660 (dotimes (i (length vec)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1661 ;; Due to limitations of glyph representation, the char |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1662 ;; code can not be above ?\x1FFFF. Probably, this will |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1663 ;; be fixed after Emacs unicode merging. |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1664 (or (eq (aref vec i) ?\n) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1665 (> (aref vec i) #x1FFFF) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1666 (aset vec i (make-glyph-code (aref vec i) |
87878
3f6dc5290b26
Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
79874
diff
changeset
|
1667 blank-newline))))) |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1668 ;; Display mapping |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1669 (aset buffer-display-table (car entry) vec)) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1670 ;; Newline char - don't display it |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1671 (t |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1672 ;; Do nothing |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1673 ))))))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1674 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1675 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1676 (defun blank-display-char-off () |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1677 "Turn off character display mapping." |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1678 (and blank-display-mappings |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1679 blank-display-table-was-local |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1680 (setq blank-display-table-was-local nil |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1681 buffer-display-table blank-display-table))) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1682 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1683 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1684 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1685 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1686 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1687 (provide 'blank-mode) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1688 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1689 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1690 (run-hooks 'blank-load-hook) |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1691 |
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1692 |
79874 | 1693 ;; arch-tag: 1b1e2500-dbd4-4a26-8f7a-5a5edfd3c97e |
79869
a8237408c221
New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1694 ;;; blank-mode.el ends here |