annotate lisp/blank-mode.el @ 87905:038238619fec

Rename EMACS_ARG_Y to OPTION_DEFAULT_OFF, and EMACS_ARG_N to OPTION_DEFAULT_ON.
author Michael Olson <mwolson@gnu.org>
date Wed, 23 Jan 2008 03:43:32 +0000
parents 3f6dc5290b26
children 10a88d763b88
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: 87825
diff changeset
1 ;;; blank-mode.el --- minor mode to visualize TAB, (HARD) SPACE, NEWLINE
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
2
3842a0e47a00 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
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
4 ;; Free Software Foundation, Inc.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
5
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
6 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
7 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
8 ;; Keywords: data, wp
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
9 ;; Version: 8.1
87815
3842a0e47a00 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
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
11
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
13
3842a0e47a00 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
3842a0e47a00 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
3842a0e47a00 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
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
17 ;; option) any later version.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
18
3842a0e47a00 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
3842a0e47a00 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
3842a0e47a00 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
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
22 ;; General Public License for more details.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
23
3842a0e47a00 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
3842a0e47a00 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
3842a0e47a00 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,
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
27 ;; Boston, MA 02110-1301, USA.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
28
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
29 ;;; Commentary:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
30
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
31 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
32 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
33 ;; Introduction
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
34 ;; ------------
3842a0e47a00 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: 87825
diff changeset
36 ;; This package is a minor mode to visualize blanks (TAB, (HARD) SPACE
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
37 ;; and NEWLINE).
3842a0e47a00 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: 87825
diff changeset
39 ;; blank-mode uses two ways to visualize blanks: faces and display
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
40 ;; table.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
41 ;;
3842a0e47a00 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.
3842a0e47a00 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.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
44 ;;
3842a0e47a00 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,
3842a0e47a00 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
3842a0e47a00 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).
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
48 ;;
3842a0e47a00 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: 87825
diff changeset
50 ;; which way should be used to visualize blanks.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
51 ;;
3842a0e47a00 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
3842a0e47a00 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
3842a0e47a00 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,
3842a0e47a00 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
3842a0e47a00 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
3842a0e47a00 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
3842a0e47a00 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
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
59 ;; continues on after blank-mode is turned off.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
60 ;;
3842a0e47a00 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
3842a0e47a00 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'
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
63 ;; (which see) and `show-trailing-whitespace' (which see).
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
64 ;;
3842a0e47a00 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.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
66 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
67 ;; * Local blank-mode affects only the current buffer.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
68 ;;
3842a0e47a00 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
3842a0e47a00 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
3842a0e47a00 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
3842a0e47a00 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
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
73 ;; automagically turned on.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
74 ;;
3842a0e47a00 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
3842a0e47a00 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
3842a0e47a00 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
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
78 ;; you have enabled it globally.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
79 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
80 ;; When global and local blank-mode are on:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
81 ;;
3842a0e47a00 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
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
83 ;; the current buffer only.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
84 ;;
3842a0e47a00 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
3842a0e47a00 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.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
87 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
88 ;; To use blank-mode, insert in your ~/.emacs:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
89 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
90 ;; (require 'blank-mode)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
91 ;;
3842a0e47a00 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',
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
93 ;; `blank-toggle-options', `global-blank-mode' or
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
94 ;; `global-blank-toggle-options'. For example:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
95 ;;
3842a0e47a00 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: 87825
diff changeset
97 ;; "Toggle blank visualization." t)
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
98 ;; (autoload 'blank-toggle-options "blank-mode"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
99 ;; "Toggle local `blank-mode' options." t)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
100 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
101 ;; blank-mode was inspired by:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
102 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
103 ;; show-whitespace-mode.el Aurelien Tisne <aurelien.tisne@free.fr>
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
104 ;; Simple mode to highlight whitespaces
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
105 ;; (inspired the idea to use font-lock)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
106 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
107 ;; whitespace-mode.el Lawrence Mitchell <wence@gmx.li>
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
108 ;; Major mode for editing Whitespace
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
109 ;; (inspired the idea to use display table)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
110 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
111 ;; visws.el Miles Bader <miles@gnu.org>
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
112 ;; Make whitespace visible
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
113 ;; (handle display table, his code was modified, but the main
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
114 ;; idea was kept)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
115 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
116 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
117 ;; Using blank-mode
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
118 ;; ----------------
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
119 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
120 ;; There is no problem if you mix local and global minor mode usage.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
121 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
122 ;; * LOCAL blank-mode:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
123 ;; + To toggle blank-mode options locally, type:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
124 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
125 ;; M-x blank-toggle-options RET
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
126 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
127 ;; + To activate blank-mode locally, type:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
128 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
129 ;; C-u 1 M-x blank-mode RET
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
130 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
131 ;; + To deactivate blank-mode locally, type:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
132 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
133 ;; C-u 0 M-x blank-mode RET
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
134 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
135 ;; + To toggle blank-mode locally, type:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
136 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
137 ;; M-x blank-mode RET
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
138 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
139 ;; * GLOBAL blank-mode:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
140 ;; + To toggle blank-mode options globally, type:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
141 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
142 ;; M-x global-blank-toggle-options RET
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
143 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
144 ;; + To activate blank-mode globally, type:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
145 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
146 ;; C-u 1 M-x global-blank-mode RET
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
147 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
148 ;; + To deactivate blank-mode globally, type:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
149 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
150 ;; C-u 0 M-x global-blank-mode RET
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
151 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
152 ;; + To toggle blank-mode globally, type:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
153 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
154 ;; M-x global-blank-mode RET
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
155 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
156 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
157 ;; Hooks
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
158 ;; -----
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
159 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
160 ;; blank-mode has the following hook variables:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
161 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
162 ;; `blank-mode-hook'
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
163 ;; It is evaluated always when blank-mode is turned on locally.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
164 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
165 ;; `global-blank-mode-hook'
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
166 ;; It is evaluated always when blank-mode is turned on globally.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
167 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
168 ;; `blank-load-hook'
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
169 ;; It is evaluated after blank-mode package is loaded.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
170 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
171 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
172 ;; Options
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
173 ;; -------
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
174 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
175 ;; Below it's shown a brief description of blank-mode options, please,
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
176 ;; see the options declaration in the code for a long documentation.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
177 ;;
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
178 ;; `blank-style' Specify the visualization style.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
179 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
180 ;; `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: 87825
diff changeset
181 ;; visualized.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
182 ;;
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
183 ;; `blank-space' Face used to visualize SPACE.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
184 ;;
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
185 ;; `blank-hspace' Face used to visualize HARD SPACE.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
186 ;;
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
187 ;; `blank-tab' Face used to visualize TAB.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
188 ;;
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
189 ;; `blank-newline' Face used to visualize NEWLINE char
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
190 ;; mapping.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
191 ;;
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
192 ;; `blank-trailing' Face used to visualize trailing
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
193 ;; blanks.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
194 ;;
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
195 ;; `blank-line' Face used to visualize "long" lines.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
196 ;;
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
197 ;; `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: 87825
diff changeset
198 ;; TAB.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
199 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
200 ;; `blank-space-regexp' Specify SPACE characters regexp.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
201 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
202 ;; `blank-hspace-regexp' Specify HARD SPACE characters regexp.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
203 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
204 ;; `blank-tab-regexp' Specify TAB characters regexp.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
205 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
206 ;; `blank-trailing-regexp' Specify trailing characters regexp.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
207 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
208 ;; `blank-space-before-tab-regexp' Specify SPACEs before TAB
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
209 ;; regexp.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
210 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
211 ;; `blank-line-length' Specify length beyond which the line
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
212 ;; is highlighted.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
213 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
214 ;; `blank-display-mappings' Specify an alist of mappings for
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
215 ;; displaying characters.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
216 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
217 ;; `blank-global-modes' Modes for which global `blank-mode' is
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
218 ;; automagically turned on.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
219 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
220 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
221 ;; Acknowledgements
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
222 ;; ----------------
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
223 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
224 ;; Thanks to Juri Linkov <juri@jurta.org> for suggesting:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
225 ;; * `define-minor-mode'.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
226 ;; * `global-blank-*' name for global commands.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
227 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
228 ;; Thanks to Robert J. Chassell <bob@gnu.org> for doc fix and testing.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
229 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
230 ;; Thanks to Drew Adams <drew.adams@oracle.com> for toggle commands
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
231 ;; suggestion.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
232 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
233 ;; Thanks to Antti Kaihola <antti.kaihola@linux-aktivaattori.org> for
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
234 ;; helping to fix `find-file-hooks' reference.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
235 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
236 ;; Thanks to Andreas Roehler <andreas.roehler@easy-emacs.de> for
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
237 ;; indicating defface byte-compilation warnings.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
238 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
239 ;; Thanks to TimOCallaghan (EmacsWiki) for the idea about highlight
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
240 ;; "long" lines. See EightyColumnRule (EmacsWiki).
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
241 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
242 ;; Thanks to Yanghui Bian <yanghuibian@gmail.com> for indicating a new
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
243 ;; newline character mapping.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
244 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
245 ;; Thanks to Pete Forman <pete.forman@westgeo.com> for indicating
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
246 ;; whitespace-mode on XEmacs.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
247 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
248 ;; Thanks to Miles Bader <miles@gnu.org> for handling display table via
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
249 ;; visws.el (his code was modified, but the main idea was kept).
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
250 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
251 ;; Thanks to:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
252 ;; Aurelien Tisne <aurelien.tisne@free.fr> show-whitespace-mode.el
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
253 ;; Lawrence Mitchell <wence@gmx.li> whitespace-mode.el
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
254 ;; Miles Bader <miles@gnu.org> visws.el
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
255 ;; And to all people who contributed with them.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
256 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
257 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
258 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
259
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
260 ;;; code:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
261
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
262
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
263 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
264 ;;;; User Variables:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
265
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
266
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
267 ;;; Interface to the command system
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
268
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
269
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
270 (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: 87825
diff changeset
271 "Visualize blanks (TAB, (HARD) SPACE and NEWLINE)."
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
272 :link '(emacs-library-link :tag "Source Lisp File" "blank-mode.el")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
273 :version "22.2"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
274 :group 'wp
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
275 :group 'data)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
276
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
277
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
278 (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: 87825
diff changeset
279 "*Specify the visualization style.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
280
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
281 It's a list which element value can be:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
282
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
283 mark display mappings are visualized.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
284
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
285 color faces are visualized.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
286
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
287 Any other value is ignored.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
288
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
289 If nil, don't visualize TABs, (HARD) SPACEs and NEWLINEs.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
290
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
291 See also `blank-display-mappings' for documentation."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
292 :type '(repeat :tag "Style of Blank"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
293 (choice :tag "Style of Blank"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
294 (const :tag "Display Table" mark)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
295 (const :tag "Faces" color)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
296 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
297
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
298
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
299 (defcustom blank-chars
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
300 '(tabs spaces trailing lines space-before-tab newline)
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
301 "*Specify which kind of blank is visualized.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
302
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
303 It's a list which element value can be:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
304
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
305 trailing trailing blanks are visualized.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
306
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
307 tabs TABs are visualized.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
308
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
309 spaces SPACEs and HARD SPACEs are visualized.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
310
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
311 lines lines whose length is greater than
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
312 `blank-line-length' are highlighted.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
313
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
314 space-before-tab SPACEs before TAB are visualized.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
315
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
316 newline NEWLINEs are visualized.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
317
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
318 Any other value is ignored.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
319
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
320 If nil, don't visualize TABs, (HARD) SPACEs and NEWLINEs.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
321
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
322 Used when `blank-style' has `color' as an element.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
323 If `blank-chars' has `newline' as an element, used when `blank-style'
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
324 has `mark' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
325 :type '(repeat :tag "Kind of Blank"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
326 (choice :tag "Kind of Blank"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
327 (const :tag "Trailing TABs, SPACEs and HARD SPACEs"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
328 trailing)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
329 (const :tag "SPACEs and HARD SPACEs" spaces)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
330 (const :tag "TABs" tabs)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
331 (const :tag "Lines" lines)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
332 (const :tag "SPACEs before TAB"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
333 space-before-tab)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
334 (const :tag "NEWLINEs" newline)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
335 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
336
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
337
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
338 (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: 87825
diff changeset
339 "*Symbol face used to visualize SPACE.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
340
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
341 Used when `blank-style' has `color' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
342 :type 'face
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
343 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
344
3842a0e47a00 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: 87825
diff changeset
346 (defface blank-space
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
347 '((((class color) (background dark))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
348 (:background "grey20" :foreground "aquamarine3"))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
349 (((class color) (background light))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
350 (:background "LightYellow" :foreground "aquamarine3"))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
351 (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: 87825
diff changeset
352 "Face used to visualize SPACE."
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
353 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
354
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
355
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
356 (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: 87825
diff changeset
357 "*Symbol face used to visualize HARD SPACE.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
358
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
359 Used when `blank-style' has `color' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
360 :type 'face
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
361 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
362
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
363
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
364 (defface blank-hspace ; 'nobreak-space
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
365 '((((class color) (background dark))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
366 (:background "grey24" :foreground "aquamarine3"))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
367 (((class color) (background light))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
368 (:background "LemonChiffon3" :foreground "aquamarine3"))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
369 (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: 87825
diff changeset
370 "Face used to visualize HARD SPACE."
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
371 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
372
3842a0e47a00 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: 87825
diff changeset
374 (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: 87825
diff changeset
375 "*Symbol face used to visualize TAB.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
376
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
377 Used when `blank-style' has `color' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
378 :type 'face
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
379 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
380
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
381
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
382 (defface blank-tab
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
383 '((((class color) (background dark))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
384 (:background "grey22" :foreground "aquamarine3"))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
385 (((class color) (background light))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
386 (:background "beige" :foreground "aquamarine3"))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
387 (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: 87825
diff changeset
388 "Face used to visualize TAB."
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
389 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
390
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
391
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
392 (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: 87825
diff changeset
393 "*Symbol face used to visualize NEWLINE char mapping.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
394
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
395 See `blank-display-mappings'.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
396
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
397 Used when `blank-style' has `mark' and `color' as elements
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
398 and `blank-chars' has `newline' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
399 :type 'face
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
400 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
401
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
402
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
403 (defface blank-newline
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
404 '((((class color) (background dark))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
405 (:background "grey26" :foreground "aquamarine3" :bold t))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
406 (((class color) (background light))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
407 (:background "linen" :foreground "aquamarine3" :bold t))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
408 (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: 87825
diff changeset
409 "Face used to visualize NEWLINE char mapping.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
410
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
411 See `blank-display-mappings'."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
412 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
413
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
414
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
415 (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: 87825
diff changeset
416 "*Symbol face used to visualize traling blanks.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
417
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
418 Used when `blank-style' has `color' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
419 :type 'face
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
420 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
421
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
422
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
423 (defface blank-trailing ; 'trailing-whitespace
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
424 '((((class mono)) (:inverse-video t :bold t :underline t))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
425 (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: 87825
diff changeset
426 "Face used to visualize trailing blanks."
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
427 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
428
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
429
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
430 (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: 87825
diff changeset
431 "*Symbol face used to visualize \"long\" lines.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
432
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
433 See `blank-line-length'.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
434
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
435 Used when `blank-style' has `color' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
436 :type 'face
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
437 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
438
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
439
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
440 (defface blank-line
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
441 '((((class mono)) (:inverse-video t :bold t :underline t))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
442 (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: 87825
diff changeset
443 "Face used to visualize \"long\" lines.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
444
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
445 See `blank-line-length'."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
446 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
447
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
448
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
449 (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: 87825
diff changeset
450 "*Symbol face used to visualize SPACEs before TAB.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
451
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
452 Used when `blank-style' has `color' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
453 :type 'face
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
454 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
455
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
456
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
457 (defface blank-space-before-tab
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
458 '((((class mono)) (:inverse-video t :bold t :underline t))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
459 (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: 87825
diff changeset
460 "Face used to visualize SPACEs before TAB."
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
461 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
462
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
463
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
464 (defcustom blank-hspace-regexp
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
465 "\\(\\(\xA0\\|\x8A0\\|\x920\\|\xE20\\|\xF20\\)+\\)"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
466 "*Specify HARD SPACE characters regexp.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
467
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
468 If you're using `mule' package, it may exist other characters besides:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
469
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
470 \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \"\\xF20\"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
471
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
472 that should be considered HARD SPACE.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
473
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
474 Here are some examples:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
475
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
476 \"\\\\(^\\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: 87825
diff changeset
477 visualize only leading HARD SPACEs.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
478 \"\\\\(\\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: 87825
diff changeset
479 visualize only trailing HARD SPACEs.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
480 \"\\\\(^\\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: 87825
diff changeset
481 visualize leading and/or trailing HARD SPACEs.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
482 \"\\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: 87825
diff changeset
483 visualize only HARD SPACEs between TABs.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
484
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
485 NOTE: Enclose always by \\\\( and \\\\) the elements to highlight.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
486 Use exactly one pair of enclosing \\\\( and \\\\).
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
487
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
488 Used when `blank-style' has `color' as an element, and
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
489 `blank-chars' has `spaces' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
490 :type '(regexp :tag "HARD SPACE Chars")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
491 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
492
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
493
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
494 (defcustom blank-space-regexp "\\( +\\)"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
495 "*Specify SPACE characters regexp.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
496
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
497 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: 87825
diff changeset
498 besides \" \" that should be considered SPACE.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
499
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
500 Here are some examples:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
501
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
502 \"\\\\(^ +\\\\)\" 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: 87825
diff changeset
503 \"\\\\( +$\\\\)\" visualize only trailing SPACEs.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
504 \"\\\\(^ +\\\\| +$\\\\)\" \
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
505 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: 87825
diff changeset
506 \"\\t\\\\( +\\\\)\\t\" visualize only SPACEs between TABs.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
507
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
508 NOTE: Enclose always by \\\\( and \\\\) the elements to highlight.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
509 Use exactly one pair of enclosing \\\\( and \\\\).
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
510
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
511 Used when `blank-style' has `color' as an element, and
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
512 `blank-chars' has `spaces' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
513 :type '(regexp :tag "SPACE Chars")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
514 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
515
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
516
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
517 (defcustom blank-tab-regexp "\\(\t+\\)"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
518 "*Specify TAB characters regexp.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
519
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
520 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: 87825
diff changeset
521 besides \"\\t\" that should be considered TAB.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
522
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
523 Here are some examples:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
524
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
525 \"\\\\(^\\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: 87825
diff changeset
526 \"\\\\(\\t+$\\\\)\" visualize only trailing TABs.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
527 \"\\\\(^\\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: 87825
diff changeset
528 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: 87825
diff changeset
529 \" \\\\(\\t+\\\\) \" visualize only TABs between SPACEs.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
530
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
531 NOTE: Enclose always by \\\\( and \\\\) the elements to highlight.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
532 Use exactly one pair of enclosing \\\\( and \\\\).
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
533
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
534 Used when `blank-style' has `color' as an element, and
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
535 `blank-chars' has `tabs' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
536 :type '(regexp :tag "TAB Chars")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
537 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
538
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
539
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
540 (defcustom blank-trailing-regexp
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
541 "\t\\| \\|\xA0\\|\x8A0\\|\x920\\|\xE20\\|\xF20"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
542 "*Specify trailing characters regexp.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
543
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
544 If you're using `mule' package, it may exist other characters besides:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
545
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
546 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
547 \"\\xF20\"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
548
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
549 that should be considered blank.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
550
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
551 NOTE: DO NOT enclose by \\\\( and \\\\) the elements to highlight.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
552 `blank-mode' surrounds this regexp by \"\\\\(\\\\(\" and
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
553 \"\\\\)+\\\\)$\".
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
554
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
555 Used when `blank-style' has `color' as an element, and
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
556 `blank-chars' has `trailing' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
557 :type '(regexp :tag "Trailing Chars")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
558 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
559
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
560
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
561 (defcustom blank-space-before-tab-regexp "\\( +\\)\t"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
562 "*Specify SPACEs before TAB regexp.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
563
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
564 If you're using `mule' package, it may exist other characters besides:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
565
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
566 \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
567 \"\\xF20\"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
568
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
569 that should be considered blank.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
570
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
571 Used when `blank-style' has `color' as an element, and
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
572 `blank-chars' has `space-before-tab' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
573 :type '(regexp :tag "SPACEs Before TAB")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
574 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
575
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
576
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
577 (defcustom blank-line-length 80
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
578 "*Specify length beyond which the line is highlighted.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
579
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
580 Used when `blank-style' has `color' as an element, and
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
581 `blank-chars' has `lines' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
582 :type '(integer :tag "Line Length")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
583 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
584
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
585
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
586 ;; Hacked from `visible-whitespace-mappings' in visws.el
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
587 (defcustom blank-display-mappings
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
588 ;; Due to limitations of glyph representation, the char code can not
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
589 ;; be above ?\x1FFFF. Probably, this will be fixed after Emacs
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
590 ;; unicode merging.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
591 '(
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
592 (?\ [?\xB7] [?.]) ; space - centered dot
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
593 (?\xA0 [?\xA4] [?_]) ; hard space - currency
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
594 (?\x8A0 [?\x8A4] [?_]) ; hard space - currency
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
595 (?\x920 [?\x924] [?_]) ; hard space - currency
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
596 (?\xE20 [?\xE24] [?_]) ; hard space - currency
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
597 (?\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: 87825
diff changeset
598 ;; NEWLINE is displayed using the face `blank-newline'
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
599 (?\n [?$ ?\n]) ; end-of-line - dollar sign
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
600 ;; (?\n [?\u21B5 ?\n] [?$ ?\n]) ; end-of-line - downwards arrow
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
601 ;; (?\n [?\xB6 ?\n] [?$ ?\n]) ; end-of-line - pilcrow
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
602 ;; (?\n [?\x8AF ?\n] [?$ ?\n]) ; end-of-line - overscore
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
603 ;; (?\n [?\x8AC ?\n] [?$ ?\n]) ; end-of-line - negation
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
604 ;; (?\n [?\x8B0 ?\n] [?$ ?\n]) ; end-of-line - grade
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
605 ;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
606 ;; WARNING: the mapping below has a problem.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
607 ;; When a TAB occupies exactly one column, it will display the
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
608 ;; character ?\xBB at that column followed by a TAB which goes to
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
609 ;; the next TAB column.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
610 ;; If this is a problem for you, please, comment the line below.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
611 (?\t [?\xBB ?\t] [?\\ ?\t]) ; tab - left quote mark
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
612 )
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
613 "*Specify an alist of mappings for displaying characters.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
614
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
615 Each element has the following form:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
616
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
617 (CHAR VECTOR...)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
618
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
619 Where:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
620
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
621 CHAR is the character to be mapped.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
622
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
623 VECTOR is a vector of characters to be displayed in place of CHAR.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
624 The first display vector that can be displayed is used;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
625 if no display vector for a mapping can be displayed, then
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
626 that character is displayed unmodified.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
627
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
628 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: 87825
diff changeset
629 `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: 87825
diff changeset
630 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: 87825
diff changeset
631 is above #x1FFFF.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
632
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
633 Used when `blank-style' has `mark' as an element."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
634 :type '(repeat
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
635 (list :tag "Character Mapping"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
636 (character :tag "Char")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
637 (repeat :inline t :tag "Vector List"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
638 (vector :tag ""
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
639 (repeat :inline t
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
640 :tag "Vector Characters"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
641 (character :tag "Char"))))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
642 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
643
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
644
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
645 (defcustom blank-global-modes t
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
646 "*Modes for which global `blank-mode' is automagically turned on.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
647
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
648 Global `blank-mode' is controlled by the command `global-blank-mode'.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
649
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
650 If nil, means no modes have `blank-mode' automatically turned on.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
651 If t, all modes that support `blank-mode' have it automatically
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
652 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: 87825
diff changeset
653 Else it should be a list of `major-mode' symbol names for
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
654 which `blank-mode' should be automatically turned on. The sense
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
655 of the list is negated if it begins with `not'. For example:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
656
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
657 (c-mode c++-mode)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
658
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
659 means that `blank-mode' is turned on for buffers in C and C++
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
660 modes only."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
661 :type '(choice (const :tag "none" nil)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
662 (const :tag "all" t)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
663 (set :menu-tag "mode specific" :tag "modes"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
664 :value (not)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
665 (const :tag "Except" not)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
666 (repeat :inline t
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
667 (symbol :tag "mode"))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
668 :group 'blank)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
669
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
670
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
671 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
672 ;;;; User commands - Local mode
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
673
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
674
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
675 ;;;###autoload
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
676 (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: 87825
diff changeset
677 "Toggle blank minor mode visualization (\"bl\" on modeline).
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
678
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
679 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: 87825
diff changeset
680 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: 87825
diff changeset
681 otherwise, turn off visualization.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
682 Only useful with a windowing system."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
683 :lighter " bl"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
684 :init-value nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
685 :global nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
686 :group 'blank
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
687 (cond
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
688 (noninteractive ; running a batch job
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
689 (setq blank-mode nil))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
690 (blank-mode ; blank-mode on
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
691 (blank-turn-on))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
692 (t ; blank-mode off
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
693 (blank-turn-off))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
694
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
695
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
696 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
697 ;;;; User commands - Global mode
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
698
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
699
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
700 (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: 87825
diff changeset
701 "Toggle blank global minor mode visualization (\"BL\" on modeline).
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
702
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
703 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: 87825
diff changeset
704 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: 87825
diff changeset
705 otherwise, turn off visualization.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
706 Only useful with a windowing system."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
707 :lighter " BL"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
708 :init-value nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
709 :global t
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
710 :group 'blank
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
711 (cond
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
712 (noninteractive ; running a batch job
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
713 (setq global-blank-mode nil))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
714 (global-blank-mode ; global-blank-mode on
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
715 (save-excursion
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
716 (if (boundp 'find-file-hook)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
717 (add-hook 'find-file-hook 'blank-turn-on-if-enabled t)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
718 (add-hook 'find-file-hooks 'blank-turn-on-if-enabled t))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
719 (dolist (buffer (buffer-list)) ; adjust all local mode
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
720 (set-buffer buffer)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
721 (unless blank-mode
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
722 (blank-turn-on-if-enabled)))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
723 (t ; global-blank-mode off
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
724 (save-excursion
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
725 (if (boundp 'find-file-hook)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
726 (remove-hook 'find-file-hook 'blank-turn-on-if-enabled)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
727 (remove-hook 'find-file-hooks 'blank-turn-on-if-enabled))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
728 (dolist (buffer (buffer-list)) ; adjust all local mode
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
729 (set-buffer buffer)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
730 (unless blank-mode
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
731 (blank-turn-off)))))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
732
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
733
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
734 (defun blank-turn-on-if-enabled ()
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
735 (when (cond
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
736 ((eq blank-global-modes t))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
737 ((listp blank-global-modes)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
738 (if (eq (car-safe blank-global-modes) 'not)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
739 (not (memq major-mode (cdr blank-global-modes)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
740 (memq major-mode blank-global-modes)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
741 (t nil))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
742 (let (inhibit-quit)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
743 ;; Don't turn on blank mode if...
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
744 (or
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
745 ;; ...we don't have a display (we're running a batch job)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
746 noninteractive
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
747 ;; ...or if the buffer is invisible (name starts with a space)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
748 (eq (aref (buffer-name) 0) ?\ )
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
749 ;; ...or if the buffer is temporary (name starts with *)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
750 (and (eq (aref (buffer-name) 0) ?*)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
751 ;; except the scratch buffer.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
752 (not (string= (buffer-name) "*scratch*")))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
753 ;; Otherwise, turn on blank mode.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
754 (blank-turn-on)))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
755
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
756
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
757 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
758 ;;;; User commands - Toggle
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
759
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
760
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
761 (defconst blank-chars-value-list
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
762 '(tabs
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
763 spaces
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
764 trailing
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
765 space-before-tab
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
766 lines
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
767 newline
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
768 )
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
769 "List of valid `blank-chars' values.")
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
770
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
771
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
772 (defconst blank-style-value-list
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
773 '(color
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
774 mark
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
775 )
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
776 "List of valid `blank-style' values.")
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
777
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
778
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
779 (defconst blank-toggle-option-alist
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
780 '((?t . tabs)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
781 (?s . spaces)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
782 (?r . trailing)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
783 (?b . space-before-tab)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
784 (?l . lines)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
785 (?n . newline)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
786 (?c . color)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
787 (?m . mark)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
788 (?x . blank-chars)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
789 (?z . blank-style)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
790 )
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
791 "Alist of toggle options.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
792
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
793 Each element has the form:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
794
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
795 (CHAR . SYMBOL)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
796
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
797 Where:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
798
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
799 CHAR is a char which the user will have to type.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
800
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
801 SYMBOL is a valid symbol associated with CHAR.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
802 See `blank-chars-value-list' and `blank-style-value-list'.")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
803
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
804
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
805 (defvar blank-active-chars nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
806 "Used to save locally `blank-chars' value.")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
807 (make-variable-buffer-local 'blank-active-chars)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
808
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
809 (defvar blank-active-style nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
810 "Used to save locally `blank-style' value.")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
811 (make-variable-buffer-local 'blank-active-style)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
812
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
813
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
814 ;;;###autoload
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
815 (defun blank-toggle-options (arg)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
816 "Toggle local `blank-mode' options.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
817
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
818 If local blank-mode is off, toggle the option given by ARG and
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
819 turn on local blank-mode.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
820
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
821 If local blank-mode is on, toggle the option given by ARG and
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
822 restart local blank-mode.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
823
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
824 Interactively, it reads one of the following chars:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
825
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
826 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: 87825
diff changeset
827 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: 87825
diff changeset
828 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: 87825
diff changeset
829 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: 87825
diff changeset
830 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: 87825
diff changeset
831 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: 87825
diff changeset
832 n toggle NEWLINE visualization
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
833 c toggle color faces
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
834 m toggle visual mark
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
835 x restore `blank-chars' value
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
836 z restore `blank-style' value
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
837 ? display brief help
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
838
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
839 Non-interactively, ARG should be a symbol or a list of symbols.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
840 The valid symbols are:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
841
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
842 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: 87825
diff changeset
843 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: 87825
diff changeset
844 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: 87825
diff changeset
845 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: 87825
diff changeset
846 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: 87825
diff changeset
847 newline toggle NEWLINE visualization
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
848 color toggle color faces
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
849 mark toggle visual mark
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
850 blank-chars restore `blank-chars' value
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
851 blank-style restore `blank-style' value
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
852
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
853 Only useful with a windowing system."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
854 (interactive (blank-interactive-char t))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
855 (let ((blank-chars
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
856 (blank-toggle-list t arg blank-active-chars blank-chars
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
857 'blank-chars blank-chars-value-list))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
858 (blank-style
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
859 (blank-toggle-list t arg blank-active-style blank-style
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
860 'blank-style blank-style-value-list)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
861 (blank-mode 0)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
862 (blank-mode 1)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
863
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
864
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
865 (defvar blank-toggle-chars nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
866 "Used to toggle the global `blank-chars' value.")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
867 (defvar blank-toggle-style nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
868 "Used to toggle the global `blank-style' value.")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
869
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
870
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
871 ;;;###autoload
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
872 (defun global-blank-toggle-options (arg)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
873 "Toggle global `blank-mode' options.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
874
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
875 If global blank-mode is off, toggle the option given by ARG and
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
876 turn on global blank-mode.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
877
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
878 If global blank-mode is on, toggle the option given by ARG and
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
879 restart global blank-mode.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
880
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
881 Interactively, it reads one of the following chars:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
882
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
883 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: 87825
diff changeset
884 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: 87825
diff changeset
885 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: 87825
diff changeset
886 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: 87825
diff changeset
887 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: 87825
diff changeset
888 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: 87825
diff changeset
889 n toggle NEWLINE visualization
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
890 c toggle color faces
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
891 m toggle visual mark
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
892 x restore `blank-chars' value
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
893 z restore `blank-style' value
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
894 ? display brief help
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
895
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
896 Non-interactively, ARG should be a symbol or a list of symbols.
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
897 The valid symbols are:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
898
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
899 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: 87825
diff changeset
900 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: 87825
diff changeset
901 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: 87825
diff changeset
902 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: 87825
diff changeset
903 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: 87825
diff changeset
904 newline toggle NEWLINE visualization
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
905 color toggle color faces
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
906 mark toggle visual mark
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
907 blank-chars restore `blank-chars' value
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
908 blank-style restore `blank-style' value
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
909
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
910 Only useful with a windowing system."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
911 (interactive (blank-interactive-char nil))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
912 (let ((blank-chars
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
913 (blank-toggle-list nil arg blank-toggle-chars blank-chars
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
914 'blank-chars blank-chars-value-list))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
915 (blank-style
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
916 (blank-toggle-list nil arg blank-toggle-style blank-style
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
917 'blank-style blank-style-value-list)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
918 (setq blank-toggle-chars blank-chars
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
919 blank-toggle-style blank-style)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
920 (global-blank-mode 0)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
921 (global-blank-mode 1)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
922
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
923
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
924 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
925 ;;;; Internal functions
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
926
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
927
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
928 (defvar blank-font-lock-mode nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
929 "Used to remember whether a buffer had font lock mode on or not.")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
930 (make-variable-buffer-local 'blank-font-lock-mode)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
931
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
932 (defvar blank-font-lock nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
933 "Used to remember whether a buffer initially had font lock on or not.")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
934 (make-variable-buffer-local 'blank-font-lock)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
935
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
936 (defvar blank-font-lock-keywords nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
937 "Used to save locally `font-lock-keywords' value.")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
938 (make-variable-buffer-local 'blank-font-lock-keywords)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
939
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
940
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
941 (defconst blank-help-text
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
942 "\
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
943 blank-mode toggle options:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
944
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
945 [] 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: 87825
diff changeset
946 [] 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: 87825
diff changeset
947 [] 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: 87825
diff changeset
948 [] 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: 87825
diff changeset
949 [] 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: 87825
diff changeset
950 [] n - toggle NEWLINE visualization
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
951
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
952 [] c - toggle color faces
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
953 [] m - toggle visual mark
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
954
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
955 x - restore `blank-chars' value
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
956 z - restore `blank-style' value
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
957
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
958 ? - display this text\n\n"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
959 "Text for blank toggle options.")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
960
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
961
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
962 (defconst blank-help-buffer-name "*Blank Toggle Options*"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
963 "The buffer name for blank toggle options.")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
964
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
965
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
966 (defun blank-insert-option-mark (the-list the-value)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
967 "Insert the option mark ('X' or ' ') in toggle options buffer."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
968 (forward-line 1)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
969 (dolist (sym the-list)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
970 (forward-line 1)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
971 (forward-char 2)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
972 (insert (if (memq sym the-value) "X" " "))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
973
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
974
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
975 (defun blank-help-on (chars style)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
976 "Display the blank toggle options."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
977 (unless (get-buffer blank-help-buffer-name)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
978 (delete-other-windows)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
979 (let ((buffer (get-buffer-create blank-help-buffer-name)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
980 (save-excursion
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
981 (set-buffer buffer)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
982 (erase-buffer)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
983 (insert blank-help-text)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
984 (goto-char (point-min))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
985 (blank-insert-option-mark blank-chars-value-list chars)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
986 (blank-insert-option-mark blank-style-value-list style)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
987 (goto-char (point-min))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
988 (set-buffer-modified-p nil)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
989 (let ((size (- (window-height)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
990 (max window-min-height
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
991 (1+ (count-lines (point-min) (point-max)))))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
992 (when (<= size 0)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
993 (kill-buffer buffer)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
994 (error "Frame height is too small; \
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
995 can't split window to display blank toggle options"))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
996 (set-window-buffer (split-window nil size) buffer))))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
997
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
998
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
999 (defun blank-help-off ()
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1000 "Remove the buffer and window of the blank toggle options."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1001 (let ((buffer (get-buffer blank-help-buffer-name)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1002 (when buffer
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1003 (delete-windows-on buffer)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1004 (kill-buffer buffer))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1005
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1006
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1007 (defun blank-interactive-char (local-p)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1008 "Interactive function to read a char and return a symbol.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1009
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1010 If LOCAL-P is non-nil, it uses a local context; otherwise, it
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1011 uses a global context.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1012
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1013 It reads one of the following chars:
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1014
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1015 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: 87825
diff changeset
1016 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: 87825
diff changeset
1017 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: 87825
diff changeset
1018 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: 87825
diff changeset
1019 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: 87825
diff changeset
1020 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: 87825
diff changeset
1021 n toggle NEWLINE visualization
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1022 c toggle color faces
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1023 m toggle visual mark
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1024 x restore `blank-chars' value
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1025 z restore `blank-style' value
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1026 ? display brief help
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1027
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1028 See also `blank-toggle-option-alist'."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1029 (let* ((is-off (not (if local-p blank-mode global-blank-mode)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1030 (chars (cond (is-off blank-chars) ; use default value
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1031 (local-p blank-active-chars)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1032 (t blank-toggle-chars)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1033 (style (cond (is-off blank-style) ; use default value
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1034 (local-p blank-active-style)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1035 (t blank-toggle-style)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1036 (prompt
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1037 (format "Blank Toggle %s (type ? for further options)-"
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1038 (if local-p "Local" "Global")))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1039 ch sym)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1040 ;; read a valid option and get the corresponding symbol
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1041 (save-window-excursion
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1042 (condition-case data
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1043 (progn
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1044 (while
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1045 ;; while condition
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1046 (progn
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1047 (setq ch (read-char prompt))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1048 (not
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1049 (setq sym
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1050 (cdr (assq ch blank-toggle-option-alist)))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1051 ;; while body
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1052 (if (eq ch ?\?)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1053 (blank-help-on chars style)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1054 (ding)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1055 (blank-help-off)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1056 (message " ")) ; clean echo area
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1057 ;; handler
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1058 ((quit error)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1059 (blank-help-off)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1060 (error (error-message-string data)))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1061 (list sym))) ; return the apropriate symbol
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1062
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1063
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1064 (defun blank-toggle-list (local-p arg the-list default-list
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1065 sym-restore sym-list)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1066 "Toggle options in THE-LIST based on list ARG.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1067
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1068 If LOCAL-P is non-nil, it uses a local context; otherwise, it
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1069 uses a global context.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1070
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1071 ARG is a list of options to be toggled.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1072
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1073 THE-LIST is a list of options. This list will be toggled and the
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1074 resultant list will be returned.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1075
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1076 DEFAULT-LIST is the default list of options. It is used to
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1077 restore the options in THE-LIST.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1078
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1079 SYM-RESTORE is the symbol which indicates to restore the options
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1080 in THE-LIST.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1081
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1082 SYM-LIST is a list of valid options, used to check if the ARG's
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1083 options are valid."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1084 (unless (if local-p blank-mode global-blank-mode)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1085 (setq the-list default-list))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1086 (setq the-list (copy-sequence the-list)) ; keep original list
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1087 (dolist (sym (if (listp arg) arg (list arg)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1088 (cond
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1089 ;; restore default values
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1090 ((eq sym sym-restore)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1091 (setq the-list default-list))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1092 ;; toggle valid values
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1093 ((memq sym sym-list)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1094 (setq the-list (if (memq sym the-list)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1095 (delq sym the-list)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1096 (cons sym the-list))))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1097 the-list)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1098
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1099
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1100 (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: 87825
diff changeset
1101 "Turn on blank visualization."
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1102 (setq blank-active-style (if (listp blank-style)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1103 blank-style
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1104 (list blank-style)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1105 (setq blank-active-chars (if (listp blank-chars)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1106 blank-chars
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1107 (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: 87825
diff changeset
1108 (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: 87825
diff changeset
1109 (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: 87825
diff changeset
1110 (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: 87825
diff changeset
1111 (blank-display-char-on)))
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1112
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1113
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1114 (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: 87825
diff changeset
1115 "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: 87825
diff changeset
1116 (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: 87825
diff changeset
1117 (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: 87825
diff changeset
1118 (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: 87825
diff changeset
1119 (blank-display-char-off)))
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1120
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1121
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1122 (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: 87825
diff changeset
1123 "Turn on color visualization."
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1124 (when blank-active-chars
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1125 (unless blank-font-lock
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1126 (setq blank-font-lock t
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1127 blank-font-lock-keywords
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1128 (copy-sequence font-lock-keywords)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1129 ;; turn off font lock
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1130 (setq blank-font-lock-mode font-lock-mode)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1131 (font-lock-mode 0)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1132 ;; add blank-mode color into font lock
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1133 (when (memq 'spaces blank-active-chars)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1134 (font-lock-add-keywords
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1135 nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1136 (list
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1137 ;; 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: 87825
diff changeset
1138 (list blank-space-regexp 1 blank-space t)
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1139 ;; 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: 87825
diff changeset
1140 (list blank-hspace-regexp 1 blank-hspace t))
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1141 t))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1142 (when (memq 'tabs blank-active-chars)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1143 (font-lock-add-keywords
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1144 nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1145 (list
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1146 ;; 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: 87825
diff changeset
1147 (list blank-tab-regexp 1 blank-tab t))
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1148 t))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1149 (when (memq 'trailing blank-active-chars)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1150 (font-lock-add-keywords
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1151 nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1152 (list
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1153 ;; Show trailing blanks
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1154 (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: 87825
diff changeset
1155 1 blank-trailing t))
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1156 t))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1157 (when (memq 'lines blank-active-chars)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1158 (font-lock-add-keywords
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1159 nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1160 (list
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1161 ;; Show "long" lines
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1162 (list (concat "^\\(.\\{" (int-to-string blank-line-length)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1163 ",\\}\\)$")
87878
3f6dc5290b26 Fix problem with cleanning blank faces when turniing off blank-mode. Eliminate -face suffix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 87825
diff changeset
1164 1 blank-line t))
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1165 t))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1166 (when (memq 'space-before-tab blank-active-chars)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1167 (font-lock-add-keywords
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1168 nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1169 (list
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1170 ;; Show SPACEs before TAB
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1171 (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: 87825
diff changeset
1172 1 blank-space-before-tab t))
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1173 t))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1174 ;; now turn on font lock and highlight blanks
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1175 (font-lock-mode 1)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1176
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1177
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1178 (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: 87825
diff changeset
1179 "Turn off color visualization."
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1180 (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: 87825
diff changeset
1181 ;; 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: 87825
diff changeset
1182 (font-lock-mode 0)
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1183 (when blank-font-lock
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1184 (setq blank-font-lock nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1185 font-lock-keywords blank-font-lock-keywords))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1186 ;; restore original font lock state
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1187 (font-lock-mode blank-font-lock-mode)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1188
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1189
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1190 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1191 ;;;; Hacked from visws.el (Miles Bader <miles@gnu.org>)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1192
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1193
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1194 (defvar blank-display-table nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1195 "Used to save a local display table.")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1196 (make-variable-buffer-local 'blank-display-table)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1197
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1198 (defvar blank-display-table-was-local nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1199 "Used to remember whether a buffer initially had a local display table or not.")
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1200 (make-variable-buffer-local 'blank-display-table-was-local)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1201
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1202
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1203 (defsubst blank-char-valid-p (char)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1204 ;; This check should be improved!!!
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1205 (or (< char 256)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1206 (char-valid-p char)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1207
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1208
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1209 (defun blank-legal-display-vector-p (vec)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1210 "Return true if every character in vector VEC can be displayed."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1211 (let ((i (length vec)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1212 (when (> i 0)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1213 (while (and (>= (setq i (1- i)) 0)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1214 (blank-char-valid-p (aref vec i))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1215 (< i 0))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1216
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1217
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1218 (defun blank-display-char-on ()
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1219 "Turn on character display mapping."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1220 (when blank-display-mappings
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1221 (let (vecs vec)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1222 ;; Remember whether a buffer has a local display table.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1223 (unless blank-display-table-was-local
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1224 (setq blank-display-table-was-local t
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1225 blank-display-table
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1226 (copy-sequence buffer-display-table)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1227 (unless buffer-display-table
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1228 (setq buffer-display-table (make-display-table)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1229 (dolist (entry blank-display-mappings)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1230 (setq vecs (cdr entry))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1231 ;; Get a displayable mapping.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1232 (while (and vecs
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1233 (not (blank-legal-display-vector-p (car vecs))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1234 (setq vecs (cdr vecs)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1235 ;; Display a valid mapping.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1236 (when vecs
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1237 (setq vec (copy-sequence (car vecs)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1238 (cond
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1239 ;; Any char except newline
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1240 ((not (eq (car entry) ?\n))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1241 (aset buffer-display-table (car entry) vec))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1242 ;; Newline char - display it
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1243 ((memq 'newline blank-active-chars)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1244 ;; Only insert face bits on NEWLINE char mapping to avoid
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1245 ;; obstruction of other faces like TABs and (HARD) SPACEs
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1246 ;; faces, font-lock faces, etc.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1247 (when (memq 'color blank-active-style)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1248 (dotimes (i (length vec))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1249 ;; Due to limitations of glyph representation, the char
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1250 ;; code can not be above ?\x1FFFF. Probably, this will
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1251 ;; be fixed after Emacs unicode merging.
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1252 (or (eq (aref vec i) ?\n)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1253 (> (aref vec i) #x1FFFF)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1254 (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: 87825
diff changeset
1255 blank-newline)))))
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1256 ;; Display mapping
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1257 (aset buffer-display-table (car entry) vec))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1258 ;; Newline char - don't display it
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1259 (t
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1260 ;; Do nothing
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1261 )))))))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1262
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1263
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1264 (defun blank-display-char-off ()
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1265 "Turn off character display mapping."
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1266 (and blank-display-mappings
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1267 blank-display-table-was-local
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1268 (setq blank-display-table-was-local nil
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1269 buffer-display-table blank-display-table)))
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1270
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1271
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1272 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1273
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1274
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1275 (provide 'blank-mode)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1276
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1277
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1278 (run-hooks 'blank-load-hook)
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1279
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1280
87825
2427d974638e Add arch tagline
Miles Bader <miles@gnu.org>
parents: 87815
diff changeset
1281 ;; arch-tag: 1b1e2500-dbd4-4a26-8f7a-5a5edfd3c97e
87815
3842a0e47a00 New file: blank-mode.el
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1282 ;;; blank-mode.el ends here