annotate lisp/blank-mode.el @ 87981:8eba27dae69a

(Running Hooks, Setting Hooks): New nodes. (Hooks): Add menu. (Setting Hooks): For `add-hook', document `permanent-local-hook'.
author Richard M. Stallman <rms@gnu.org>
date Fri, 25 Jan 2008 23:04:06 +0000
parents 10a88d763b88
children 1b9cb6c86c8c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
87963
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
9 ;; Version: 9.0
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 ;;
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
267 ;; `blank-line-length' Specify length beyond which the line
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 ;;
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
280 ;; 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
281 ;; * `define-minor-mode'.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
282 ;; * `global-blank-*' name for global commands.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
283 ;;
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
284 ;; 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
285 ;;
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
286 ;; 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
287 ;; suggestion.
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 Antti Kaihola <antti.kaihola@linux-aktivaattori.org> for
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
290 ;; helping to fix `find-file-hooks' reference.
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 Andreas Roehler <andreas.roehler@easy-emacs.de> for
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
293 ;; indicating defface byte-compilation warnings.
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 TimOCallaghan (EmacsWiki) for the idea about highlight
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
296 ;; "long" lines. See EightyColumnRule (EmacsWiki).
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 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
299 ;; newline character mapping.
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 Pete Forman <pete.forman@westgeo.com> for indicating
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
302 ;; whitespace-mode on XEmacs.
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 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
305 ;; 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
306 ;;
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
307 ;; 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
308 ;; Rajesh Vaidheeswarran <rv@gnu.org> whitespace.el
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
309 ;; 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
310 ;; Lawrence Mitchell <wence@gmx.li> whitespace-mode.el
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
311 ;; Miles Bader <miles@gnu.org> visws.el
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
312 ;; And to all people who contributed with them.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
313 ;;
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
314 ;;
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
315 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
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 ;;; code:
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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
321 ;;;; User Variables:
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 ;;; Interface to the command system
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 (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
328 "Visualize blanks (TAB, (HARD) SPACE and NEWLINE)."
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
329 :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
330 :version "22.2"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
331 :group 'wp
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
332 :group 'data)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
333
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
334
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
335 (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
336 "*Specify the visualization style.
79869
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 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
339
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
340 mark display mappings are visualized.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
341
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
342 color faces are visualized.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
343
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
344 Any other value is ignored.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
345
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
346 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
347
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
348 See also `blank-display-mappings' for documentation."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
349 :type '(repeat :tag "Style of Blank"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
350 (choice :tag "Style of Blank"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
351 (const :tag "Display Table" mark)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
352 (const :tag "Faces" color)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
353 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
354
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
355
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
356 (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
357 '(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
358 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
359 "*Specify which kind of blank is visualized.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
360
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
361 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
362
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
363 trailing trailing blanks are visualized.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
364
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
365 tabs TABs are visualized.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
366
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
367 spaces SPACEs and HARD SPACEs are visualized.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
368
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
369 lines lines whose length is greater than
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
370 `blank-line-length' are highlighted.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
371
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
372 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
373
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
374 newline NEWLINEs are visualized.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
375
87963
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
376 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
377 visualized.
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
378
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
379 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
380 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
381
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
382 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
383
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
384 Any other value is ignored.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
385
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
386 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
387
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
388 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
389 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
390 has `mark' as an element."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
391 :type '(repeat :tag "Kind of Blank"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
392 (choice :tag "Kind of Blank"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
393 (const :tag "Trailing TABs, SPACEs and HARD SPACEs"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
394 trailing)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
395 (const :tag "SPACEs and HARD SPACEs" spaces)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
396 (const :tag "TABs" tabs)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
397 (const :tag "Lines" lines)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
398 (const :tag "SPACEs before TAB"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
399 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
400 (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
401 (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
402 (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
403 empty)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
404 (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
405 space-after-tab)))
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
406 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
407
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
408
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
409 (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
410 "*Symbol face used to visualize SPACE.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
411
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
412 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
413 :type 'face
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
414 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
415
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
416
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
417 (defface blank-space
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
418 '((((class color) (background dark))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
419 (:background "grey20" :foreground "aquamarine3"))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
420 (((class color) (background light))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
421 (:background "LightYellow" :foreground "aquamarine3"))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
422 (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
423 "Face used to visualize SPACE."
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
424 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
425
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
426
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
427 (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
428 "*Symbol face used to visualize HARD SPACE.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
429
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
430 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
431 :type 'face
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
432 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
433
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
434
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
435 (defface blank-hspace ; 'nobreak-space
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
436 '((((class color) (background dark))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
437 (:background "grey24" :foreground "aquamarine3"))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
438 (((class color) (background light))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
439 (:background "LemonChiffon3" :foreground "aquamarine3"))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
440 (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
441 "Face used to visualize HARD SPACE."
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
442 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
443
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
444
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
445 (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
446 "*Symbol face used to visualize TAB.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
447
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
448 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
449 :type 'face
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
450 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
451
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
452
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
453 (defface blank-tab
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
454 '((((class color) (background dark))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
455 (:background "grey22" :foreground "aquamarine3"))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
456 (((class color) (background light))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
457 (:background "beige" :foreground "aquamarine3"))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
458 (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
459 "Face used to visualize TAB."
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
460 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
461
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
462
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
463 (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
464 "*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
465
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
466 See `blank-display-mappings'.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
467
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
468 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
469 and `blank-chars' has `newline' as an element."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
470 :type 'face
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
471 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
472
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
473
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
474 (defface blank-newline
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
475 '((((class color) (background dark))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
476 (:background "grey26" :foreground "aquamarine3" :bold t))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
477 (((class color) (background light))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
478 (:background "linen" :foreground "aquamarine3" :bold t))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
479 (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
480 "Face used to visualize NEWLINE char mapping.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
481
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
482 See `blank-display-mappings'."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
483 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
484
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
485
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
486 (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
487 "*Symbol face used to visualize traling blanks.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
488
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
489 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
490 :type 'face
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
491 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
492
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
493
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
494 (defface blank-trailing ; 'trailing-whitespace
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
495 '((((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
496 (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
497 "Face used to visualize trailing blanks."
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
498 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
499
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
500
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
501 (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
502 "*Symbol face used to visualize \"long\" lines.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
503
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
504 See `blank-line-length'.
79869
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 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
507 :type 'face
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
508 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
509
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
510
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
511 (defface blank-line
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
512 '((((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
513 (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
514 "Face used to visualize \"long\" lines.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
515
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
516 See `blank-line-length'."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
517 :group 'blank)
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
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
520 (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
521 "*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
522
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
523 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
524 :type 'face
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
525 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
526
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
527
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
528 (defface blank-space-before-tab
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
529 '((((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
530 (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
531 "Face used to visualize SPACEs before TAB."
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
532 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
533
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
534
87963
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
535 (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
536 "*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
537
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
538 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
539 :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
540 :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
541
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
542
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
543 (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
544 '((((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
545 (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
546 "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
547 :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
548
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
549
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
550 (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
551 "*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
552
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
553 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
554 :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
555 :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
556
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
557
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
558 (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
559 '((((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
560 (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
561 "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
562 :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
563
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
564
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
565 (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
566 "*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
567
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
568 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
569 :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
570 :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
571
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
572
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
573 (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
574 '((((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
575 (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
576 "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
577 :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
578
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
579
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
580 (defcustom blank-hspace-regexp
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
581 "\\(\\(\xA0\\|\x8A0\\|\x920\\|\xE20\\|\xF20\\)+\\)"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
582 "*Specify HARD SPACE characters regexp.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
583
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
584 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
585
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
586 \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \"\\xF20\"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
587
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
588 that should be considered HARD SPACE.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
589
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
590 Here are some examples:
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
591
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
592 \"\\\\(^\\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
593 visualize only leading HARD SPACEs.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
594 \"\\\\(\\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
595 visualize only trailing HARD SPACEs.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
596 \"\\\\(^\\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
597 visualize leading and/or trailing HARD SPACEs.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
598 \"\\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
599 visualize only HARD SPACEs between TABs.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
600
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
601 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
602 Use exactly one pair of enclosing \\\\( and \\\\).
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
603
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
604 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
605 `blank-chars' has `spaces' as an element."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
606 :type '(regexp :tag "HARD SPACE Chars")
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
607 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
608
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
609
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
610 (defcustom blank-space-regexp "\\( +\\)"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
611 "*Specify SPACE characters regexp.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
612
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
613 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
614 besides \" \" that should be considered SPACE.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
615
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
616 Here are some examples:
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
617
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
618 \"\\\\(^ +\\\\)\" 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
619 \"\\\\( +$\\\\)\" visualize only trailing SPACEs.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
620 \"\\\\(^ +\\\\| +$\\\\)\" \
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
621 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
622 \"\\t\\\\( +\\\\)\\t\" visualize only SPACEs between TABs.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
623
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
624 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
625 Use exactly one pair of enclosing \\\\( and \\\\).
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
626
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
627 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
628 `blank-chars' has `spaces' as an element."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
629 :type '(regexp :tag "SPACE Chars")
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
630 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
631
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
632
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
633 (defcustom blank-tab-regexp "\\(\t+\\)"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
634 "*Specify TAB characters regexp.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
635
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
636 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
637 besides \"\\t\" that should be considered TAB.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
638
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
639 Here are some examples:
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
640
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
641 \"\\\\(^\\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
642 \"\\\\(\\t+$\\\\)\" visualize only trailing TABs.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
643 \"\\\\(^\\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
644 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
645 \" \\\\(\\t+\\\\) \" visualize only TABs between SPACEs.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
646
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
647 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
648 Use exactly one pair of enclosing \\\\( and \\\\).
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
649
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
650 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
651 `blank-chars' has `tabs' as an element."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
652 :type '(regexp :tag "TAB Chars")
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
653 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
654
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
655
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
656 (defcustom blank-trailing-regexp
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
657 "\t\\| \\|\xA0\\|\x8A0\\|\x920\\|\xE20\\|\xF20"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
658 "*Specify trailing characters regexp.
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 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
661
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
662 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
663 \"\\xF20\"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
664
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
665 that should be considered blank.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
666
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
667 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
668 `blank-mode' surrounds this regexp by \"\\\\(\\\\(\" and
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
669 \"\\\\)+\\\\)$\".
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
670
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
671 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
672 `blank-chars' has `trailing' as an element."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
673 :type '(regexp :tag "Trailing Chars")
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
674 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
675
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
676
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
677 (defcustom blank-space-before-tab-regexp "\\( +\\)\t"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
678 "*Specify SPACEs before TAB regexp.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
679
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
680 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
681
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
682 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
683 \"\\xF20\"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
684
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
685 that should be considered blank.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
686
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
687 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
688 `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
689 :type '(regexp :tag "SPACEs Before TAB")
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
690 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
691
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
692
87963
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
693 (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
694 "*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
695
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
696 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
697
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
698 \" \" \"\\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
699 \"\\xF20\"
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
700
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
701 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
702
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
703 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
704 `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
705 :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
706 :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
707
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 (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
710 "*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
711
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
712 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
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 \" \" \"\\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
715 \"\\xF20\"
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
716
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
717 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
718
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
719 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
720 `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
721 :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
722 :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
723
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 (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
726 "*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
727
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
728 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
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 \" \" \"\\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
731 \"\\xF20\"
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
732
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
733 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
734
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
735 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
736 `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
737 :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
738 :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
739
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 (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
742 "*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
743
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
744 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
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 \" \" \"\\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
747 \"\\xF20\"
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
748
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
749 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
750
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
751 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
752 `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
753 :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
754 :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
755
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
756
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
757 (defcustom blank-line-length 80
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
758 "*Specify length beyond which the line is highlighted.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
759
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
760 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
761 `blank-chars' has `lines' as an element."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
762 :type '(integer :tag "Line Length")
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
763 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
764
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
765
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
766 ;; Hacked from `visible-whitespace-mappings' in visws.el
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
767 (defcustom blank-display-mappings
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
768 ;; 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
769 ;; 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
770 ;; unicode merging.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
771 '(
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
772 (?\ [?\xB7] [?.]) ; space - centered dot
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
773 (?\xA0 [?\xA4] [?_]) ; hard space - currency
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
774 (?\x8A0 [?\x8A4] [?_]) ; hard space - currency
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
775 (?\x920 [?\x924] [?_]) ; hard space - currency
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
776 (?\xE20 [?\xE24] [?_]) ; hard space - currency
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
777 (?\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
778 ;; 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
779 (?\n [?$ ?\n]) ; end-of-line - dollar sign
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
780 ;; (?\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
781 ;; (?\n [?\xB6 ?\n] [?$ ?\n]) ; end-of-line - pilcrow
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
782 ;; (?\n [?\x8AF ?\n] [?$ ?\n]) ; end-of-line - overscore
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
783 ;; (?\n [?\x8AC ?\n] [?$ ?\n]) ; end-of-line - negation
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
784 ;; (?\n [?\x8B0 ?\n] [?$ ?\n]) ; end-of-line - grade
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
785 ;;
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
786 ;; WARNING: the mapping below has a problem.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
787 ;; 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
788 ;; 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
789 ;; the next TAB column.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
790 ;; 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
791 (?\t [?\xBB ?\t] [?\\ ?\t]) ; tab - left quote mark
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
792 )
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
793 "*Specify an alist of mappings for displaying characters.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
794
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
795 Each element has the following form:
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
796
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
797 (CHAR VECTOR...)
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 Where:
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
800
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
801 CHAR is the character to be mapped.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
802
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
803 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
804 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
805 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
806 that character is displayed unmodified.
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 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
809 `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
810 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
811 is above #x1FFFF.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
812
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
813 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
814 :type '(repeat
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
815 (list :tag "Character Mapping"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
816 (character :tag "Char")
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
817 (repeat :inline t :tag "Vector List"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
818 (vector :tag ""
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
819 (repeat :inline t
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
820 :tag "Vector Characters"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
821 (character :tag "Char"))))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
822 :group 'blank)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
823
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
824
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
825 (defcustom blank-global-modes t
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
826 "*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
827
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
828 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
829
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
830 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
831 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
832 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
833 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
834 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
835 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
836
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
837 (c-mode c++-mode)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
838
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
839 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
840 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
841 :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
842 (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
843 (set :menu-tag "Mode Specific" :tag "Modes"
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
844 :value (not)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
845 (const :tag "Except" not)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
846 (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
847 (symbol :tag "Mode"))))
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
848 :group 'blank)
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
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 ;;;; User commands - Local mode
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
853
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
854
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
855 ;;;###autoload
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
856 (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
857 "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
858
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
859 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
860 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
861 otherwise, turn off visualization.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
862 Only useful with a windowing system."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
863 :lighter " bl"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
864 :init-value nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
865 :global nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
866 :group 'blank
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
867 (cond
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
868 (noninteractive ; running a batch job
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
869 (setq blank-mode nil))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
870 (blank-mode ; blank-mode on
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
871 (blank-turn-on))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
872 (t ; blank-mode off
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
873 (blank-turn-off))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
874
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
875
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
876 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
877 ;;;; User commands - Global mode
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
878
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
879
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
880 (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
881 "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
882
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
883 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
884 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
885 otherwise, turn off visualization.
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
886 Only useful with a windowing system."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
887 :lighter " BL"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
888 :init-value nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
889 :global t
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
890 :group 'blank
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
891 (cond
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
892 (noninteractive ; running a batch job
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
893 (setq global-blank-mode nil))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
894 (global-blank-mode ; global-blank-mode on
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
895 (save-excursion
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
896 (if (boundp 'find-file-hook)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
897 (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
898 (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
899 (dolist (buffer (buffer-list)) ; adjust all local mode
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
900 (set-buffer buffer)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
901 (unless blank-mode
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
902 (blank-turn-on-if-enabled)))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
903 (t ; global-blank-mode off
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
904 (save-excursion
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
905 (if (boundp 'find-file-hook)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
906 (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
907 (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
908 (dolist (buffer (buffer-list)) ; adjust all local mode
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
909 (set-buffer buffer)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
910 (unless blank-mode
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
911 (blank-turn-off)))))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
912
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
913
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
914 (defun blank-turn-on-if-enabled ()
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
915 (when (cond
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
916 ((eq blank-global-modes t))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
917 ((listp blank-global-modes)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
918 (if (eq (car-safe blank-global-modes) 'not)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
919 (not (memq major-mode (cdr blank-global-modes)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
920 (memq major-mode blank-global-modes)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
921 (t nil))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
922 (let (inhibit-quit)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
923 ;; Don't turn on blank mode if...
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
924 (or
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
925 ;; ...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
926 noninteractive
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
927 ;; ...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
928 (eq (aref (buffer-name) 0) ?\ )
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
929 ;; ...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
930 (and (eq (aref (buffer-name) 0) ?*)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
931 ;; except the scratch buffer.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
932 (not (string= (buffer-name) "*scratch*")))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
933 ;; Otherwise, turn on blank mode.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
934 (blank-turn-on)))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
935
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
936
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
937 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
938 ;;;; User commands - Toggle
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
939
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
940
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
941 (defconst blank-chars-value-list
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
942 '(tabs
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
943 spaces
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
944 trailing
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
945 space-before-tab
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
946 lines
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
947 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
948 indentation
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
949 empty
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
950 space-after-tab
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
951 )
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
952 "List of valid `blank-chars' values.")
79869
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
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
955 (defconst blank-style-value-list
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
956 '(color
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
957 mark
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
958 )
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
959 "List of valid `blank-style' values.")
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
960
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
961
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
962 (defconst blank-toggle-option-alist
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
963 '((?t . tabs)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
964 (?s . spaces)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
965 (?r . trailing)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
966 (?b . space-before-tab)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
967 (?l . lines)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
968 (?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
969 (?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
970 (?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
971 (?a . space-after-tab)
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
972 (?c . color)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
973 (?m . mark)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
974 (?x . blank-chars)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
975 (?z . blank-style)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
976 )
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
977 "Alist of toggle options.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
978
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
979 Each element has the form:
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
980
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
981 (CHAR . SYMBOL)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
982
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
983 Where:
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
984
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
985 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
986
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
987 SYMBOL is a valid symbol associated with CHAR.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
988 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
989
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
990
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
991 (defvar blank-active-chars nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
992 "Used to save locally `blank-chars' value.")
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
993 (make-variable-buffer-local 'blank-active-chars)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
994
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
995 (defvar blank-active-style nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
996 "Used to save locally `blank-style' value.")
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
997 (make-variable-buffer-local 'blank-active-style)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
998
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 ;;;###autoload
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1001 (defun blank-toggle-options (arg)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1002 "Toggle local `blank-mode' options.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1003
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1004 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
1005 turn on local blank-mode.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1006
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1007 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
1008 restart local blank-mode.
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 Interactively, it reads one of the following chars:
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1011
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1012 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
1013 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
1014 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
1015 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
1016 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
1017 l toggle \"long lines\" 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
1018 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
1019 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
1020 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
1021 a toggle SPACEs after TAB visualization
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1022 c toggle color faces
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1023 m toggle visual mark
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1024 x restore `blank-chars' value
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1025 z restore `blank-style' value
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1026 ? display brief help
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1027
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 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
1029 The valid symbols are:
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1030
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
1031 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
1032 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
1033 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
1034 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
1035 lines toggle \"long lines\" 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
1036 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
1037 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
1038 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
1039 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
1040 color toggle color faces
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1041 mark toggle visual mark
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1042 blank-chars restore `blank-chars' value
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1043 blank-style restore `blank-style' value
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1044
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1045 Only useful with a windowing system."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1046 (interactive (blank-interactive-char t))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1047 (let ((blank-chars
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1048 (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
1049 'blank-chars blank-chars-value-list))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1050 (blank-style
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1051 (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
1052 'blank-style blank-style-value-list)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1053 (blank-mode 0)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1054 (blank-mode 1)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1055
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1056
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1057 (defvar blank-toggle-chars nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1058 "Used to toggle the global `blank-chars' value.")
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1059 (defvar blank-toggle-style nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1060 "Used to toggle the global `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
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1063 ;;;###autoload
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1064 (defun global-blank-toggle-options (arg)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1065 "Toggle global `blank-mode' options.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1066
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1067 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
1068 turn on global blank-mode.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1069
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1070 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
1071 restart global blank-mode.
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 Interactively, it reads one of the following chars:
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1074
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1075 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
1076 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
1077 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
1078 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
1079 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
1080 l toggle \"long lines\" 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
1081 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
1082 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
1083 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
1084 a toggle SPACEs after TAB visualization
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1085 c toggle color faces
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1086 m toggle visual mark
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1087 x restore `blank-chars' value
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1088 z restore `blank-style' value
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1089 ? display brief help
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1090
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
1091 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
1092 The valid symbols are:
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1093
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
1094 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
1095 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
1096 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
1097 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
1098 lines toggle \"long lines\" 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
1099 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
1100 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
1101 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
1102 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
1103 color toggle color faces
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1104 mark toggle visual mark
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1105 blank-chars restore `blank-chars' value
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1106 blank-style restore `blank-style' value
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1107
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1108 Only useful with a windowing system."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1109 (interactive (blank-interactive-char nil))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1110 (let ((blank-chars
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1111 (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
1112 'blank-chars blank-chars-value-list))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1113 (blank-style
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1114 (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
1115 'blank-style blank-style-value-list)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1116 (setq blank-toggle-chars blank-chars
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1117 blank-toggle-style blank-style)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1118 (global-blank-mode 0)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1119 (global-blank-mode 1)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1120
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1121
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1122 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
87963
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1123 ;;;; 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
1124
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1125
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1126 ;;;###autoload
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1127 (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
1128 "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
1129
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1130 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
1131 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
1132 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
1133 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
1134 `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
1135
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1136 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
1137
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1138 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
1139
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1140 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
1141 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
1142 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
1143 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
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 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
1146 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
1147 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
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 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
1150 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
1151 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
1152
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1153 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
1154 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
1155 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
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 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
1158 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
1159 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
1160 (interactive "@*")
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 (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
1162 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
1163 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
1164 ;; 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
1165 ;; 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
1166 ;; 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
1167 ;; 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
1168 ;; 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
1169 ;; 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
1170 (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
1171 ;; 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
1172 (save-excursion
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1173 ;; problem 1: empty lines at bob
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1174 ;; problem 2: empty lines at eob
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1175 ;; action: remove all 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
1176 (when (memq 'empty blank-chars)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1177 (let (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
1178 (goto-char (point-min))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1179 (when (re-search-forward blank-empty-at-bob-regexp nil t)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1180 (delete-region (match-beginning 1) (match-end 1)))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1181 (when (re-search-forward blank-empty-at-eob-regexp nil t)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1182 (delete-region (match-beginning 1) (match-end 1)))))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1183 ;; 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
1184 ;; 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
1185 ;; 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
1186 ;; 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
1187 (blank-cleanup-region (point-min) (point-max)))))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1188
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1189
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1190 ;;;###autoload
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1191 (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
1192 "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
1193
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1194 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
1195
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1196 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
1197 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
1198 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
1199
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1200 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
1201 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
1202 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
1203
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1204 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
1205 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
1206 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
1207
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1208 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
1209 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
1210 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
1211 (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
1212 (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
1213 (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
1214 (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
1215 (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
1216 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
1217 tmp)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1218 (save-excursion
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1219 ;; problem 1: 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
1220 ;; action: replace 8 or more SPACEs at bol 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
1221 (when (memq 'indentation blank-chars)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1222 (goto-char rstart)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1223 (while (re-search-forward blank-indentation-regexp rend t)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1224 (setq tmp (current-indentation))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1225 (delete-horizontal-space)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1226 (unless (eolp)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1227 (indent-to tmp))))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1228 ;; problem 3: 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
1229 ;; action: remove all 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
1230 (when (memq 'trailing blank-chars)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1231 (let ((regexp
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1232 (concat "\\(\\(" blank-trailing-regexp "\\)+\\)$")))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1233 (goto-char rstart)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1234 (while (re-search-forward regexp rend t)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1235 (delete-region (match-beginning 1) (match-end 1)))))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1236 ;; problem 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
1237 ;; action: replace 8 or more 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
1238 (when (memq 'space-after-tab blank-chars)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1239 (goto-char rstart)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1240 (while (re-search-forward blank-space-after-tab-regexp rend t)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1241 (goto-char (match-beginning 1))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1242 (let ((scol (current-column))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1243 (ecol (save-excursion
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1244 (goto-char (match-end 1))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1245 (current-column))))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1246 (delete-region (match-beginning 1) (match-end 1))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1247 (insert-char ?\t (/ (- ecol scol) 8)))))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1248 ;; problem 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
1249 ;; action: replace SPACEs before TAB 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
1250 (when (memq 'space-before-tab blank-chars)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1251 (goto-char rstart)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1252 (while (re-search-forward blank-space-before-tab-regexp rend t)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1253 (goto-char (match-beginning 1))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1254 (let* ((scol (current-column))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1255 (ecol (save-excursion
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1256 (goto-char (match-end 1))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1257 (current-column)))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1258 (next-tab-col (* (/ (+ scol 8) 8) 8)))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1259 (delete-region (match-beginning 1) (match-end 1))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1260 (when (<= next-tab-col ecol)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1261 (insert-char ?\t
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1262 (/ (- (- ecol (% ecol 8)) ; prev end col
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1263 (- scol (% scol 8))) ; prev start col
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1264 8)))))))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1265 (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
1266
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1267
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1268 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1269 ;;;; Internal functions
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1270
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1271
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1272 (defvar blank-font-lock-mode nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1273 "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
1274 (make-variable-buffer-local 'blank-font-lock-mode)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1275
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1276 (defvar blank-font-lock nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1277 "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
1278 (make-variable-buffer-local 'blank-font-lock)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1279
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1280 (defvar blank-font-lock-keywords nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1281 "Used to save locally `font-lock-keywords' value.")
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1282 (make-variable-buffer-local 'blank-font-lock-keywords)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1283
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1284
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1285 (defconst blank-help-text
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1286 "\
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1287 blank-mode toggle options:
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1288
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
1289 [] 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
1290 [] 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
1291 [] 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
1292 [] 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
1293 [] l - toggle \"long lines\" 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
1294 [] 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
1295 [] 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
1296 [] 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
1297 [] a - toggle SPACEs after TAB visualization
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1298
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1299 [] c - toggle color faces
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1300 [] m - toggle visual mark
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 x - restore `blank-chars' value
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1303 z - restore `blank-style' value
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 ? - display this text\n\n"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1306 "Text for blank toggle options.")
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1307
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1308
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1309 (defconst blank-help-buffer-name "*Blank Toggle Options*"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1310 "The buffer name for blank toggle options.")
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1311
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1312
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1313 (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
1314 "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
1315 (forward-line 1)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1316 (dolist (sym the-list)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1317 (forward-line 1)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1318 (forward-char 2)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1319 (insert (if (memq sym the-value) "X" " "))))
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
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1322 (defun blank-help-on (chars style)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1323 "Display the blank toggle options."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1324 (unless (get-buffer blank-help-buffer-name)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1325 (delete-other-windows)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1326 (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
1327 (save-excursion
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1328 (set-buffer buffer)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1329 (erase-buffer)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1330 (insert blank-help-text)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1331 (goto-char (point-min))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1332 (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
1333 (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
1334 (goto-char (point-min))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1335 (set-buffer-modified-p nil)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1336 (let ((size (- (window-height)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1337 (max window-min-height
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1338 (1+ (count-lines (point-min) (point-max)))))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1339 (when (<= size 0)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1340 (kill-buffer buffer)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1341 (error "Frame height is too small; \
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1342 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
1343 (set-window-buffer (split-window nil size) buffer))))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1344
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1345
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1346 (defun blank-help-off ()
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1347 "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
1348 (let ((buffer (get-buffer blank-help-buffer-name)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1349 (when buffer
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1350 (delete-windows-on buffer)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1351 (kill-buffer buffer))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1352
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1353
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1354 (defun blank-interactive-char (local-p)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1355 "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
1356
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1357 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
1358 uses a global context.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1359
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1360 It reads one of the following chars:
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1361
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1362 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
1363 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
1364 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
1365 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
1366 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
1367 l toggle \"long lines\" 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
1368 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
1369 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
1370 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
1371 a toggle SPACEs after TAB visualization
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1372 c toggle color faces
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1373 m toggle visual mark
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1374 x restore `blank-chars' value
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1375 z restore `blank-style' value
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1376 ? display brief help
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1377
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1378 See also `blank-toggle-option-alist'."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1379 (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
1380 (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
1381 (local-p blank-active-chars)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1382 (t blank-toggle-chars)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1383 (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
1384 (local-p blank-active-style)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1385 (t blank-toggle-style)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1386 (prompt
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1387 (format "Blank Toggle %s (type ? for further options)-"
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1388 (if local-p "Local" "Global")))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1389 ch sym)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1390 ;; 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
1391 (save-window-excursion
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1392 (condition-case data
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1393 (progn
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1394 (while
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1395 ;; while condition
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1396 (progn
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1397 (setq ch (read-char prompt))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1398 (not
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1399 (setq sym
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1400 (cdr (assq ch blank-toggle-option-alist)))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1401 ;; while body
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1402 (if (eq ch ?\?)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1403 (blank-help-on chars style)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1404 (ding)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1405 (blank-help-off)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1406 (message " ")) ; clean echo area
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1407 ;; handler
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1408 ((quit error)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1409 (blank-help-off)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1410 (error (error-message-string data)))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1411 (list sym))) ; return the apropriate symbol
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1412
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1413
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1414 (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
1415 sym-restore sym-list)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1416 "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
1417
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1418 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
1419 uses a global context.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1420
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1421 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
1422
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1423 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
1424 resultant list will be returned.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1425
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1426 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
1427 restore the options in THE-LIST.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1428
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1429 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
1430 in THE-LIST.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1431
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1432 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
1433 options are valid."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1434 (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
1435 (setq the-list default-list))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1436 (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
1437 (dolist (sym (if (listp arg) arg (list arg)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1438 (cond
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1439 ;; restore default values
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1440 ((eq sym sym-restore)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1441 (setq the-list default-list))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1442 ;; toggle valid values
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1443 ((memq sym sym-list)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1444 (setq the-list (if (memq sym the-list)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1445 (delq sym the-list)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1446 (cons sym the-list))))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1447 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
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1450 (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
1451 "Turn on blank visualization."
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1452 (setq blank-active-style (if (listp blank-style)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1453 blank-style
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1454 (list blank-style)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1455 (setq blank-active-chars (if (listp blank-chars)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1456 blank-chars
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1457 (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
1458 (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
1459 (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
1460 (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
1461 (blank-display-char-on)))
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1462
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1463
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1464 (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
1465 "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
1466 (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
1467 (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
1468 (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
1469 (blank-display-char-off)))
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1470
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1471
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1472 (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
1473 "Turn on color visualization."
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1474 (when blank-active-chars
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1475 (unless blank-font-lock
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1476 (setq blank-font-lock t
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1477 blank-font-lock-keywords
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1478 (copy-sequence font-lock-keywords)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1479 ;; turn off font lock
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1480 (setq blank-font-lock-mode font-lock-mode)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1481 (font-lock-mode 0)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1482 ;; add blank-mode color into font lock
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1483 (when (memq 'spaces blank-active-chars)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1484 (font-lock-add-keywords
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1485 nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1486 (list
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1487 ;; 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
1488 (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
1489 ;; 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
1490 (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
1491 t))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1492 (when (memq 'tabs blank-active-chars)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1493 (font-lock-add-keywords
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1494 nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1495 (list
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1496 ;; 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
1497 (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
1498 t))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1499 (when (memq 'trailing blank-active-chars)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1500 (font-lock-add-keywords
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1501 nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1502 (list
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1503 ;; Show trailing blanks
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1504 (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
1505 1 blank-trailing t))
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1506 t))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1507 (when (memq 'lines blank-active-chars)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1508 (font-lock-add-keywords
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1509 nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1510 (list
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1511 ;; Show "long" lines
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1512 (list (concat "^\\(.\\{" (int-to-string blank-line-length)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1513 ",\\}\\)$")
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
1514 1 blank-line t))
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1515 t))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1516 (when (memq 'space-before-tab blank-active-chars)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1517 (font-lock-add-keywords
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1518 nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1519 (list
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1520 ;; Show SPACEs before TAB
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1521 (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
1522 1 blank-space-before-tab t))
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1523 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
1524 (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
1525 (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
1526 nil
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1527 (list
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1528 ;; 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
1529 (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
1530 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
1531 t))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1532 (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
1533 (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
1534 nil
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1535 (list
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1536 ;; 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
1537 (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
1538 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
1539 t)
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1540 (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
1541 nil
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1542 (list
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1543 ;; 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
1544 (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
1545 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
1546 t))
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1547 (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
1548 (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
1549 nil
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1550 (list
10a88d763b88 New commands for cleaning up some blank problems like trailing blanks.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87878
diff changeset
1551 ;; 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
1552 (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
1553 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
1554 t))
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1555 ;; now turn on font lock and highlight blanks
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1556 (font-lock-mode 1)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1557
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1558
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1559 (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
1560 "Turn off color visualization."
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1561 (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
1562 ;; 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
1563 (font-lock-mode 0)
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1564 (when blank-font-lock
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1565 (setq blank-font-lock nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1566 font-lock-keywords blank-font-lock-keywords))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1567 ;; restore original font lock state
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1568 (font-lock-mode blank-font-lock-mode)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1569
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1570
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1571 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1572 ;;;; 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
1573
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1574
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1575 (defvar blank-display-table nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1576 "Used to save a local display table.")
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1577 (make-variable-buffer-local 'blank-display-table)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1578
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1579 (defvar blank-display-table-was-local nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1580 "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
1581 (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
1582
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1583
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1584 (defsubst blank-char-valid-p (char)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1585 ;; This check should be improved!!!
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1586 (or (< char 256)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1587 (char-valid-p char)))
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-legal-display-vector-p (vec)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1591 "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
1592 (let ((i (length vec)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1593 (when (> i 0)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1594 (while (and (>= (setq i (1- i)) 0)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1595 (blank-char-valid-p (aref vec i))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1596 (< i 0))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1597
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1598
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1599 (defun blank-display-char-on ()
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1600 "Turn on character display mapping."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1601 (when blank-display-mappings
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1602 (let (vecs vec)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1603 ;; 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
1604 (unless blank-display-table-was-local
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1605 (setq blank-display-table-was-local t
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1606 blank-display-table
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1607 (copy-sequence buffer-display-table)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1608 (unless buffer-display-table
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1609 (setq buffer-display-table (make-display-table)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1610 (dolist (entry blank-display-mappings)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1611 (setq vecs (cdr entry))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1612 ;; Get a displayable mapping.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1613 (while (and vecs
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1614 (not (blank-legal-display-vector-p (car vecs))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1615 (setq vecs (cdr vecs)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1616 ;; Display a valid mapping.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1617 (when vecs
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1618 (setq vec (copy-sequence (car vecs)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1619 (cond
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1620 ;; Any char except newline
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1621 ((not (eq (car entry) ?\n))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1622 (aset buffer-display-table (car entry) vec))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1623 ;; Newline char - display it
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1624 ((memq 'newline blank-active-chars)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1625 ;; 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
1626 ;; 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
1627 ;; faces, font-lock faces, etc.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1628 (when (memq 'color blank-active-style)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1629 (dotimes (i (length vec))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1630 ;; Due to limitations of glyph representation, the char
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1631 ;; 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
1632 ;; be fixed after Emacs unicode merging.
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1633 (or (eq (aref vec i) ?\n)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1634 (> (aref vec i) #x1FFFF)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1635 (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
1636 blank-newline)))))
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1637 ;; Display mapping
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1638 (aset buffer-display-table (car entry) vec))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1639 ;; Newline char - don't display it
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1640 (t
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1641 ;; Do nothing
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1642 )))))))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1643
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1644
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1645 (defun blank-display-char-off ()
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1646 "Turn off character display mapping."
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1647 (and blank-display-mappings
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1648 blank-display-table-was-local
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1649 (setq blank-display-table-was-local nil
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1650 buffer-display-table blank-display-table)))
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1651
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1652
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1653 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1654
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1655
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1656 (provide 'blank-mode)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1657
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1658
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1659 (run-hooks 'blank-load-hook)
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1660
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1661
79874
37b9cc9f1a31 Add arch tagline
Miles Bader <miles@gnu.org>
parents: 79869
diff changeset
1662 ;; arch-tag: 1b1e2500-dbd4-4a26-8f7a-5a5edfd3c97e
79869
a8237408c221 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1663 ;;; blank-mode.el ends here