2017-07-29 14:25:49 +00:00
|
|
|
|
;;; whitespace.el --- minor mode to visualize TAB, (HARD) SPACE, NEWLINE -*- lexical-binding: t -*-
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2019-01-01 00:59:58 +00:00
|
|
|
|
;; Copyright (C) 2000-2019 Free Software Foundation, Inc.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2017-10-29 22:28:58 +00:00
|
|
|
|
;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com>
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; Keywords: data, wp
|
2011-10-31 00:37:09 +00:00
|
|
|
|
;; Version: 13.2.2
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
|
|
|
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
2008-05-06 08:06:51 +00:00
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-05-06 08:06:51 +00:00
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 22:52:52 +00:00
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;;
|
|
|
|
|
;; Introduction
|
|
|
|
|
;; ------------
|
|
|
|
|
;;
|
2008-01-21 12:45:58 +00:00
|
|
|
|
;; This package is a minor mode to visualize blanks (TAB, (HARD) SPACE
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; and NEWLINE).
|
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; whitespace uses two ways to visualize blanks: faces and display
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; table.
|
|
|
|
|
;;
|
|
|
|
|
;; * Faces are used to highlight the background with a color.
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; whitespace uses font-lock to highlight blank characters.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
|
|
|
|
;; * Display table changes the way a character is displayed, that is,
|
|
|
|
|
;; it provides a visual mark for characters, for example, at the end
|
|
|
|
|
;; of line (?\xB6), at SPACEs (?\xB7) and at TABs (?\xBB).
|
|
|
|
|
;;
|
2008-04-26 12:38:54 +00:00
|
|
|
|
;; The `whitespace-style' variable selects which way blanks are
|
|
|
|
|
;; visualized.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; Note that when whitespace is turned on, whitespace saves the
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; font-lock state, that is, if font-lock is on or off. And
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; whitespace restores the font-lock state when it is turned off. So,
|
|
|
|
|
;; if whitespace is turned on and font-lock is off, whitespace also
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; turns on the font-lock to highlight blanks, but the font-lock will
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; be turned off when whitespace is turned off. Thus, turn on
|
|
|
|
|
;; font-lock before whitespace is on, if you want that font-lock
|
|
|
|
|
;; continues on after whitespace is turned off.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; When whitespace is on, it takes care of highlighting some special
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; characters over the default mechanism of `nobreak-char-display'
|
|
|
|
|
;; (which see) and `show-trailing-whitespace' (which see).
|
|
|
|
|
;;
|
2009-10-05 02:17:57 +00:00
|
|
|
|
;; The trailing spaces are not highlighted while point is at end of line.
|
|
|
|
|
;; Also the spaces at beginning of buffer are not highlighted while point is at
|
|
|
|
|
;; beginning of buffer; and the spaces at end of buffer are not highlighted
|
|
|
|
|
;; while point is at end of buffer.
|
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; There are two ways of using whitespace: local and global.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; * Local whitespace affects only the current buffer.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; * Global whitespace affects all current and future buffers. That
|
|
|
|
|
;; is, if you turn on global whitespace and then create a new
|
|
|
|
|
;; buffer, the new buffer will also have whitespace on. The
|
|
|
|
|
;; `whitespace-global-modes' variable controls which major-mode will
|
|
|
|
|
;; be automagically turned on.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
|
|
|
|
;; You can mix the local and global usage without any conflict. But
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; local whitespace has priority over global whitespace. Whitespace
|
|
|
|
|
;; mode is active in a buffer if you have enabled it in that buffer or
|
|
|
|
|
;; if you have enabled it globally.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; When global and local whitespace are on:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; * if local whitespace is turned off, whitespace is turned off for
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; the current buffer only.
|
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; * if global whitespace is turned off, whitespace continues on only
|
|
|
|
|
;; in the buffers in which local whitespace is on.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; To use whitespace, insert in your ~/.emacs:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2009-12-10 22:58:40 +00:00
|
|
|
|
;; (require 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; Or autoload at least one of the commands`whitespace-mode',
|
|
|
|
|
;; `whitespace-toggle-options', `global-whitespace-mode' or
|
|
|
|
|
;; `global-whitespace-toggle-options'. For example:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; (autoload 'whitespace-mode "whitespace"
|
|
|
|
|
;; "Toggle whitespace visualization." t)
|
|
|
|
|
;; (autoload 'whitespace-toggle-options "whitespace"
|
|
|
|
|
;; "Toggle local `whitespace-mode' options." t)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; whitespace was inspired by:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-25 14:09:57 +00:00
|
|
|
|
;; whitespace.el Rajesh Vaidheeswarran <rv@gnu.org>
|
|
|
|
|
;; Warn about and clean bogus whitespaces in the file
|
|
|
|
|
;; (inspired the idea to warn and clean some blanks)
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; This was the original `whitespace.el' which was replaced by
|
|
|
|
|
;; `blank-mode.el'. And later `blank-mode.el' was renamed to
|
|
|
|
|
;; `whitespace.el'.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
;;
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; show-whitespace-mode.el Aurelien Tisne <aurelien.tisne@free.fr>
|
|
|
|
|
;; Simple mode to highlight whitespaces
|
|
|
|
|
;; (inspired the idea to use font-lock)
|
|
|
|
|
;;
|
|
|
|
|
;; whitespace-mode.el Lawrence Mitchell <wence@gmx.li>
|
|
|
|
|
;; Major mode for editing Whitespace
|
|
|
|
|
;; (inspired the idea to use display table)
|
|
|
|
|
;;
|
|
|
|
|
;; visws.el Miles Bader <miles@gnu.org>
|
|
|
|
|
;; Make whitespace visible
|
|
|
|
|
;; (handle display table, his code was modified, but the main
|
|
|
|
|
;; idea was kept)
|
|
|
|
|
;;
|
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; Using whitespace
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; ----------------
|
|
|
|
|
;;
|
|
|
|
|
;; There is no problem if you mix local and global minor mode usage.
|
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; * LOCAL whitespace:
|
|
|
|
|
;; + To toggle whitespace options locally, type:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; M-x whitespace-toggle-options RET
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; + To activate whitespace locally, type:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; C-u 1 M-x whitespace-mode RET
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; + To deactivate whitespace locally, type:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; C-u 0 M-x whitespace-mode RET
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; + To toggle whitespace locally, type:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; M-x whitespace-mode RET
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; * GLOBAL whitespace:
|
|
|
|
|
;; + To toggle whitespace options globally, type:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; M-x global-whitespace-toggle-options RET
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; + To activate whitespace globally, type:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; C-u 1 M-x global-whitespace-mode RET
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; + To deactivate whitespace globally, type:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; C-u 0 M-x global-whitespace-mode RET
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; + To toggle whitespace globally, type:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; M-x global-whitespace-mode RET
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-25 14:09:57 +00:00
|
|
|
|
;; There are also the following useful commands:
|
|
|
|
|
;;
|
2008-07-24 04:12:27 +00:00
|
|
|
|
;; `whitespace-newline-mode'
|
2012-06-02 10:56:09 +00:00
|
|
|
|
;; Toggle NEWLINE minor mode visualization ("nl" on mode line).
|
2008-07-24 04:12:27 +00:00
|
|
|
|
;;
|
|
|
|
|
;; `global-whitespace-newline-mode'
|
2012-06-02 10:56:09 +00:00
|
|
|
|
;; Toggle NEWLINE global minor mode visualization ("NL" on mode line).
|
2008-07-24 04:12:27 +00:00
|
|
|
|
;;
|
2008-03-01 19:00:24 +00:00
|
|
|
|
;; `whitespace-report'
|
|
|
|
|
;; Report some blank problems in buffer.
|
|
|
|
|
;;
|
|
|
|
|
;; `whitespace-report-region'
|
|
|
|
|
;; Report some blank problems in a region.
|
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; `whitespace-cleanup'
|
2008-01-25 14:09:57 +00:00
|
|
|
|
;; Cleanup some blank problems in all buffer or at region.
|
2016-10-21 14:20:07 +00:00
|
|
|
|
;; See the function's docstring for more information.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; `whitespace-cleanup-region'
|
2008-01-25 14:09:57 +00:00
|
|
|
|
;; Cleanup some blank problems at region.
|
|
|
|
|
;;
|
2016-10-21 14:20:07 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Options
|
|
|
|
|
;; -------
|
|
|
|
|
;;
|
|
|
|
|
;; Whitespace's behavior can be changed with `M-x customize-group
|
|
|
|
|
;; whitespace', which see for the full list of options.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
;;
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Hooks
|
|
|
|
|
;; -----
|
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; whitespace has the following hook variables:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; `whitespace-mode-hook'
|
|
|
|
|
;; It is evaluated always when whitespace is turned on locally.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; `global-whitespace-mode-hook'
|
|
|
|
|
;; It is evaluated always when whitespace is turned on globally.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; `whitespace-load-hook'
|
|
|
|
|
;; It is evaluated after whitespace package is loaded.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
|
|
|
|
;;
|
2012-07-25 05:48:19 +00:00
|
|
|
|
;; Acknowledgments
|
|
|
|
|
;; ---------------
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
2011-04-30 15:15:07 +00:00
|
|
|
|
;; Thanks to felix (EmacsWiki) for keeping highlight when switching between
|
|
|
|
|
;; major modes on a file.
|
|
|
|
|
;;
|
2008-07-29 02:07:26 +00:00
|
|
|
|
;; Thanks to David Reitter <david.reitter@gmail.com> for suggesting a
|
|
|
|
|
;; `whitespace-newline' initialization with low contrast relative to
|
|
|
|
|
;; the background color.
|
|
|
|
|
;;
|
2008-04-16 03:41:17 +00:00
|
|
|
|
;; Thanks to Stephen Deasey <sdeasey@gmail.com> for the
|
|
|
|
|
;; `indent-tabs-mode' usage suggestion.
|
|
|
|
|
;;
|
|
|
|
|
;; Thanks to Eric Cooper <ecc@cmu.edu> for the suggestion to have hook
|
2008-10-02 00:49:49 +00:00
|
|
|
|
;; actions when buffer is written as the original whitespace package
|
|
|
|
|
;; had.
|
2008-03-01 19:00:24 +00:00
|
|
|
|
;;
|
2008-01-26 01:47:21 +00:00
|
|
|
|
;; Thanks to nschum (EmacsWiki) for the idea about highlight "long"
|
|
|
|
|
;; lines tail. See EightyColumnRule (EmacsWiki).
|
|
|
|
|
;;
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; Thanks to Juri Linkov <juri@jurta.org> for suggesting:
|
|
|
|
|
;; * `define-minor-mode'.
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; * `global-whitespace-*' name for global commands.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Thanks to Robert J. Chassell <bob@gnu.org> for doc fix and testing.
|
|
|
|
|
;;
|
|
|
|
|
;; Thanks to Drew Adams <drew.adams@oracle.com> for toggle commands
|
|
|
|
|
;; suggestion.
|
|
|
|
|
;;
|
|
|
|
|
;; Thanks to Antti Kaihola <antti.kaihola@linux-aktivaattori.org> for
|
|
|
|
|
;; helping to fix `find-file-hooks' reference.
|
|
|
|
|
;;
|
|
|
|
|
;; Thanks to Andreas Roehler <andreas.roehler@easy-emacs.de> for
|
|
|
|
|
;; indicating defface byte-compilation warnings.
|
|
|
|
|
;;
|
2014-01-06 06:25:30 +00:00
|
|
|
|
;; Thanks to Tim O'Callaghan (EmacsWiki) for the idea about highlight
|
2008-01-26 01:47:21 +00:00
|
|
|
|
;; "long" lines. See EightyColumnRule (EmacsWiki).
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Thanks to Yanghui Bian <yanghuibian@gmail.com> for indicating a new
|
2008-08-06 03:35:04 +00:00
|
|
|
|
;; NEWLINE character mapping.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Thanks to Pete Forman <pete.forman@westgeo.com> for indicating
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; whitespace-mode.el on XEmacs.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Thanks to Miles Bader <miles@gnu.org> for handling display table via
|
|
|
|
|
;; visws.el (his code was modified, but the main idea was kept).
|
|
|
|
|
;;
|
|
|
|
|
;; Thanks to:
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; Rajesh Vaidheeswarran <rv@gnu.org> (original) whitespace.el
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; Aurelien Tisne <aurelien.tisne@free.fr> show-whitespace-mode.el
|
|
|
|
|
;; Lawrence Mitchell <wence@gmx.li> whitespace-mode.el
|
|
|
|
|
;; Miles Bader <miles@gnu.org> visws.el
|
|
|
|
|
;; And to all people who contributed with them.
|
|
|
|
|
;;
|
|
|
|
|
;;
|
|
|
|
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
|
|
;;; code:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;;;; User Variables:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Interface to the command system
|
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defgroup whitespace nil
|
2008-01-21 12:45:58 +00:00
|
|
|
|
"Visualize blanks (TAB, (HARD) SPACE and NEWLINE)."
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:link '(emacs-library-link :tag "Source Lisp File" "whitespace.el")
|
(whitespace): Set :version tag to 23.1.
(whitespace-turn-off, whitespace-toggle-options): Fix typos.
(whitespace-style, whitespace-chars, whitespace-space, whitespace-hspace,
whitespace-tab, whitespace-newline, whitespace-trailing, whitespace-line,
whitespace-space-before-tab, whitespace-indentation, whitespace-empty,
whitespace-space-after-tab, whitespace-hspace-regexp, whitespace-space-regexp,
whitespace-tab-regexp, whitespace-trailing-regexp,
whitespace-space-before-tab-regexp, whitespace-indentation-regexp,
whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp,
whitespace-space-after-tab-regexp, whitespace-line-column,
whitespace-display-mappings, global-whitespace-toggle-options,
whitespace-cleanup, whitespace-cleanup-region, whitespace-interactive-char):
Doc fixes.
2008-02-01 14:44:44 +00:00
|
|
|
|
:version "23.1"
|
2010-03-12 17:47:22 +00:00
|
|
|
|
:group 'convenience)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(defcustom whitespace-style
|
2010-08-25 02:27:58 +00:00
|
|
|
|
'(face
|
|
|
|
|
tabs spaces trailing lines space-before-tab newline
|
|
|
|
|
indentation empty space-after-tab
|
|
|
|
|
space-mark tab-mark newline-mark)
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Specify which kind of blank is visualized.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
(whitespace): Set :version tag to 23.1.
(whitespace-turn-off, whitespace-toggle-options): Fix typos.
(whitespace-style, whitespace-chars, whitespace-space, whitespace-hspace,
whitespace-tab, whitespace-newline, whitespace-trailing, whitespace-line,
whitespace-space-before-tab, whitespace-indentation, whitespace-empty,
whitespace-space-after-tab, whitespace-hspace-regexp, whitespace-space-regexp,
whitespace-tab-regexp, whitespace-trailing-regexp,
whitespace-space-before-tab-regexp, whitespace-indentation-regexp,
whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp,
whitespace-space-after-tab-regexp, whitespace-line-column,
whitespace-display-mappings, global-whitespace-toggle-options,
whitespace-cleanup, whitespace-cleanup-region, whitespace-interactive-char):
Doc fixes.
2008-02-01 14:44:44 +00:00
|
|
|
|
It's a list containing some or all of the following values:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2010-08-25 02:27:58 +00:00
|
|
|
|
face enable all visualization via faces (see below).
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
trailing trailing blanks are visualized via faces.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
tabs TABs are visualized via faces.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
spaces SPACEs and HARD SPACEs are visualized via
|
|
|
|
|
faces.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2010-01-18 04:39:40 +00:00
|
|
|
|
lines lines which have columns beyond
|
2008-04-26 11:38:50 +00:00
|
|
|
|
`whitespace-line-column' are highlighted via
|
2010-01-18 04:39:40 +00:00
|
|
|
|
faces.
|
2008-01-26 01:47:21 +00:00
|
|
|
|
Whole line is highlighted.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
It has precedence over `lines-tail' (see
|
|
|
|
|
below).
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-01-26 01:47:21 +00:00
|
|
|
|
|
2010-01-18 04:39:40 +00:00
|
|
|
|
lines-tail lines which have columns beyond
|
2008-04-26 11:38:50 +00:00
|
|
|
|
`whitespace-line-column' are highlighted via
|
|
|
|
|
faces.
|
2008-01-26 01:47:21 +00:00
|
|
|
|
But only the part of line which goes
|
2008-01-31 16:08:29 +00:00
|
|
|
|
beyond `whitespace-line-column' column.
|
2008-01-26 01:47:21 +00:00
|
|
|
|
It has effect only if `lines' (see above)
|
2010-08-25 02:27:58 +00:00
|
|
|
|
is not present in `whitespace-style'
|
|
|
|
|
and if `face' (see above) is present in
|
|
|
|
|
`whitespace-style'.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
newline NEWLINEs are visualized via faces.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-25 14:09:57 +00:00
|
|
|
|
empty empty lines at beginning and/or end of buffer
|
2008-04-26 11:38:50 +00:00
|
|
|
|
are visualized via faces.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2016-10-25 22:04:18 +00:00
|
|
|
|
indentation::tab `tab-width' or more SPACEs at beginning of line
|
|
|
|
|
are visualized via faces.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-04-16 03:41:17 +00:00
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
indentation::space TABs at beginning of line are visualized via
|
|
|
|
|
faces.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2016-10-25 22:04:18 +00:00
|
|
|
|
indentation `tab-width' or more SPACEs at beginning of line
|
|
|
|
|
are visualized, if `indent-tabs-mode' (which
|
|
|
|
|
see) is non-nil; otherwise, TABs at beginning
|
|
|
|
|
of line are visualized via faces.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-04-16 03:41:17 +00:00
|
|
|
|
|
2014-10-18 00:23:03 +00:00
|
|
|
|
big-indent Big indentations are visualized via faces.
|
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
|
|
|
|
|
2016-10-25 22:04:18 +00:00
|
|
|
|
space-after-tab::tab `tab-width' or more SPACEs after a TAB
|
|
|
|
|
are visualized via faces.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-04-16 03:41:17 +00:00
|
|
|
|
|
2016-10-25 22:04:18 +00:00
|
|
|
|
space-after-tab::space TABs are visualized when `tab-width' or
|
|
|
|
|
more SPACEs occur after a TAB, via
|
|
|
|
|
faces.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-04-16 03:41:17 +00:00
|
|
|
|
|
2016-10-25 22:04:18 +00:00
|
|
|
|
space-after-tab `tab-width' or more SPACEs after a TAB
|
|
|
|
|
are visualized, if `indent-tabs-mode'
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(which see) is non-nil; otherwise,
|
2008-04-26 11:38:50 +00:00
|
|
|
|
the TABs are visualized via faces.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-04-16 03:41:17 +00:00
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
space-before-tab::tab SPACEs before TAB are visualized via
|
|
|
|
|
faces.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2009-08-16 14:46:39 +00:00
|
|
|
|
space-before-tab::space TABs are visualized when SPACEs occur
|
|
|
|
|
before TAB, via faces.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
space-before-tab SPACEs before TAB are visualized, if
|
|
|
|
|
`indent-tabs-mode' (which see) is
|
|
|
|
|
non-nil; otherwise, the TABs are
|
2008-04-26 11:38:50 +00:00
|
|
|
|
visualized via faces.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It has effect only if `face' (see above)
|
|
|
|
|
is present in `whitespace-style'.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
|
|
|
|
|
space-mark SPACEs and HARD SPACEs are visualized via
|
|
|
|
|
display table.
|
|
|
|
|
|
|
|
|
|
tab-mark TABs are visualized via display table.
|
|
|
|
|
|
|
|
|
|
newline-mark NEWLINEs are visualized via display table.
|
2008-04-16 03:41:17 +00:00
|
|
|
|
|
|
|
|
|
Any other value is ignored.
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If nil, don't visualize TABs, (HARD) SPACEs and NEWLINEs via faces and
|
|
|
|
|
via display table.
|
2008-04-16 03:41:17 +00:00
|
|
|
|
|
2010-01-18 04:39:40 +00:00
|
|
|
|
There is an evaluation order for some values, if they are
|
2008-04-26 11:38:50 +00:00
|
|
|
|
included in `whitespace-style' list. For example, if
|
2008-04-16 03:41:17 +00:00
|
|
|
|
indentation, indentation::tab and/or indentation::space are
|
2008-04-26 11:38:50 +00:00
|
|
|
|
included in `whitespace-style' list. The evaluation order for
|
|
|
|
|
these values is:
|
2008-04-16 03:41:17 +00:00
|
|
|
|
|
|
|
|
|
* For indentation:
|
|
|
|
|
1. indentation
|
|
|
|
|
2. indentation::tab
|
|
|
|
|
3. indentation::space
|
|
|
|
|
|
|
|
|
|
* For SPACEs after TABs:
|
|
|
|
|
1. space-after-tab
|
|
|
|
|
2. space-after-tab::tab
|
|
|
|
|
3. space-after-tab::space
|
|
|
|
|
|
|
|
|
|
* For SPACEs before TABs:
|
|
|
|
|
1. space-before-tab
|
|
|
|
|
2. space-before-tab::tab
|
|
|
|
|
3. space-before-tab::space
|
|
|
|
|
|
2016-04-30 13:27:09 +00:00
|
|
|
|
For example, if `indentation' and `indentation::space' are
|
|
|
|
|
included in `whitespace-style', the `indentation' value is used
|
|
|
|
|
instead of the `indentation::space' value.
|
|
|
|
|
|
|
|
|
|
One reason to not use faces to visualize spaces (i.e., not
|
|
|
|
|
include `face' in `whitespace-style') is to use `whitespace-mode'
|
|
|
|
|
only for cleaning up a buffer. See `whitespace-cleanup' and
|
|
|
|
|
`whitespace-cleanup-region'.
|
2010-08-25 02:27:58 +00:00
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
See also `whitespace-display-mappings' for documentation."
|
2015-05-02 09:15:46 +00:00
|
|
|
|
:type '(set :tag "Kind of Blank"
|
|
|
|
|
(const :tag "(Face) Face visualization" face)
|
|
|
|
|
(const :tag "(Face) Trailing TABs, SPACEs and HARD SPACEs"
|
|
|
|
|
trailing)
|
|
|
|
|
(const :tag "(Face) TABs" tabs)
|
|
|
|
|
(const :tag "(Face) SPACEs and HARD SPACEs" spaces)
|
|
|
|
|
(const :tag "(Face) Lines" lines)
|
|
|
|
|
(const :tag "(Face) Lines, only overlong part" lines-tail)
|
|
|
|
|
(const :tag "(Face) NEWLINEs" newline)
|
|
|
|
|
(const :tag "(Face) Empty Lines At BOB And/Or EOB" empty)
|
|
|
|
|
(const :tag "(Face) Indentation SPACEs" indentation::tab)
|
|
|
|
|
(const :tag "(Face) Indentation TABs"
|
|
|
|
|
indentation::space)
|
|
|
|
|
(const :tag "(Face) Indentation TABs or SPACEs" indentation)
|
|
|
|
|
(const :tag "(Face) Too much line indentation" big-indent)
|
|
|
|
|
(const :tag "(Face) SPACEs after TAB: SPACEs"
|
|
|
|
|
space-after-tab::tab)
|
|
|
|
|
(const :tag "(Face) SPACEs after TAB: TABs"
|
|
|
|
|
space-after-tab::space)
|
|
|
|
|
(const :tag "(Face) SPACEs after TAB" space-after-tab)
|
|
|
|
|
(const :tag "(Face) SPACEs before TAB: SPACEs"
|
|
|
|
|
space-before-tab::tab)
|
|
|
|
|
(const :tag "(Face) SPACEs before TAB: TABs"
|
|
|
|
|
space-before-tab::space)
|
|
|
|
|
(const :tag "(Face) SPACEs before TAB" space-before-tab)
|
|
|
|
|
(const :tag "(Mark) SPACEs and HARD SPACEs" space-mark)
|
|
|
|
|
(const :tag "(Mark) TABs" tab-mark)
|
|
|
|
|
(const :tag "(Mark) NEWLINEs" newline-mark))
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2013-03-18 01:50:32 +00:00
|
|
|
|
(defvar whitespace-space 'whitespace-space
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Symbol face used to visualize SPACE.
|
2013-03-18 01:50:32 +00:00
|
|
|
|
Used when `whitespace-style' includes the value `spaces'.")
|
2014-02-21 16:18:56 +00:00
|
|
|
|
(make-obsolete-variable 'whitespace-space "use the face instead." "24.4")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defface whitespace-space
|
2008-01-17 12:46:55 +00:00
|
|
|
|
'((((class color) (background dark))
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-08 16:39:49 +00:00
|
|
|
|
:background "grey20" :foreground "darkgray")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(((class color) (background light))
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-08 16:39:49 +00:00
|
|
|
|
:background "LightYellow" :foreground "lightgray")
|
|
|
|
|
(t :inverse-video t))
|
2008-01-21 12:45:58 +00:00
|
|
|
|
"Face used to visualize SPACE."
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2013-03-18 01:50:32 +00:00
|
|
|
|
(defvar whitespace-hspace 'whitespace-hspace
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Symbol face used to visualize HARD SPACE.
|
2013-03-18 01:50:32 +00:00
|
|
|
|
Used when `whitespace-style' includes the value `spaces'.")
|
2014-02-21 16:18:56 +00:00
|
|
|
|
(make-obsolete-variable 'whitespace-hspace "use the face instead." "24.4")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defface whitespace-hspace ; 'nobreak-space
|
2008-01-17 12:46:55 +00:00
|
|
|
|
'((((class color) (background dark))
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-08 16:39:49 +00:00
|
|
|
|
:background "grey24" :foreground "darkgray")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(((class color) (background light))
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-08 16:39:49 +00:00
|
|
|
|
:background "LemonChiffon3" :foreground "lightgray")
|
|
|
|
|
(t :inverse-video t))
|
2008-01-21 12:45:58 +00:00
|
|
|
|
"Face used to visualize HARD SPACE."
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2013-03-18 01:50:32 +00:00
|
|
|
|
(defvar whitespace-tab 'whitespace-tab
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Symbol face used to visualize TAB.
|
2013-03-18 01:50:32 +00:00
|
|
|
|
Used when `whitespace-style' includes the value `tabs'.")
|
2017-10-28 09:06:30 +00:00
|
|
|
|
(make-obsolete-variable 'whitespace-tab
|
|
|
|
|
"customize the face `whitespace-tab' instead." "24.4")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defface whitespace-tab
|
2008-01-17 12:46:55 +00:00
|
|
|
|
'((((class color) (background dark))
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-08 16:39:49 +00:00
|
|
|
|
:background "grey22" :foreground "darkgray")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(((class color) (background light))
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-08 16:39:49 +00:00
|
|
|
|
:background "beige" :foreground "lightgray")
|
|
|
|
|
(t :inverse-video t))
|
2008-01-21 12:45:58 +00:00
|
|
|
|
"Face used to visualize TAB."
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2013-03-18 01:50:32 +00:00
|
|
|
|
(defvar whitespace-newline 'whitespace-newline
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Symbol face used to visualize NEWLINE char mapping.
|
2008-01-31 16:08:29 +00:00
|
|
|
|
See `whitespace-display-mappings'.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
Used when `whitespace-style' includes the values `newline-mark'
|
2013-03-18 01:50:32 +00:00
|
|
|
|
and `newline'.")
|
2014-02-21 16:18:56 +00:00
|
|
|
|
(make-obsolete-variable 'whitespace-newline "use the face instead." "24.4")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defface whitespace-newline
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-08 16:39:49 +00:00
|
|
|
|
'((default :weight normal)
|
|
|
|
|
(((class color) (background dark)) :foreground "darkgray")
|
|
|
|
|
(((class color) (min-colors 88) (background light)) :foreground "lightgray")
|
2011-11-26 08:50:48 +00:00
|
|
|
|
;; Displays with 16 colors use lightgray as background, so using a
|
|
|
|
|
;; lightgray foreground makes the newline mark invisible.
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-08 16:39:49 +00:00
|
|
|
|
(((class color) (background light)) :foreground "brown")
|
|
|
|
|
(t :underline t))
|
2008-01-21 12:45:58 +00:00
|
|
|
|
"Face used to visualize NEWLINE char mapping.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
See `whitespace-display-mappings'."
|
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2013-03-18 01:50:32 +00:00
|
|
|
|
(defvar whitespace-trailing 'whitespace-trailing
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Symbol face used to visualize trailing blanks.
|
2013-03-18 01:50:32 +00:00
|
|
|
|
Used when `whitespace-style' includes the value `trailing'.")
|
2014-02-21 16:18:56 +00:00
|
|
|
|
(make-obsolete-variable 'whitespace-trailing "use the face instead." "24.4")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defface whitespace-trailing ; 'trailing-whitespace
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-08 16:39:49 +00:00
|
|
|
|
'((default :weight bold)
|
|
|
|
|
(((class mono)) :inverse-video t :underline t)
|
|
|
|
|
(t :background "red1" :foreground "yellow"))
|
2008-01-21 12:45:58 +00:00
|
|
|
|
"Face used to visualize trailing blanks."
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2013-03-18 01:50:32 +00:00
|
|
|
|
(defvar whitespace-line 'whitespace-line
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Symbol face used to visualize \"long\" lines.
|
2008-01-31 16:08:29 +00:00
|
|
|
|
See `whitespace-line-column'.
|
2013-03-18 01:50:32 +00:00
|
|
|
|
Used when `whitespace-style' includes the value `line'.")
|
2014-02-21 16:18:56 +00:00
|
|
|
|
(make-obsolete-variable 'whitespace-line "use the face instead." "24.4")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defface whitespace-line
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-08 16:39:49 +00:00
|
|
|
|
'((((class mono)) :inverse-video t :weight bold :underline t)
|
|
|
|
|
(t :background "gray20" :foreground "violet"))
|
2008-01-21 12:45:58 +00:00
|
|
|
|
"Face used to visualize \"long\" lines.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
See `whitespace-line-column'."
|
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2013-03-18 01:50:32 +00:00
|
|
|
|
(defvar whitespace-space-before-tab 'whitespace-space-before-tab
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Symbol face used to visualize SPACEs before TAB.
|
2013-03-18 01:50:32 +00:00
|
|
|
|
Used when `whitespace-style' includes the value `space-before-tab'.")
|
|
|
|
|
(make-obsolete-variable 'whitespace-space-before-tab
|
2014-02-21 16:18:56 +00:00
|
|
|
|
"use the face instead." "24.4")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defface whitespace-space-before-tab
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-08 16:39:49 +00:00
|
|
|
|
'((((class mono)) :inverse-video t :weight bold :underline t)
|
|
|
|
|
(t :background "DarkOrange" :foreground "firebrick"))
|
2008-01-21 12:45:58 +00:00
|
|
|
|
"Face used to visualize SPACEs before TAB."
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2013-03-18 01:50:32 +00:00
|
|
|
|
(defvar whitespace-indentation 'whitespace-indentation
|
2016-10-25 22:04:18 +00:00
|
|
|
|
"Symbol face used to visualize `tab-width' or more SPACEs at beginning of
|
|
|
|
|
line. Used when `whitespace-style' includes the value `indentation'.")
|
2014-02-21 16:18:56 +00:00
|
|
|
|
(make-obsolete-variable 'whitespace-indentation "use the face instead." "24.4")
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defface whitespace-indentation
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-08 16:39:49 +00:00
|
|
|
|
'((((class mono)) :inverse-video t :weight bold :underline t)
|
|
|
|
|
(t :background "yellow" :foreground "firebrick"))
|
2016-10-25 22:04:18 +00:00
|
|
|
|
"Face used to visualize `tab-width' or more SPACEs at beginning of line."
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2014-10-18 00:23:03 +00:00
|
|
|
|
(defface whitespace-big-indent
|
|
|
|
|
'((((class mono)) :inverse-video t :weight bold :underline t)
|
|
|
|
|
(t :background "red" :foreground "firebrick"))
|
|
|
|
|
"Face used to visualize big indentation."
|
|
|
|
|
:group 'whitespace)
|
|
|
|
|
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2013-03-18 01:50:32 +00:00
|
|
|
|
(defvar whitespace-empty 'whitespace-empty
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Symbol face used to visualize empty lines at beginning and/or end of buffer.
|
2013-03-18 01:50:32 +00:00
|
|
|
|
Used when `whitespace-style' includes the value `empty'.")
|
2014-02-21 16:18:56 +00:00
|
|
|
|
(make-obsolete-variable 'whitespace-empty "use the face instead." "24.4")
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defface whitespace-empty
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-08 16:39:49 +00:00
|
|
|
|
'((((class mono)) :inverse-video t :weight bold :underline t)
|
|
|
|
|
(t :background "yellow" :foreground "firebrick"))
|
2008-01-25 14:09:57 +00:00
|
|
|
|
"Face used to visualize empty lines at beginning and/or end of buffer."
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
|
|
|
|
|
2013-03-18 01:50:32 +00:00
|
|
|
|
(defvar whitespace-space-after-tab 'whitespace-space-after-tab
|
2016-10-25 22:04:18 +00:00
|
|
|
|
"Symbol face used to visualize `tab-width' or more SPACEs after TAB.
|
2013-03-18 01:50:32 +00:00
|
|
|
|
Used when `whitespace-style' includes the value `space-after-tab'.")
|
|
|
|
|
(make-obsolete-variable 'whitespace-space-after-tab
|
2014-02-21 16:18:56 +00:00
|
|
|
|
"use the face instead." "24.4")
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defface whitespace-space-after-tab
|
Face cleanups. Remove some uses of old-style face spec and :bold/:italic.
* faces.el (set-face-attribute): Doc fix.
(modify-face): Don't use :bold and :italic.
(error, warning, success): Tweak definitions.
* cus-edit.el (custom-modified, custom-invalid, custom-rogue)
(custom-modified, custom-set, custom-changed, custom-themed)
(custom-saved, custom-button, custom-button-mouse)
(custom-button-pressed, custom-state, custom-comment-tag)
(custom-variable-tag, custom-group-tag-1, custom-group-tag)
(custom-group-subtitle): Use new-style face specs.
(custom-invalid-face, custom-rogue-face, custom-modified-face)
(custom-set-face, custom-changed-face, custom-saved-face)
(custom-button-face, custom-button-pressed-face)
(custom-documentation-face, custom-state-face)
(custom-comment-face, custom-comment-tag-face)
(custom-variable-tag-face, custom-variable-button-face)
(custom-face-tag-face, custom-group-tag-face-1)
(custom-group-tag-face): Remove obsolete face alias.
* epa.el (epa-validity-high, epa-validity-medium)
(epa-validity-low, epa-mark, epa-field-name, epa-string)
(epa-field-name, epa-field-body):
* font-lock.el (font-lock-comment-face, font-lock-string-face)
(font-lock-keyword-face, font-lock-builtin-face)
(font-lock-function-name-face, font-lock-variable-name-face)
(font-lock-type-face, font-lock-constant-face):
* ido.el (ido-first-match, ido-only-match, ido-subdir)
(ido-virtual, ido-indicator, ido-incomplete-regexp):
* speedbar.el (speedbar-button-face, speedbar-file-face)
(speedbar-directory-face, speedbar-tag-face)
(speedbar-selected-face, speedbar-highlight-face)
(speedbar-separator-face):
* whitespace.el (whitespace-newline, whitespace-space)
(whitespace-hspace, whitespace-tab, whitespace-trailing)
(whitespace-line, whitespace-space-before-tab)
(whitespace-space-after-tab, whitespace-indentation)
(whitespace-empty):
* emulation/cua-base.el (cua-global-mark):
* eshell/em-prompt.el (eshell-prompt):
* net/newst-plainview.el (newsticker-new-item-face)
(newsticker-old-item-face, newsticker-immortal-item-face)
(newsticker-obsolete-item-face, newsticker-date-face)
(newsticker-statistics-face, newsticker-default-face):
* net/newst-reader.el (newsticker-feed-face)
(newsticker-extra-face, newsticker-enclosure-face):
* net/newst-treeview.el (newsticker-treeview-face)
(newsticker-treeview-new-face, newsticker-treeview-old-face)
(newsticker-treeview-immortal-face)
(newsticker-treeview-obsolete-face)
(newsticker-treeview-selection-face):
* net/rcirc.el (rcirc-my-nick, rcirc-other-nick)
(rcirc-bright-nick, rcirc-server, rcirc-timestamp)
(rcirc-nick-in-message, rcirc-nick-in-message-full-line)
(rcirc-prompt, rcirc-track-keyword, rcirc-url, rcirc-keyword):
* nxml/nxml-outln.el (nxml-heading, nxml-outline-indicator)
(nxml-outline-active-indicator, nxml-outline-ellipsis):
* play/mpuz.el (mpuz-unsolved, mpuz-solved, mpuz-trivial)
(mpuz-text):
* progmodes/vera-mode.el (vera-font-lock-number)
(vera-font-lock-function, vera-font-lock-interface):
* textmodes/table.el (table-cell): Use new-style face specs, and
don't use the old :bold and :italic attributes.
* erc-button.el (erc-button):
* erc-goodies.el (erc-bold-face, erc-inverse-face)
(erc-underline-face, fg:erc-color-*):
* erc-match.el (erc-current-nick-face, erc-dangerous-host-face)
(erc-pal-face, erc-fool-face, erc-keyword-face):
* erc-stamp.el (erc-timestamp-face): Likewise.
* erc.el (erc-direct-msg-face, erc-header-line, erc-input-face)
(erc-command-indicator-face, erc-notice-face, erc-action-face)
(erc-error-face, erc-my-nick-face, erc-nick-default-face)
(erc-nick-msg-face): Use new-style face specs, and avoid :bold.
* progmodes/ebrowse.el (ebrowse-tree-mark, ebrowse-root-class)
(ebrowse-member-attribute, ebrowse-default, ebrowse-file-name)
(ebrowse-member-class, ebrowse-progress): Likewise.
(ebrowse-tree-mark-face, ebrowse-root-class-face)
(ebrowse-file-name-face, ebrowse-default-face)
(ebrowse-member-attribute-face, ebrowse-member-class-face)
(ebrowse-progress-face): Remove obsolete faces.
* progmodes/flymake.el (flymake-errline, flymake-warnline):
Inherit from error and warning faces respectively.
* textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):
Likewise.
(flyspell-incorrect-face, flyspell-duplicate-face): Remove
obsolete aliases.
* display.texi (Face Attributes): Font family does not accept
wildcards. De-document obsolete :bold and :italic attributes.
(Defining Faces): Use new-style face spec format.
2012-06-08 16:39:49 +00:00
|
|
|
|
'((((class mono)) :inverse-video t :weight bold :underline t)
|
|
|
|
|
(t :background "yellow" :foreground "firebrick"))
|
2016-10-25 22:04:18 +00:00
|
|
|
|
"Face used to visualize `tab-width' or more SPACEs after TAB."
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defcustom whitespace-hspace-regexp
|
2013-03-18 01:50:32 +00:00
|
|
|
|
"\\(\u00A0+\\)"
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Specify HARD SPACE characters regexp.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
Here are some examples:
|
|
|
|
|
|
|
|
|
|
\"\\\\(^\\xA0+\\\\)\" \
|
2008-01-21 12:45:58 +00:00
|
|
|
|
visualize only leading HARD SPACEs.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
\"\\\\(\\xA0+$\\\\)\" \
|
2008-01-21 12:45:58 +00:00
|
|
|
|
visualize only trailing HARD SPACEs.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
\"\\\\(^\\xA0+\\\\|\\xA0+$\\\\)\" \
|
2008-01-21 12:45:58 +00:00
|
|
|
|
visualize leading and/or trailing HARD SPACEs.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
\"\\t\\\\(\\xA0+\\\\)\\t\" \
|
2008-01-21 12:45:58 +00:00
|
|
|
|
visualize only HARD SPACEs between TABs.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
NOTE: Enclose always by \\\\( and \\\\) the elements to highlight.
|
|
|
|
|
Use exactly one pair of enclosing \\\\( and \\\\).
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
Used when `whitespace-style' includes `spaces'."
|
2008-01-17 12:46:55 +00:00
|
|
|
|
:type '(regexp :tag "HARD SPACE Chars")
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defcustom whitespace-space-regexp "\\( +\\)"
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Specify SPACE characters regexp.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
(whitespace): Set :version tag to 23.1.
(whitespace-turn-off, whitespace-toggle-options): Fix typos.
(whitespace-style, whitespace-chars, whitespace-space, whitespace-hspace,
whitespace-tab, whitespace-newline, whitespace-trailing, whitespace-line,
whitespace-space-before-tab, whitespace-indentation, whitespace-empty,
whitespace-space-after-tab, whitespace-hspace-regexp, whitespace-space-regexp,
whitespace-tab-regexp, whitespace-trailing-regexp,
whitespace-space-before-tab-regexp, whitespace-indentation-regexp,
whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp,
whitespace-space-after-tab-regexp, whitespace-line-column,
whitespace-display-mappings, global-whitespace-toggle-options,
whitespace-cleanup, whitespace-cleanup-region, whitespace-interactive-char):
Doc fixes.
2008-02-01 14:44:44 +00:00
|
|
|
|
If you're using `mule' package, there may be other characters
|
2008-01-21 12:45:58 +00:00
|
|
|
|
besides \" \" that should be considered SPACE.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
Here are some examples:
|
|
|
|
|
|
2008-01-21 12:45:58 +00:00
|
|
|
|
\"\\\\(^ +\\\\)\" visualize only leading SPACEs.
|
|
|
|
|
\"\\\\( +$\\\\)\" visualize only trailing SPACEs.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
\"\\\\(^ +\\\\| +$\\\\)\" \
|
2008-01-21 12:45:58 +00:00
|
|
|
|
visualize leading and/or trailing SPACEs.
|
|
|
|
|
\"\\t\\\\( +\\\\)\\t\" visualize only SPACEs between TABs.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
NOTE: Enclose always by \\\\( and \\\\) the elements to highlight.
|
|
|
|
|
Use exactly one pair of enclosing \\\\( and \\\\).
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
Used when `whitespace-style' includes `spaces'."
|
2008-01-17 12:46:55 +00:00
|
|
|
|
:type '(regexp :tag "SPACE Chars")
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defcustom whitespace-tab-regexp "\\(\t+\\)"
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Specify TAB characters regexp.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
(whitespace): Set :version tag to 23.1.
(whitespace-turn-off, whitespace-toggle-options): Fix typos.
(whitespace-style, whitespace-chars, whitespace-space, whitespace-hspace,
whitespace-tab, whitespace-newline, whitespace-trailing, whitespace-line,
whitespace-space-before-tab, whitespace-indentation, whitespace-empty,
whitespace-space-after-tab, whitespace-hspace-regexp, whitespace-space-regexp,
whitespace-tab-regexp, whitespace-trailing-regexp,
whitespace-space-before-tab-regexp, whitespace-indentation-regexp,
whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp,
whitespace-space-after-tab-regexp, whitespace-line-column,
whitespace-display-mappings, global-whitespace-toggle-options,
whitespace-cleanup, whitespace-cleanup-region, whitespace-interactive-char):
Doc fixes.
2008-02-01 14:44:44 +00:00
|
|
|
|
If you're using `mule' package, there may be other characters
|
2008-01-21 12:45:58 +00:00
|
|
|
|
besides \"\\t\" that should be considered TAB.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
Here are some examples:
|
|
|
|
|
|
2008-01-21 12:45:58 +00:00
|
|
|
|
\"\\\\(^\\t+\\\\)\" visualize only leading TABs.
|
|
|
|
|
\"\\\\(\\t+$\\\\)\" visualize only trailing TABs.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
\"\\\\(^\\t+\\\\|\\t+$\\\\)\" \
|
2008-01-21 12:45:58 +00:00
|
|
|
|
visualize leading and/or trailing TABs.
|
|
|
|
|
\" \\\\(\\t+\\\\) \" visualize only TABs between SPACEs.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
NOTE: Enclose always by \\\\( and \\\\) the elements to highlight.
|
|
|
|
|
Use exactly one pair of enclosing \\\\( and \\\\).
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
Used when `whitespace-style' includes `tabs'."
|
2008-01-17 12:46:55 +00:00
|
|
|
|
:type '(regexp :tag "TAB Chars")
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defcustom whitespace-trailing-regexp
|
2011-05-04 01:02:09 +00:00
|
|
|
|
"\\([\t \u00A0]+\\)$"
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Specify trailing characters regexp.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2013-03-18 01:50:32 +00:00
|
|
|
|
There may be other characters besides:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2011-05-04 01:02:09 +00:00
|
|
|
|
\" \" \"\\t\" \"\\u00A0\"
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-21 12:45:58 +00:00
|
|
|
|
that should be considered blank.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-04-28 23:12:09 +00:00
|
|
|
|
NOTE: Enclose always by \"\\\\(\" and \"\\\\)$\" the elements to highlight.
|
2008-04-27 11:50:47 +00:00
|
|
|
|
Use exactly one pair of enclosing elements above.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
Used when `whitespace-style' includes `trailing'."
|
2008-01-17 12:46:55 +00:00
|
|
|
|
:type '(regexp :tag "Trailing Chars")
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(defcustom whitespace-space-before-tab-regexp "\\( +\\)\\(\t+\\)"
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Specify SPACEs before TAB regexp.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
Used when `whitespace-style' includes `space-before-tab',
|
2008-04-16 03:41:17 +00:00
|
|
|
|
`space-before-tab::tab' or `space-before-tab::space'."
|
2008-01-17 12:46:55 +00:00
|
|
|
|
:type '(regexp :tag "SPACEs Before TAB")
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defcustom whitespace-indentation-regexp
|
2008-04-16 03:41:17 +00:00
|
|
|
|
'("^\t*\\(\\( \\{%d\\}\\)+\\)[^\n\t]"
|
|
|
|
|
. "^ *\\(\t+\\)[^\n]")
|
2016-10-25 22:04:18 +00:00
|
|
|
|
"Specify regexp for `tab-width' or more SPACEs at beginning of line.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
It is a cons where the cons car is used for SPACEs visualization
|
|
|
|
|
and the cons cdr is used for TABs visualization.
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
Used when `whitespace-style' includes `indentation',
|
2008-04-16 03:41:17 +00:00
|
|
|
|
`indentation::tab' or `indentation::space'."
|
2013-05-09 01:40:20 +00:00
|
|
|
|
:type '(cons (string :tag "Indentation SPACEs")
|
|
|
|
|
(string :tag "Indentation TABs"))
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
|
|
|
|
|
2016-10-20 12:17:58 +00:00
|
|
|
|
(defcustom whitespace-empty-at-bob-regexp "\\`\\(\\([ \t]*\n\\)+\\)"
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Specify regexp for empty lines at beginning of buffer.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
Used when `whitespace-style' includes `empty'."
|
2008-01-25 14:09:57 +00:00
|
|
|
|
:type '(regexp :tag "Empty Lines At Beginning Of Buffer")
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
|
|
|
|
|
2016-12-21 04:02:48 +00:00
|
|
|
|
(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)\\'"
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Specify regexp for empty lines at end of buffer.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
Used when `whitespace-style' includes `empty'."
|
2008-01-25 14:09:57 +00:00
|
|
|
|
:type '(regexp :tag "Empty Lines At End Of Buffer")
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(defcustom whitespace-space-after-tab-regexp
|
2016-10-21 14:23:08 +00:00
|
|
|
|
'("\t+\\(\\( \\{%d,\\}\\)+\\)"
|
|
|
|
|
. "\\(\t+\\) \\{%d,\\}")
|
2016-10-25 22:04:18 +00:00
|
|
|
|
"Specify regexp for `tab-width' or more SPACEs after TAB.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
It is a cons where the cons car is used for SPACEs visualization
|
|
|
|
|
and the cons cdr is used for TABs visualization.
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
Used when `whitespace-style' includes `space-after-tab',
|
2008-04-16 03:41:17 +00:00
|
|
|
|
`space-after-tab::tab' or `space-after-tab::space'."
|
2013-05-09 01:40:20 +00:00
|
|
|
|
:type '(cons (string :tag "SPACEs After TAB")
|
|
|
|
|
string)
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2014-10-18 00:23:03 +00:00
|
|
|
|
(defcustom whitespace-big-indent-regexp
|
|
|
|
|
"^\\(\\(?:\t\\{4,\\}\\| \\{32,\\}\\)[\t ]*\\)"
|
|
|
|
|
"Specify big indentation regexp.
|
|
|
|
|
|
|
|
|
|
If you're using `mule' package, there may be other characters
|
|
|
|
|
besides \"\\t\" that should be considered TAB.
|
|
|
|
|
|
|
|
|
|
NOTE: Enclose always by \\\\( and \\\\) the elements to highlight.
|
|
|
|
|
Use exactly one pair of enclosing \\\\( and \\\\).
|
|
|
|
|
|
|
|
|
|
Used when `whitespace-style' includes `big-indent'."
|
2014-12-02 23:37:27 +00:00
|
|
|
|
:version "25.1"
|
2014-10-18 00:23:03 +00:00
|
|
|
|
:type '(regexp :tag "Detect too much indentation at the beginning of a line")
|
|
|
|
|
:group 'whitespace)
|
|
|
|
|
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defcustom whitespace-line-column 80
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Specify column beyond which the line is highlighted.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2010-08-25 02:27:58 +00:00
|
|
|
|
It must be an integer or nil. If nil, the `fill-column' variable value is
|
|
|
|
|
used.
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
Used when `whitespace-style' includes `lines' or `lines-tail'."
|
2010-08-25 02:27:58 +00:00
|
|
|
|
:type '(choice :tag "Line Length Limit"
|
|
|
|
|
(integer :tag "Line Length")
|
|
|
|
|
(const :tag "Use fill-column" nil))
|
2015-07-08 22:38:29 +00:00
|
|
|
|
:safe 'integerp
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; Hacked from `visible-whitespace-mappings' in visws.el
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defcustom whitespace-display-mappings
|
2008-01-17 12:46:55 +00:00
|
|
|
|
'(
|
2015-09-21 14:58:41 +00:00
|
|
|
|
(space-mark ?\ [?·] [?.]) ; space - middle dot
|
|
|
|
|
(space-mark ?\xA0 [?¤] [?_]) ; hard space - currency sign
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;; NEWLINE is displayed using the face `whitespace-newline'
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(newline-mark ?\n [?$ ?\n]) ; eol - dollar sign
|
2015-09-21 14:58:41 +00:00
|
|
|
|
;; (newline-mark ?\n [?↵ ?\n] [?$ ?\n]) ; eol - downwards arrow
|
|
|
|
|
;; (newline-mark ?\n [?¶ ?\n] [?$ ?\n]) ; eol - pilcrow
|
|
|
|
|
;; (newline-mark ?\n [?¯ ?\n] [?$ ?\n]) ; eol - overscore
|
|
|
|
|
;; (newline-mark ?\n [?¬ ?\n] [?$ ?\n]) ; eol - negation
|
|
|
|
|
;; (newline-mark ?\n [?° ?\n] [?$ ?\n]) ; eol - degrees
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;;
|
|
|
|
|
;; WARNING: the mapping below has a problem.
|
|
|
|
|
;; When a TAB occupies exactly one column, it will display the
|
|
|
|
|
;; character ?\xBB at that column followed by a TAB which goes to
|
|
|
|
|
;; the next TAB column.
|
|
|
|
|
;; If this is a problem for you, please, comment the line below.
|
2015-09-21 14:58:41 +00:00
|
|
|
|
(tab-mark ?\t [?» ?\t] [?\\ ?\t]) ; tab - right guillemet
|
2008-01-17 12:46:55 +00:00
|
|
|
|
)
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Specify an alist of mappings for displaying characters.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
Each element has the following form:
|
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(KIND CHAR VECTOR...)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
Where:
|
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
KIND is the kind of character.
|
|
|
|
|
It can be one of the following symbols:
|
|
|
|
|
|
|
|
|
|
tab-mark for TAB character
|
|
|
|
|
|
|
|
|
|
space-mark for SPACE or HARD SPACE character
|
|
|
|
|
|
|
|
|
|
newline-mark for NEWLINE character
|
|
|
|
|
|
2008-01-17 12:46:55 +00:00
|
|
|
|
CHAR is the character to be mapped.
|
|
|
|
|
|
|
|
|
|
VECTOR is a vector of characters to be displayed in place of CHAR.
|
|
|
|
|
The first display vector that can be displayed is used;
|
|
|
|
|
if no display vector for a mapping can be displayed, then
|
|
|
|
|
that character is displayed unmodified.
|
|
|
|
|
|
|
|
|
|
The NEWLINE character is displayed using the face given by
|
2008-04-16 03:41:17 +00:00
|
|
|
|
`whitespace-newline' variable.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
Used when `whitespace-style' includes `tab-mark', `space-mark' or
|
|
|
|
|
`newline-mark'."
|
2008-01-17 12:46:55 +00:00
|
|
|
|
:type '(repeat
|
|
|
|
|
(list :tag "Character Mapping"
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(choice :tag "Char Kind"
|
|
|
|
|
(const :tag "Tab" tab-mark)
|
|
|
|
|
(const :tag "Space" space-mark)
|
|
|
|
|
(const :tag "Newline" newline-mark))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(character :tag "Char")
|
|
|
|
|
(repeat :inline t :tag "Vector List"
|
|
|
|
|
(vector :tag ""
|
|
|
|
|
(repeat :inline t
|
|
|
|
|
:tag "Vector Characters"
|
|
|
|
|
(character :tag "Char"))))))
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defcustom whitespace-global-modes t
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Modes for which global `whitespace-mode' is automagically turned on.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
Global `whitespace-mode' is controlled by the command
|
|
|
|
|
`global-whitespace-mode'.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
If nil, means no modes have `whitespace-mode' automatically
|
2008-01-17 12:46:55 +00:00
|
|
|
|
turned on.
|
2008-01-31 16:08:29 +00:00
|
|
|
|
|
|
|
|
|
If t, all modes that support `whitespace-mode' have it
|
|
|
|
|
automatically turned on.
|
|
|
|
|
|
|
|
|
|
Else it should be a list of `major-mode' symbol names for which
|
|
|
|
|
`whitespace-mode' should be automatically turned on. The sense
|
2008-01-17 12:46:55 +00:00
|
|
|
|
of the list is negated if it begins with `not'. For example:
|
|
|
|
|
|
|
|
|
|
(c-mode c++-mode)
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
means that `whitespace-mode' is turned on for buffers in C and
|
|
|
|
|
C++ modes only."
|
2008-03-01 19:00:24 +00:00
|
|
|
|
:type '(choice :tag "Global Modes"
|
|
|
|
|
(const :tag "None" nil)
|
2008-01-25 14:09:57 +00:00
|
|
|
|
(const :tag "All" t)
|
|
|
|
|
(set :menu-tag "Mode Specific" :tag "Modes"
|
2008-01-17 12:46:55 +00:00
|
|
|
|
:value (not)
|
|
|
|
|
(const :tag "Except" not)
|
|
|
|
|
(repeat :inline t
|
2008-01-25 14:09:57 +00:00
|
|
|
|
(symbol :tag "Mode"))))
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-03-01 19:00:24 +00:00
|
|
|
|
|
|
|
|
|
(defcustom whitespace-action nil
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Specify which action is taken when a buffer is visited or written.
|
2008-03-01 19:00:24 +00:00
|
|
|
|
|
|
|
|
|
It's a list containing some or all of the following values:
|
|
|
|
|
|
|
|
|
|
nil no action is taken.
|
|
|
|
|
|
|
|
|
|
cleanup cleanup any bogus whitespace always when local
|
|
|
|
|
whitespace is turned on.
|
|
|
|
|
See `whitespace-cleanup' and
|
|
|
|
|
`whitespace-cleanup-region'.
|
|
|
|
|
|
|
|
|
|
report-on-bogus report if there is any bogus whitespace always
|
|
|
|
|
when local whitespace is turned on.
|
|
|
|
|
|
|
|
|
|
auto-cleanup cleanup any bogus whitespace when buffer is
|
2008-10-02 00:49:49 +00:00
|
|
|
|
written.
|
2008-03-01 19:00:24 +00:00
|
|
|
|
See `whitespace-cleanup' and
|
|
|
|
|
`whitespace-cleanup-region'.
|
|
|
|
|
|
|
|
|
|
abort-on-bogus abort if there is any bogus whitespace and the
|
2008-10-02 00:49:49 +00:00
|
|
|
|
buffer is written.
|
2008-03-01 19:00:24 +00:00
|
|
|
|
|
2008-10-02 00:49:49 +00:00
|
|
|
|
warn-if-read-only give a warning if `cleanup' or `auto-cleanup'
|
2008-09-06 00:19:31 +00:00
|
|
|
|
is included in `whitespace-action' and the
|
|
|
|
|
buffer is read-only.
|
|
|
|
|
|
2008-03-01 19:00:24 +00:00
|
|
|
|
Any other value is treated as nil."
|
|
|
|
|
:type '(choice :tag "Actions"
|
|
|
|
|
(const :tag "None" nil)
|
|
|
|
|
(repeat :tag "Action List"
|
|
|
|
|
(choice :tag "Action"
|
|
|
|
|
(const :tag "Cleanup When On" cleanup)
|
|
|
|
|
(const :tag "Report On Bogus" report-on-bogus)
|
|
|
|
|
(const :tag "Auto Cleanup" auto-cleanup)
|
2008-09-06 00:19:31 +00:00
|
|
|
|
(const :tag "Abort On Bogus" abort-on-bogus)
|
2008-10-02 00:49:49 +00:00
|
|
|
|
(const :tag "Warn If Read-Only" warn-if-read-only))))
|
2008-03-01 19:00:24 +00:00
|
|
|
|
:group 'whitespace)
|
|
|
|
|
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;;;; User commands - Local mode
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(define-minor-mode whitespace-mode
|
Fix minor mode docstrings for the new meaning of a nil ARG.
* abbrev.el (abbrev-mode):
* allout.el (allout-mode):
* autoinsert.el (auto-insert-mode):
* autoarg.el (autoarg-mode, autoarg-kp-mode):
* autorevert.el (auto-revert-mode, auto-revert-tail-mode)
(global-auto-revert-mode):
* battery.el (display-battery-mode):
* composite.el (global-auto-composition-mode)
(auto-composition-mode):
* delsel.el (delete-selection-mode):
* desktop.el (desktop-save-mode):
* dired-x.el (dired-omit-mode):
* dirtrack.el (dirtrack-mode):
* doc-view.el (doc-view-minor-mode):
* double.el (double-mode):
* electric.el (electric-indent-mode, electric-pair-mode):
* emacs-lock.el (emacs-lock-mode):
* epa-hook.el (auto-encryption-mode):
* follow.el (follow-mode):
* font-core.el (font-lock-mode):
* frame.el (auto-raise-mode, auto-lower-mode, blink-cursor-mode):
* help.el (temp-buffer-resize-mode):
* hilit-chg.el (highlight-changes-mode)
(highlight-changes-visible-mode):
* hi-lock.el (hi-lock-mode):
* hl-line.el (hl-line-mode, global-hl-line-mode):
* icomplete.el (icomplete-mode):
* ido.el (ido-everywhere):
* image-file.el (auto-image-file-mode):
* image-mode.el (image-minor-mode):
* iswitchb.el (iswitchb-mode):
* jka-cmpr-hook.el (auto-compression-mode):
* linum.el (linum-mode):
* longlines.el (longlines-mode):
* master.el (master-mode):
* mb-depth.el (minibuffer-depth-indicate-mode):
* menu-bar.el (menu-bar-mode):
* minibuf-eldef.el (minibuffer-electric-default-mode):
* mouse-sel.el (mouse-sel-mode):
* msb.el (msb-mode):
* mwheel.el (mouse-wheel-mode):
* outline.el (outline-minor-mode):
* paren.el (show-paren-mode):
* recentf.el (recentf-mode):
* reveal.el (reveal-mode, global-reveal-mode):
* rfn-eshadow.el (file-name-shadow-mode):
* ruler-mode.el (ruler-mode):
* savehist.el (savehist-mode):
* scroll-all.el (scroll-all-mode):
* scroll-bar.el (scroll-bar-mode):
* server.el (server-mode):
* shell.el (shell-dirtrack-mode):
* simple.el (auto-fill-mode, transient-mark-mode)
(visual-line-mode, overwrite-mode, binary-overwrite-mode)
(line-number-mode, column-number-mode, size-indication-mode)
(auto-save-mode, normal-erase-is-backspace-mode, visible-mode):
* strokes.el (strokes-mode):
* time.el (display-time-mode):
* t-mouse.el (gpm-mouse-mode):
* tool-bar.el (tool-bar-mode):
* tooltip.el (tooltip-mode):
* type-break.el (type-break-mode-line-message-mode)
(type-break-query-mode):
* view.el (view-mode):
* whitespace.el (whitespace-mode, whitespace-newline-mode)
(global-whitespace-mode, global-whitespace-newline-mode):
* xt-mouse.el (xterm-mouse-mode): Doc fix.
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix
autogenerated docstring.
2011-10-19 12:54:24 +00:00
|
|
|
|
"Toggle whitespace visualization (Whitespace mode).
|
2008-08-06 03:35:04 +00:00
|
|
|
|
|
|
|
|
|
See also `whitespace-style', `whitespace-newline' and
|
|
|
|
|
`whitespace-display-mappings'."
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:lighter " ws"
|
2008-01-17 12:46:55 +00:00
|
|
|
|
:init-value nil
|
|
|
|
|
:global nil
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(cond
|
|
|
|
|
(noninteractive ; running a batch job
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(setq whitespace-mode nil))
|
|
|
|
|
(whitespace-mode ; whitespace-mode on
|
2008-03-01 19:00:24 +00:00
|
|
|
|
(whitespace-turn-on)
|
|
|
|
|
(whitespace-action-when-on))
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(t ; whitespace-mode off
|
|
|
|
|
(whitespace-turn-off))))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-07-24 04:12:27 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
|
(define-minor-mode whitespace-newline-mode
|
Fix minor mode docstrings for the new meaning of a nil ARG.
* abbrev.el (abbrev-mode):
* allout.el (allout-mode):
* autoinsert.el (auto-insert-mode):
* autoarg.el (autoarg-mode, autoarg-kp-mode):
* autorevert.el (auto-revert-mode, auto-revert-tail-mode)
(global-auto-revert-mode):
* battery.el (display-battery-mode):
* composite.el (global-auto-composition-mode)
(auto-composition-mode):
* delsel.el (delete-selection-mode):
* desktop.el (desktop-save-mode):
* dired-x.el (dired-omit-mode):
* dirtrack.el (dirtrack-mode):
* doc-view.el (doc-view-minor-mode):
* double.el (double-mode):
* electric.el (electric-indent-mode, electric-pair-mode):
* emacs-lock.el (emacs-lock-mode):
* epa-hook.el (auto-encryption-mode):
* follow.el (follow-mode):
* font-core.el (font-lock-mode):
* frame.el (auto-raise-mode, auto-lower-mode, blink-cursor-mode):
* help.el (temp-buffer-resize-mode):
* hilit-chg.el (highlight-changes-mode)
(highlight-changes-visible-mode):
* hi-lock.el (hi-lock-mode):
* hl-line.el (hl-line-mode, global-hl-line-mode):
* icomplete.el (icomplete-mode):
* ido.el (ido-everywhere):
* image-file.el (auto-image-file-mode):
* image-mode.el (image-minor-mode):
* iswitchb.el (iswitchb-mode):
* jka-cmpr-hook.el (auto-compression-mode):
* linum.el (linum-mode):
* longlines.el (longlines-mode):
* master.el (master-mode):
* mb-depth.el (minibuffer-depth-indicate-mode):
* menu-bar.el (menu-bar-mode):
* minibuf-eldef.el (minibuffer-electric-default-mode):
* mouse-sel.el (mouse-sel-mode):
* msb.el (msb-mode):
* mwheel.el (mouse-wheel-mode):
* outline.el (outline-minor-mode):
* paren.el (show-paren-mode):
* recentf.el (recentf-mode):
* reveal.el (reveal-mode, global-reveal-mode):
* rfn-eshadow.el (file-name-shadow-mode):
* ruler-mode.el (ruler-mode):
* savehist.el (savehist-mode):
* scroll-all.el (scroll-all-mode):
* scroll-bar.el (scroll-bar-mode):
* server.el (server-mode):
* shell.el (shell-dirtrack-mode):
* simple.el (auto-fill-mode, transient-mark-mode)
(visual-line-mode, overwrite-mode, binary-overwrite-mode)
(line-number-mode, column-number-mode, size-indication-mode)
(auto-save-mode, normal-erase-is-backspace-mode, visible-mode):
* strokes.el (strokes-mode):
* time.el (display-time-mode):
* t-mouse.el (gpm-mouse-mode):
* tool-bar.el (tool-bar-mode):
* tooltip.el (tooltip-mode):
* type-break.el (type-break-mode-line-message-mode)
(type-break-query-mode):
* view.el (view-mode):
* whitespace.el (whitespace-mode, whitespace-newline-mode)
(global-whitespace-mode, global-whitespace-newline-mode):
* xt-mouse.el (xterm-mouse-mode): Doc fix.
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix
autogenerated docstring.
2011-10-19 12:54:24 +00:00
|
|
|
|
"Toggle newline visualization (Whitespace Newline mode).
|
2008-07-24 04:12:27 +00:00
|
|
|
|
|
2008-08-06 03:35:04 +00:00
|
|
|
|
Use `whitespace-newline-mode' only for NEWLINE visualization
|
|
|
|
|
exclusively. For other visualizations, including NEWLINE
|
|
|
|
|
visualization together with (HARD) SPACEs and/or TABs, please,
|
|
|
|
|
use `whitespace-mode'.
|
|
|
|
|
|
|
|
|
|
See also `whitespace-newline' and `whitespace-display-mappings'."
|
2008-07-24 04:12:27 +00:00
|
|
|
|
:lighter " nl"
|
|
|
|
|
:init-value nil
|
|
|
|
|
:global nil
|
|
|
|
|
:group 'whitespace
|
2011-10-31 01:15:40 +00:00
|
|
|
|
(let ((whitespace-style '(face newline-mark newline)))
|
|
|
|
|
(whitespace-mode (if whitespace-newline-mode
|
|
|
|
|
1 -1)))
|
2011-10-31 00:37:09 +00:00
|
|
|
|
;; sync states (running a batch job)
|
|
|
|
|
(setq whitespace-newline-mode whitespace-mode))
|
2008-07-24 04:12:27 +00:00
|
|
|
|
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;;;; User commands - Global mode
|
|
|
|
|
|
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
;;;###autoload
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(define-minor-mode global-whitespace-mode
|
Fix minor mode docstrings for the new meaning of a nil ARG.
* abbrev.el (abbrev-mode):
* allout.el (allout-mode):
* autoinsert.el (auto-insert-mode):
* autoarg.el (autoarg-mode, autoarg-kp-mode):
* autorevert.el (auto-revert-mode, auto-revert-tail-mode)
(global-auto-revert-mode):
* battery.el (display-battery-mode):
* composite.el (global-auto-composition-mode)
(auto-composition-mode):
* delsel.el (delete-selection-mode):
* desktop.el (desktop-save-mode):
* dired-x.el (dired-omit-mode):
* dirtrack.el (dirtrack-mode):
* doc-view.el (doc-view-minor-mode):
* double.el (double-mode):
* electric.el (electric-indent-mode, electric-pair-mode):
* emacs-lock.el (emacs-lock-mode):
* epa-hook.el (auto-encryption-mode):
* follow.el (follow-mode):
* font-core.el (font-lock-mode):
* frame.el (auto-raise-mode, auto-lower-mode, blink-cursor-mode):
* help.el (temp-buffer-resize-mode):
* hilit-chg.el (highlight-changes-mode)
(highlight-changes-visible-mode):
* hi-lock.el (hi-lock-mode):
* hl-line.el (hl-line-mode, global-hl-line-mode):
* icomplete.el (icomplete-mode):
* ido.el (ido-everywhere):
* image-file.el (auto-image-file-mode):
* image-mode.el (image-minor-mode):
* iswitchb.el (iswitchb-mode):
* jka-cmpr-hook.el (auto-compression-mode):
* linum.el (linum-mode):
* longlines.el (longlines-mode):
* master.el (master-mode):
* mb-depth.el (minibuffer-depth-indicate-mode):
* menu-bar.el (menu-bar-mode):
* minibuf-eldef.el (minibuffer-electric-default-mode):
* mouse-sel.el (mouse-sel-mode):
* msb.el (msb-mode):
* mwheel.el (mouse-wheel-mode):
* outline.el (outline-minor-mode):
* paren.el (show-paren-mode):
* recentf.el (recentf-mode):
* reveal.el (reveal-mode, global-reveal-mode):
* rfn-eshadow.el (file-name-shadow-mode):
* ruler-mode.el (ruler-mode):
* savehist.el (savehist-mode):
* scroll-all.el (scroll-all-mode):
* scroll-bar.el (scroll-bar-mode):
* server.el (server-mode):
* shell.el (shell-dirtrack-mode):
* simple.el (auto-fill-mode, transient-mark-mode)
(visual-line-mode, overwrite-mode, binary-overwrite-mode)
(line-number-mode, column-number-mode, size-indication-mode)
(auto-save-mode, normal-erase-is-backspace-mode, visible-mode):
* strokes.el (strokes-mode):
* time.el (display-time-mode):
* t-mouse.el (gpm-mouse-mode):
* tool-bar.el (tool-bar-mode):
* tooltip.el (tooltip-mode):
* type-break.el (type-break-mode-line-message-mode)
(type-break-query-mode):
* view.el (view-mode):
* whitespace.el (whitespace-mode, whitespace-newline-mode)
(global-whitespace-mode, global-whitespace-newline-mode):
* xt-mouse.el (xterm-mouse-mode): Doc fix.
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix
autogenerated docstring.
2011-10-19 12:54:24 +00:00
|
|
|
|
"Toggle whitespace visualization globally (Global Whitespace mode).
|
2008-08-06 03:35:04 +00:00
|
|
|
|
|
|
|
|
|
See also `whitespace-style', `whitespace-newline' and
|
|
|
|
|
`whitespace-display-mappings'."
|
2008-02-01 10:25:35 +00:00
|
|
|
|
:lighter " WS"
|
2008-01-17 12:46:55 +00:00
|
|
|
|
:init-value nil
|
|
|
|
|
:global t
|
2008-01-31 16:08:29 +00:00
|
|
|
|
:group 'whitespace
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(cond
|
|
|
|
|
(noninteractive ; running a batch job
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(setq global-whitespace-mode nil))
|
|
|
|
|
(global-whitespace-mode ; global-whitespace-mode on
|
2011-05-04 01:02:09 +00:00
|
|
|
|
(save-current-buffer
|
2008-03-01 19:00:24 +00:00
|
|
|
|
(add-hook 'find-file-hook 'whitespace-turn-on-if-enabled)
|
2011-04-30 15:15:07 +00:00
|
|
|
|
(add-hook 'after-change-major-mode-hook 'whitespace-turn-on-if-enabled)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(dolist (buffer (buffer-list)) ; adjust all local mode
|
|
|
|
|
(set-buffer buffer)
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(unless whitespace-mode
|
|
|
|
|
(whitespace-turn-on-if-enabled)))))
|
|
|
|
|
(t ; global-whitespace-mode off
|
2011-05-04 01:02:09 +00:00
|
|
|
|
(save-current-buffer
|
2008-02-01 18:52:51 +00:00
|
|
|
|
(remove-hook 'find-file-hook 'whitespace-turn-on-if-enabled)
|
2011-04-30 15:15:07 +00:00
|
|
|
|
(remove-hook 'after-change-major-mode-hook 'whitespace-turn-on-if-enabled)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(dolist (buffer (buffer-list)) ; adjust all local mode
|
|
|
|
|
(set-buffer buffer)
|
2008-02-02 17:41:55 +00:00
|
|
|
|
(unless whitespace-mode
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(whitespace-turn-off)))))))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2013-03-10 21:39:11 +00:00
|
|
|
|
(defvar whitespace-enable-predicate
|
|
|
|
|
(lambda ()
|
|
|
|
|
(and (cond
|
|
|
|
|
((eq whitespace-global-modes t))
|
|
|
|
|
((listp whitespace-global-modes)
|
|
|
|
|
(if (eq (car-safe whitespace-global-modes) 'not)
|
|
|
|
|
(not (memq major-mode (cdr whitespace-global-modes)))
|
|
|
|
|
(memq major-mode whitespace-global-modes)))
|
|
|
|
|
(t nil))
|
2014-01-27 12:30:17 +00:00
|
|
|
|
;; ...we have a display (not running a batch job)
|
2013-03-10 21:39:11 +00:00
|
|
|
|
(not noninteractive)
|
|
|
|
|
;; ...the buffer is not internal (name starts with a space)
|
|
|
|
|
(not (eq (aref (buffer-name) 0) ?\ ))
|
|
|
|
|
;; ...the buffer is not special (name starts with *)
|
|
|
|
|
(or (not (eq (aref (buffer-name) 0) ?*))
|
|
|
|
|
;; except the scratch buffer.
|
|
|
|
|
(string= (buffer-name) "*scratch*"))))
|
|
|
|
|
"Predicate to decide which buffers obey `global-whitespace-mode'.
|
|
|
|
|
This function is called with no argument and should return non-nil
|
|
|
|
|
if the current buffer should obey `global-whitespace-mode'.
|
|
|
|
|
This variable is normally modified via `add-function'.")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defun whitespace-turn-on-if-enabled ()
|
2013-03-10 21:39:11 +00:00
|
|
|
|
(when (funcall whitespace-enable-predicate)
|
|
|
|
|
(whitespace-turn-on)))
|
2008-07-24 04:12:27 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
|
(define-minor-mode global-whitespace-newline-mode
|
Fix minor mode docstrings for the new meaning of a nil ARG.
* abbrev.el (abbrev-mode):
* allout.el (allout-mode):
* autoinsert.el (auto-insert-mode):
* autoarg.el (autoarg-mode, autoarg-kp-mode):
* autorevert.el (auto-revert-mode, auto-revert-tail-mode)
(global-auto-revert-mode):
* battery.el (display-battery-mode):
* composite.el (global-auto-composition-mode)
(auto-composition-mode):
* delsel.el (delete-selection-mode):
* desktop.el (desktop-save-mode):
* dired-x.el (dired-omit-mode):
* dirtrack.el (dirtrack-mode):
* doc-view.el (doc-view-minor-mode):
* double.el (double-mode):
* electric.el (electric-indent-mode, electric-pair-mode):
* emacs-lock.el (emacs-lock-mode):
* epa-hook.el (auto-encryption-mode):
* follow.el (follow-mode):
* font-core.el (font-lock-mode):
* frame.el (auto-raise-mode, auto-lower-mode, blink-cursor-mode):
* help.el (temp-buffer-resize-mode):
* hilit-chg.el (highlight-changes-mode)
(highlight-changes-visible-mode):
* hi-lock.el (hi-lock-mode):
* hl-line.el (hl-line-mode, global-hl-line-mode):
* icomplete.el (icomplete-mode):
* ido.el (ido-everywhere):
* image-file.el (auto-image-file-mode):
* image-mode.el (image-minor-mode):
* iswitchb.el (iswitchb-mode):
* jka-cmpr-hook.el (auto-compression-mode):
* linum.el (linum-mode):
* longlines.el (longlines-mode):
* master.el (master-mode):
* mb-depth.el (minibuffer-depth-indicate-mode):
* menu-bar.el (menu-bar-mode):
* minibuf-eldef.el (minibuffer-electric-default-mode):
* mouse-sel.el (mouse-sel-mode):
* msb.el (msb-mode):
* mwheel.el (mouse-wheel-mode):
* outline.el (outline-minor-mode):
* paren.el (show-paren-mode):
* recentf.el (recentf-mode):
* reveal.el (reveal-mode, global-reveal-mode):
* rfn-eshadow.el (file-name-shadow-mode):
* ruler-mode.el (ruler-mode):
* savehist.el (savehist-mode):
* scroll-all.el (scroll-all-mode):
* scroll-bar.el (scroll-bar-mode):
* server.el (server-mode):
* shell.el (shell-dirtrack-mode):
* simple.el (auto-fill-mode, transient-mark-mode)
(visual-line-mode, overwrite-mode, binary-overwrite-mode)
(line-number-mode, column-number-mode, size-indication-mode)
(auto-save-mode, normal-erase-is-backspace-mode, visible-mode):
* strokes.el (strokes-mode):
* time.el (display-time-mode):
* t-mouse.el (gpm-mouse-mode):
* tool-bar.el (tool-bar-mode):
* tooltip.el (tooltip-mode):
* type-break.el (type-break-mode-line-message-mode)
(type-break-query-mode):
* view.el (view-mode):
* whitespace.el (whitespace-mode, whitespace-newline-mode)
(global-whitespace-mode, global-whitespace-newline-mode):
* xt-mouse.el (xterm-mouse-mode): Doc fix.
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix
autogenerated docstring.
2011-10-19 12:54:24 +00:00
|
|
|
|
"Toggle global newline visualization (Global Whitespace Newline mode).
|
2008-07-24 04:12:27 +00:00
|
|
|
|
|
2008-08-06 03:35:04 +00:00
|
|
|
|
Use `global-whitespace-newline-mode' only for NEWLINE
|
|
|
|
|
visualization exclusively. For other visualizations, including
|
|
|
|
|
NEWLINE visualization together with (HARD) SPACEs and/or TABs,
|
2010-01-18 04:39:40 +00:00
|
|
|
|
please use `global-whitespace-mode'.
|
2008-08-06 03:35:04 +00:00
|
|
|
|
|
|
|
|
|
See also `whitespace-newline' and `whitespace-display-mappings'."
|
2008-07-24 04:12:27 +00:00
|
|
|
|
:lighter " NL"
|
|
|
|
|
:init-value nil
|
|
|
|
|
:global t
|
|
|
|
|
:group 'whitespace
|
|
|
|
|
(let ((whitespace-style '(newline-mark newline)))
|
2011-01-15 20:03:38 +00:00
|
|
|
|
(global-whitespace-mode (if global-whitespace-newline-mode
|
|
|
|
|
1 -1))
|
2008-07-24 04:12:27 +00:00
|
|
|
|
;; sync states (running a batch job)
|
|
|
|
|
(setq global-whitespace-newline-mode global-whitespace-mode)))
|
|
|
|
|
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;;;; User commands - Toggle
|
|
|
|
|
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(defconst whitespace-style-value-list
|
2010-08-25 02:27:58 +00:00
|
|
|
|
'(face
|
|
|
|
|
tabs
|
2008-01-17 12:46:55 +00:00
|
|
|
|
spaces
|
|
|
|
|
trailing
|
|
|
|
|
lines
|
2008-01-26 01:47:21 +00:00
|
|
|
|
lines-tail
|
2008-01-17 12:46:55 +00:00
|
|
|
|
newline
|
2008-01-25 14:09:57 +00:00
|
|
|
|
empty
|
2008-04-16 03:41:17 +00:00
|
|
|
|
indentation
|
|
|
|
|
indentation::tab
|
|
|
|
|
indentation::space
|
2014-10-18 00:23:03 +00:00
|
|
|
|
big-indent
|
2008-01-25 14:09:57 +00:00
|
|
|
|
space-after-tab
|
2008-04-16 03:41:17 +00:00
|
|
|
|
space-after-tab::tab
|
|
|
|
|
space-after-tab::space
|
|
|
|
|
space-before-tab
|
|
|
|
|
space-before-tab::tab
|
|
|
|
|
space-before-tab::space
|
2008-04-26 11:38:50 +00:00
|
|
|
|
help-newline ; value used by `whitespace-insert-option-mark'
|
|
|
|
|
tab-mark
|
2008-04-16 03:41:17 +00:00
|
|
|
|
space-mark
|
|
|
|
|
newline-mark
|
2008-01-17 12:46:55 +00:00
|
|
|
|
)
|
2008-04-26 11:38:50 +00:00
|
|
|
|
"List of valid `whitespace-style' values.")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defconst whitespace-toggle-option-alist
|
2010-08-25 02:27:58 +00:00
|
|
|
|
'((?f . face)
|
|
|
|
|
(?t . tabs)
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(?s . spaces)
|
|
|
|
|
(?r . trailing)
|
|
|
|
|
(?l . lines)
|
|
|
|
|
(?L . lines-tail)
|
|
|
|
|
(?n . newline)
|
|
|
|
|
(?e . empty)
|
|
|
|
|
(?\C-i . indentation)
|
|
|
|
|
(?I . indentation::tab)
|
|
|
|
|
(?i . indentation::space)
|
2014-10-18 00:23:03 +00:00
|
|
|
|
(?\C-t . big-indent)
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(?\C-a . space-after-tab)
|
|
|
|
|
(?A . space-after-tab::tab)
|
|
|
|
|
(?a . space-after-tab::space)
|
|
|
|
|
(?\C-b . space-before-tab)
|
|
|
|
|
(?B . space-before-tab::tab)
|
|
|
|
|
(?b . space-before-tab::space)
|
|
|
|
|
(?T . tab-mark)
|
|
|
|
|
(?S . space-mark)
|
|
|
|
|
(?N . newline-mark)
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(?x . whitespace-style)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
)
|
|
|
|
|
"Alist of toggle options.
|
|
|
|
|
|
|
|
|
|
Each element has the form:
|
|
|
|
|
|
|
|
|
|
(CHAR . SYMBOL)
|
|
|
|
|
|
|
|
|
|
Where:
|
|
|
|
|
|
|
|
|
|
CHAR is a char which the user will have to type.
|
|
|
|
|
|
|
|
|
|
SYMBOL is a valid symbol associated with CHAR.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
See `whitespace-style-value-list'.")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(defvar whitespace-active-style nil
|
|
|
|
|
"Used to save locally `whitespace-style' value.")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2009-09-25 02:23:51 +00:00
|
|
|
|
(defvar whitespace-point (point)
|
|
|
|
|
"Used to save locally current point value.
|
Disambiguate function and variable references in docstrings.
* lisp/comint.el (comint-history-isearch-message): Fix ambiguous doc
string cross-reference(s).
* lisp/ffap.el (ffap-string-at-point-region, ffap-next)
(ffap-string-at-point, ffap-string-around)
(ffap-copy-string-as-kill, ffap-highlight-overlay)
(ffap-literally): Fix ambiguous doc string cross-reference(s).
* lisp/font-lock.el (font-lock-keywords-alist)
(font-lock-removed-keywords-alist): Fix ambiguous doc string
cross-reference(s).
* lisp/help-mode.el (help-xref-symbol-regexp): Add "call" as a hint for
a cross-reference to a function.
* lisp/info.el (Info-find-emacs-command-nodes): Fix ambiguous doc
string cross-reference(s).
* lisp/isearch.el (isearch-message-function, isearch-fail-pos): Fix
ambiguous doc string cross-reference(s).
* lisp/misearch.el (multi-isearch-next-buffer-function): Fix ambiguous
doc string cross-reference(s).
* lisp/newcomment.el (comment-box): Fix ambiguous doc string
cross-reference(s).
* lisp/printing.el (pr-txt-printer-alist, pr-ps-printer-alist)
(pr-setting-database): Fix ambiguous doc string
cross-reference(s).
* lisp/ps-print.el (ps-even-or-odd-pages, ps-spool-buffer-with-faces)
(ps-n-up-filling-database): Fix ambiguous doc string
cross-reference(s).
* lisp/server.el (server-buffer, server-log): Fix ambiguous doc string
cross-reference(s).
* lisp/simple.el (newline, delete-backward-char, delete-forward-char)
(minibuffer-history-isearch-message, kill-line, track-eol)
(temporary-goal-column): Fix ambiguous doc string
cross-reference(s).
* lisp/whitespace.el (whitespace-point)
(whitespace-font-lock-refontify, whitespace-bob-marker)
(whitespace-eob-marker): Fix ambiguous doc string
cross-reference(s).
* lisp/calc/calc.el (calc-highlight-selections-with-faces)
(calc-dispatch): Fix ambiguous doc string cross-reference(s).
* lisp/emacs-lisp/edebug.el (edebug-read, edebug-eval-defun): Fix
ambiguous doc string cross-reference(s).
* lisp/gnus/gnus-start.el (gnus-check-new-newsgroups): Fix ambiguous doc string
cross-reference(s).
* lisp/gnus/gnus-sum.el (gnus-summary-newsgroup-prefix): Fix ambiguous doc string
cross-reference(s).
* lisp/international/mule.el (add-to-coding-system-list): Fix ambiguous
doc string cross-reference(s).
* lisp/progmodes/cc-fonts.el (c-font-lock-keywords-3)
(c++-font-lock-keywords-3, objc-font-lock-keywords-3)
(java-font-lock-keywords-3, idl-font-lock-keywords-3)
(pike-font-lock-keywords-3): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/compile.el (compile): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/etags.el (tags-table-files)
(tags-table-files-function, tags-included-tables-function): Fix
ambiguous doc string cross-reference(s).
* lisp/progmodes/gdb-mi.el (gdb, gdb-setup-windows)
(gdb-restore-windows): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/flyspell.el (flyspell-mark-duplications-flag)
(flyspell-default-deplacement-commands): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/ispell.el (ispell-accept-output): Fix ambiguous doc
string cross-reference(s).
* lisp/textmodes/sgml-mode.el (html-tag-help): Fix ambiguous doc string
cross-reference(s).
* lisp/vc/compare-w.el (compare-ignore-whitespace)
(compare-ignore-case, compare-windows-dehighlight): Fix ambiguous
doc string cross-reference(s).
* lisp/vc/diff.el (diff): Fix ambiguous doc string cross-reference(s).
* src/insdel.c (Fcombine_after_change_execute, syms_of_insdel): Fix
ambiguous doc string cross-reference(s).
* src/keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
doc string cross-reference(s).
* src/window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
string cross-reference(s).
Fixes: debbugs:12686
2013-01-11 23:08:55 +00:00
|
|
|
|
Used by function `whitespace-trailing-regexp' (which see).")
|
2014-05-29 03:54:37 +00:00
|
|
|
|
(defvar-local whitespace-point--used nil
|
|
|
|
|
"Region whose highlighting depends on `whitespace-point'.")
|
2009-09-25 02:23:51 +00:00
|
|
|
|
|
|
|
|
|
(defvar whitespace-font-lock-refontify nil
|
|
|
|
|
"Used to save locally the font-lock refontify state.
|
Disambiguate function and variable references in docstrings.
* lisp/comint.el (comint-history-isearch-message): Fix ambiguous doc
string cross-reference(s).
* lisp/ffap.el (ffap-string-at-point-region, ffap-next)
(ffap-string-at-point, ffap-string-around)
(ffap-copy-string-as-kill, ffap-highlight-overlay)
(ffap-literally): Fix ambiguous doc string cross-reference(s).
* lisp/font-lock.el (font-lock-keywords-alist)
(font-lock-removed-keywords-alist): Fix ambiguous doc string
cross-reference(s).
* lisp/help-mode.el (help-xref-symbol-regexp): Add "call" as a hint for
a cross-reference to a function.
* lisp/info.el (Info-find-emacs-command-nodes): Fix ambiguous doc
string cross-reference(s).
* lisp/isearch.el (isearch-message-function, isearch-fail-pos): Fix
ambiguous doc string cross-reference(s).
* lisp/misearch.el (multi-isearch-next-buffer-function): Fix ambiguous
doc string cross-reference(s).
* lisp/newcomment.el (comment-box): Fix ambiguous doc string
cross-reference(s).
* lisp/printing.el (pr-txt-printer-alist, pr-ps-printer-alist)
(pr-setting-database): Fix ambiguous doc string
cross-reference(s).
* lisp/ps-print.el (ps-even-or-odd-pages, ps-spool-buffer-with-faces)
(ps-n-up-filling-database): Fix ambiguous doc string
cross-reference(s).
* lisp/server.el (server-buffer, server-log): Fix ambiguous doc string
cross-reference(s).
* lisp/simple.el (newline, delete-backward-char, delete-forward-char)
(minibuffer-history-isearch-message, kill-line, track-eol)
(temporary-goal-column): Fix ambiguous doc string
cross-reference(s).
* lisp/whitespace.el (whitespace-point)
(whitespace-font-lock-refontify, whitespace-bob-marker)
(whitespace-eob-marker): Fix ambiguous doc string
cross-reference(s).
* lisp/calc/calc.el (calc-highlight-selections-with-faces)
(calc-dispatch): Fix ambiguous doc string cross-reference(s).
* lisp/emacs-lisp/edebug.el (edebug-read, edebug-eval-defun): Fix
ambiguous doc string cross-reference(s).
* lisp/gnus/gnus-start.el (gnus-check-new-newsgroups): Fix ambiguous doc string
cross-reference(s).
* lisp/gnus/gnus-sum.el (gnus-summary-newsgroup-prefix): Fix ambiguous doc string
cross-reference(s).
* lisp/international/mule.el (add-to-coding-system-list): Fix ambiguous
doc string cross-reference(s).
* lisp/progmodes/cc-fonts.el (c-font-lock-keywords-3)
(c++-font-lock-keywords-3, objc-font-lock-keywords-3)
(java-font-lock-keywords-3, idl-font-lock-keywords-3)
(pike-font-lock-keywords-3): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/compile.el (compile): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/etags.el (tags-table-files)
(tags-table-files-function, tags-included-tables-function): Fix
ambiguous doc string cross-reference(s).
* lisp/progmodes/gdb-mi.el (gdb, gdb-setup-windows)
(gdb-restore-windows): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/flyspell.el (flyspell-mark-duplications-flag)
(flyspell-default-deplacement-commands): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/ispell.el (ispell-accept-output): Fix ambiguous doc
string cross-reference(s).
* lisp/textmodes/sgml-mode.el (html-tag-help): Fix ambiguous doc string
cross-reference(s).
* lisp/vc/compare-w.el (compare-ignore-whitespace)
(compare-ignore-case, compare-windows-dehighlight): Fix ambiguous
doc string cross-reference(s).
* lisp/vc/diff.el (diff): Fix ambiguous doc string cross-reference(s).
* src/insdel.c (Fcombine_after_change_execute, syms_of_insdel): Fix
ambiguous doc string cross-reference(s).
* src/keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
doc string cross-reference(s).
* src/window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
string cross-reference(s).
Fixes: debbugs:12686
2013-01-11 23:08:55 +00:00
|
|
|
|
Used by function `whitespace-post-command-hook' (which see).")
|
2009-09-25 02:23:51 +00:00
|
|
|
|
|
2010-08-21 04:43:04 +00:00
|
|
|
|
(defvar whitespace-bob-marker nil
|
|
|
|
|
"Used to save locally the bob marker value.
|
Disambiguate function and variable references in docstrings.
* lisp/comint.el (comint-history-isearch-message): Fix ambiguous doc
string cross-reference(s).
* lisp/ffap.el (ffap-string-at-point-region, ffap-next)
(ffap-string-at-point, ffap-string-around)
(ffap-copy-string-as-kill, ffap-highlight-overlay)
(ffap-literally): Fix ambiguous doc string cross-reference(s).
* lisp/font-lock.el (font-lock-keywords-alist)
(font-lock-removed-keywords-alist): Fix ambiguous doc string
cross-reference(s).
* lisp/help-mode.el (help-xref-symbol-regexp): Add "call" as a hint for
a cross-reference to a function.
* lisp/info.el (Info-find-emacs-command-nodes): Fix ambiguous doc
string cross-reference(s).
* lisp/isearch.el (isearch-message-function, isearch-fail-pos): Fix
ambiguous doc string cross-reference(s).
* lisp/misearch.el (multi-isearch-next-buffer-function): Fix ambiguous
doc string cross-reference(s).
* lisp/newcomment.el (comment-box): Fix ambiguous doc string
cross-reference(s).
* lisp/printing.el (pr-txt-printer-alist, pr-ps-printer-alist)
(pr-setting-database): Fix ambiguous doc string
cross-reference(s).
* lisp/ps-print.el (ps-even-or-odd-pages, ps-spool-buffer-with-faces)
(ps-n-up-filling-database): Fix ambiguous doc string
cross-reference(s).
* lisp/server.el (server-buffer, server-log): Fix ambiguous doc string
cross-reference(s).
* lisp/simple.el (newline, delete-backward-char, delete-forward-char)
(minibuffer-history-isearch-message, kill-line, track-eol)
(temporary-goal-column): Fix ambiguous doc string
cross-reference(s).
* lisp/whitespace.el (whitespace-point)
(whitespace-font-lock-refontify, whitespace-bob-marker)
(whitespace-eob-marker): Fix ambiguous doc string
cross-reference(s).
* lisp/calc/calc.el (calc-highlight-selections-with-faces)
(calc-dispatch): Fix ambiguous doc string cross-reference(s).
* lisp/emacs-lisp/edebug.el (edebug-read, edebug-eval-defun): Fix
ambiguous doc string cross-reference(s).
* lisp/gnus/gnus-start.el (gnus-check-new-newsgroups): Fix ambiguous doc string
cross-reference(s).
* lisp/gnus/gnus-sum.el (gnus-summary-newsgroup-prefix): Fix ambiguous doc string
cross-reference(s).
* lisp/international/mule.el (add-to-coding-system-list): Fix ambiguous
doc string cross-reference(s).
* lisp/progmodes/cc-fonts.el (c-font-lock-keywords-3)
(c++-font-lock-keywords-3, objc-font-lock-keywords-3)
(java-font-lock-keywords-3, idl-font-lock-keywords-3)
(pike-font-lock-keywords-3): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/compile.el (compile): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/etags.el (tags-table-files)
(tags-table-files-function, tags-included-tables-function): Fix
ambiguous doc string cross-reference(s).
* lisp/progmodes/gdb-mi.el (gdb, gdb-setup-windows)
(gdb-restore-windows): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/flyspell.el (flyspell-mark-duplications-flag)
(flyspell-default-deplacement-commands): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/ispell.el (ispell-accept-output): Fix ambiguous doc
string cross-reference(s).
* lisp/textmodes/sgml-mode.el (html-tag-help): Fix ambiguous doc string
cross-reference(s).
* lisp/vc/compare-w.el (compare-ignore-whitespace)
(compare-ignore-case, compare-windows-dehighlight): Fix ambiguous
doc string cross-reference(s).
* lisp/vc/diff.el (diff): Fix ambiguous doc string cross-reference(s).
* src/insdel.c (Fcombine_after_change_execute, syms_of_insdel): Fix
ambiguous doc string cross-reference(s).
* src/keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
doc string cross-reference(s).
* src/window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
string cross-reference(s).
Fixes: debbugs:12686
2013-01-11 23:08:55 +00:00
|
|
|
|
Used by function `whitespace-post-command-hook' (which see).")
|
2010-08-21 04:43:04 +00:00
|
|
|
|
|
|
|
|
|
(defvar whitespace-eob-marker nil
|
|
|
|
|
"Used to save locally the eob marker value.
|
Disambiguate function and variable references in docstrings.
* lisp/comint.el (comint-history-isearch-message): Fix ambiguous doc
string cross-reference(s).
* lisp/ffap.el (ffap-string-at-point-region, ffap-next)
(ffap-string-at-point, ffap-string-around)
(ffap-copy-string-as-kill, ffap-highlight-overlay)
(ffap-literally): Fix ambiguous doc string cross-reference(s).
* lisp/font-lock.el (font-lock-keywords-alist)
(font-lock-removed-keywords-alist): Fix ambiguous doc string
cross-reference(s).
* lisp/help-mode.el (help-xref-symbol-regexp): Add "call" as a hint for
a cross-reference to a function.
* lisp/info.el (Info-find-emacs-command-nodes): Fix ambiguous doc
string cross-reference(s).
* lisp/isearch.el (isearch-message-function, isearch-fail-pos): Fix
ambiguous doc string cross-reference(s).
* lisp/misearch.el (multi-isearch-next-buffer-function): Fix ambiguous
doc string cross-reference(s).
* lisp/newcomment.el (comment-box): Fix ambiguous doc string
cross-reference(s).
* lisp/printing.el (pr-txt-printer-alist, pr-ps-printer-alist)
(pr-setting-database): Fix ambiguous doc string
cross-reference(s).
* lisp/ps-print.el (ps-even-or-odd-pages, ps-spool-buffer-with-faces)
(ps-n-up-filling-database): Fix ambiguous doc string
cross-reference(s).
* lisp/server.el (server-buffer, server-log): Fix ambiguous doc string
cross-reference(s).
* lisp/simple.el (newline, delete-backward-char, delete-forward-char)
(minibuffer-history-isearch-message, kill-line, track-eol)
(temporary-goal-column): Fix ambiguous doc string
cross-reference(s).
* lisp/whitespace.el (whitespace-point)
(whitespace-font-lock-refontify, whitespace-bob-marker)
(whitespace-eob-marker): Fix ambiguous doc string
cross-reference(s).
* lisp/calc/calc.el (calc-highlight-selections-with-faces)
(calc-dispatch): Fix ambiguous doc string cross-reference(s).
* lisp/emacs-lisp/edebug.el (edebug-read, edebug-eval-defun): Fix
ambiguous doc string cross-reference(s).
* lisp/gnus/gnus-start.el (gnus-check-new-newsgroups): Fix ambiguous doc string
cross-reference(s).
* lisp/gnus/gnus-sum.el (gnus-summary-newsgroup-prefix): Fix ambiguous doc string
cross-reference(s).
* lisp/international/mule.el (add-to-coding-system-list): Fix ambiguous
doc string cross-reference(s).
* lisp/progmodes/cc-fonts.el (c-font-lock-keywords-3)
(c++-font-lock-keywords-3, objc-font-lock-keywords-3)
(java-font-lock-keywords-3, idl-font-lock-keywords-3)
(pike-font-lock-keywords-3): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/compile.el (compile): Fix ambiguous doc string
cross-reference(s).
* lisp/progmodes/etags.el (tags-table-files)
(tags-table-files-function, tags-included-tables-function): Fix
ambiguous doc string cross-reference(s).
* lisp/progmodes/gdb-mi.el (gdb, gdb-setup-windows)
(gdb-restore-windows): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/flyspell.el (flyspell-mark-duplications-flag)
(flyspell-default-deplacement-commands): Fix ambiguous doc string
cross-reference(s).
* lisp/textmodes/ispell.el (ispell-accept-output): Fix ambiguous doc
string cross-reference(s).
* lisp/textmodes/sgml-mode.el (html-tag-help): Fix ambiguous doc string
cross-reference(s).
* lisp/vc/compare-w.el (compare-ignore-whitespace)
(compare-ignore-case, compare-windows-dehighlight): Fix ambiguous
doc string cross-reference(s).
* lisp/vc/diff.el (diff): Fix ambiguous doc string cross-reference(s).
* src/insdel.c (Fcombine_after_change_execute, syms_of_insdel): Fix
ambiguous doc string cross-reference(s).
* src/keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
doc string cross-reference(s).
* src/window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
string cross-reference(s).
Fixes: debbugs:12686
2013-01-11 23:08:55 +00:00
|
|
|
|
Used by function `whitespace-post-command-hook' (which see).")
|
2010-08-21 04:43:04 +00:00
|
|
|
|
|
|
|
|
|
(defvar whitespace-buffer-changed nil
|
|
|
|
|
"Used to indicate locally if buffer changed.
|
|
|
|
|
Used by `whitespace-post-command-hook' and `whitespace-buffer-changed'
|
|
|
|
|
functions (which see).")
|
|
|
|
|
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defun whitespace-toggle-options (arg)
|
|
|
|
|
"Toggle local `whitespace-mode' options.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
If local whitespace-mode is off, toggle the option given by ARG
|
|
|
|
|
and turn on local whitespace-mode.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
If local whitespace-mode is on, toggle the option given by ARG
|
|
|
|
|
and restart local whitespace-mode.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
Interactively, it reads one of the following chars:
|
|
|
|
|
|
|
|
|
|
CHAR MEANING
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(VIA FACES)
|
2010-08-25 02:27:58 +00:00
|
|
|
|
f toggle face visualization
|
2008-01-21 12:45:58 +00:00
|
|
|
|
t toggle TAB visualization
|
|
|
|
|
s toggle SPACE and HARD SPACE visualization
|
|
|
|
|
r toggle trailing blanks visualization
|
|
|
|
|
l toggle \"long lines\" visualization
|
2008-01-26 01:47:21 +00:00
|
|
|
|
L toggle \"long lines\" tail visualization
|
2008-01-21 12:45:58 +00:00
|
|
|
|
n toggle NEWLINE visualization
|
2008-01-25 14:09:57 +00:00
|
|
|
|
e toggle empty line at bob and/or eob visualization
|
2008-04-16 03:41:17 +00:00
|
|
|
|
C-i toggle indentation SPACEs visualization (via `indent-tabs-mode')
|
|
|
|
|
I toggle indentation SPACEs visualization
|
|
|
|
|
i toggle indentation TABs visualization
|
2014-10-18 00:23:03 +00:00
|
|
|
|
C-t toggle big indentation visualization
|
2008-04-16 03:41:17 +00:00
|
|
|
|
C-a toggle SPACEs after TAB visualization (via `indent-tabs-mode')
|
|
|
|
|
A toggle SPACEs after TAB: SPACEs visualization
|
|
|
|
|
a toggle SPACEs after TAB: TABs visualization
|
|
|
|
|
C-b toggle SPACEs before TAB visualization (via `indent-tabs-mode')
|
|
|
|
|
B toggle SPACEs before TAB: SPACEs visualization
|
|
|
|
|
b toggle SPACEs before TAB: TABs visualization
|
|
|
|
|
|
|
|
|
|
(VIA DISPLAY TABLE)
|
|
|
|
|
T toggle TAB visualization
|
|
|
|
|
S toggle SPACEs before TAB visualization
|
|
|
|
|
N toggle NEWLINE visualization
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
x restore `whitespace-style' value
|
2008-01-17 12:46:55 +00:00
|
|
|
|
? display brief help
|
|
|
|
|
|
2008-01-21 12:45:58 +00:00
|
|
|
|
Non-interactively, ARG should be a symbol or a list of symbols.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
The valid symbols are:
|
|
|
|
|
|
2010-08-25 02:27:58 +00:00
|
|
|
|
face toggle face visualization
|
2008-01-21 12:45:58 +00:00
|
|
|
|
tabs toggle TAB visualization
|
|
|
|
|
spaces toggle SPACE and HARD SPACE visualization
|
|
|
|
|
trailing toggle trailing blanks visualization
|
|
|
|
|
lines toggle \"long lines\" visualization
|
2008-01-26 01:47:21 +00:00
|
|
|
|
lines-tail toggle \"long lines\" tail visualization
|
2008-01-21 12:45:58 +00:00
|
|
|
|
newline toggle NEWLINE visualization
|
2008-01-25 14:09:57 +00:00
|
|
|
|
empty toggle empty line at bob and/or eob visualization
|
2008-04-16 03:41:17 +00:00
|
|
|
|
indentation toggle indentation SPACEs visualization
|
|
|
|
|
indentation::tab toggle indentation SPACEs visualization
|
|
|
|
|
indentation::space toggle indentation TABs visualization
|
2014-10-18 00:23:03 +00:00
|
|
|
|
big-indent toggle big indentation visualization
|
2008-04-16 03:41:17 +00:00
|
|
|
|
space-after-tab toggle SPACEs after TAB visualization
|
|
|
|
|
space-after-tab::tab toggle SPACEs after TAB: SPACEs visualization
|
|
|
|
|
space-after-tab::space toggle SPACEs after TAB: TABs visualization
|
|
|
|
|
space-before-tab toggle SPACEs before TAB visualization
|
|
|
|
|
space-before-tab::tab toggle SPACEs before TAB: SPACEs visualization
|
|
|
|
|
space-before-tab::space toggle SPACEs before TAB: TABs visualization
|
|
|
|
|
|
|
|
|
|
tab-mark toggle TAB visualization
|
|
|
|
|
space-mark toggle SPACEs before TAB visualization
|
|
|
|
|
newline-mark toggle NEWLINE visualization
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
whitespace-style restore `whitespace-style' value
|
2008-04-16 03:41:17 +00:00
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
See `whitespace-style' and `indent-tabs-mode' for documentation."
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(interactive (whitespace-interactive-char t))
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(let ((whitespace-style
|
|
|
|
|
(whitespace-toggle-list t arg whitespace-active-style)))
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(whitespace-mode 0)
|
|
|
|
|
(whitespace-mode 1)))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(defvar whitespace-toggle-style nil
|
|
|
|
|
"Used to toggle the global `whitespace-style' value.")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defun global-whitespace-toggle-options (arg)
|
|
|
|
|
"Toggle global `whitespace-mode' options.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
If global whitespace-mode is off, toggle the option given by ARG
|
|
|
|
|
and turn on global whitespace-mode.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
If global whitespace-mode is on, toggle the option given by ARG
|
|
|
|
|
and restart global whitespace-mode.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
(whitespace): Set :version tag to 23.1.
(whitespace-turn-off, whitespace-toggle-options): Fix typos.
(whitespace-style, whitespace-chars, whitespace-space, whitespace-hspace,
whitespace-tab, whitespace-newline, whitespace-trailing, whitespace-line,
whitespace-space-before-tab, whitespace-indentation, whitespace-empty,
whitespace-space-after-tab, whitespace-hspace-regexp, whitespace-space-regexp,
whitespace-tab-regexp, whitespace-trailing-regexp,
whitespace-space-before-tab-regexp, whitespace-indentation-regexp,
whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp,
whitespace-space-after-tab-regexp, whitespace-line-column,
whitespace-display-mappings, global-whitespace-toggle-options,
whitespace-cleanup, whitespace-cleanup-region, whitespace-interactive-char):
Doc fixes.
2008-02-01 14:44:44 +00:00
|
|
|
|
Interactively, it accepts one of the following chars:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
CHAR MEANING
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(VIA FACES)
|
2010-08-25 02:27:58 +00:00
|
|
|
|
f toggle face visualization
|
2008-01-21 12:45:58 +00:00
|
|
|
|
t toggle TAB visualization
|
|
|
|
|
s toggle SPACE and HARD SPACE visualization
|
|
|
|
|
r toggle trailing blanks visualization
|
|
|
|
|
l toggle \"long lines\" visualization
|
2008-01-26 01:47:21 +00:00
|
|
|
|
L toggle \"long lines\" tail visualization
|
2008-01-21 12:45:58 +00:00
|
|
|
|
n toggle NEWLINE visualization
|
2008-01-25 14:09:57 +00:00
|
|
|
|
e toggle empty line at bob and/or eob visualization
|
2008-04-16 03:41:17 +00:00
|
|
|
|
C-i toggle indentation SPACEs visualization (via `indent-tabs-mode')
|
|
|
|
|
I toggle indentation SPACEs visualization
|
|
|
|
|
i toggle indentation TABs visualization
|
2014-10-18 00:23:03 +00:00
|
|
|
|
C-t toggle big indentation visualization
|
2008-04-16 03:41:17 +00:00
|
|
|
|
C-a toggle SPACEs after TAB visualization (via `indent-tabs-mode')
|
|
|
|
|
A toggle SPACEs after TAB: SPACEs visualization
|
|
|
|
|
a toggle SPACEs after TAB: TABs visualization
|
|
|
|
|
C-b toggle SPACEs before TAB visualization (via `indent-tabs-mode')
|
|
|
|
|
B toggle SPACEs before TAB: SPACEs visualization
|
|
|
|
|
b toggle SPACEs before TAB: TABs visualization
|
|
|
|
|
|
|
|
|
|
(VIA DISPLAY TABLE)
|
|
|
|
|
T toggle TAB visualization
|
|
|
|
|
S toggle SPACEs before TAB visualization
|
|
|
|
|
N toggle NEWLINE visualization
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
x restore `whitespace-style' value
|
2008-01-17 12:46:55 +00:00
|
|
|
|
? display brief help
|
|
|
|
|
|
2008-01-21 12:45:58 +00:00
|
|
|
|
Non-interactively, ARG should be a symbol or a list of symbols.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
The valid symbols are:
|
|
|
|
|
|
2010-08-25 02:27:58 +00:00
|
|
|
|
face toggle face visualization
|
2008-01-21 12:45:58 +00:00
|
|
|
|
tabs toggle TAB visualization
|
|
|
|
|
spaces toggle SPACE and HARD SPACE visualization
|
|
|
|
|
trailing toggle trailing blanks visualization
|
|
|
|
|
lines toggle \"long lines\" visualization
|
2008-01-26 01:47:21 +00:00
|
|
|
|
lines-tail toggle \"long lines\" tail visualization
|
2008-01-21 12:45:58 +00:00
|
|
|
|
newline toggle NEWLINE visualization
|
2008-01-25 14:09:57 +00:00
|
|
|
|
empty toggle empty line at bob and/or eob visualization
|
2008-04-16 03:41:17 +00:00
|
|
|
|
indentation toggle indentation SPACEs visualization
|
|
|
|
|
indentation::tab toggle indentation SPACEs visualization
|
|
|
|
|
indentation::space toggle indentation TABs visualization
|
2014-10-18 00:23:03 +00:00
|
|
|
|
big-indent toggle big indentation visualization
|
2008-04-16 03:41:17 +00:00
|
|
|
|
space-after-tab toggle SPACEs after TAB visualization
|
|
|
|
|
space-after-tab::tab toggle SPACEs after TAB: SPACEs visualization
|
|
|
|
|
space-after-tab::space toggle SPACEs after TAB: TABs visualization
|
|
|
|
|
space-before-tab toggle SPACEs before TAB visualization
|
|
|
|
|
space-before-tab::tab toggle SPACEs before TAB: SPACEs visualization
|
|
|
|
|
space-before-tab::space toggle SPACEs before TAB: TABs visualization
|
|
|
|
|
|
|
|
|
|
tab-mark toggle TAB visualization
|
|
|
|
|
space-mark toggle SPACEs before TAB visualization
|
|
|
|
|
newline-mark toggle NEWLINE visualization
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
whitespace-style restore `whitespace-style' value
|
2008-04-16 03:41:17 +00:00
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
See `whitespace-style' and `indent-tabs-mode' for documentation."
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(interactive (whitespace-interactive-char nil))
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(let ((whitespace-style
|
|
|
|
|
(whitespace-toggle-list nil arg whitespace-toggle-style)))
|
|
|
|
|
(setq whitespace-toggle-style whitespace-style)
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(global-whitespace-mode 0)
|
|
|
|
|
(global-whitespace-mode 1)))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;;;; User commands - Cleanup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defun whitespace-cleanup ()
|
2008-01-25 14:09:57 +00:00
|
|
|
|
"Cleanup some blank problems in all buffer or at region.
|
|
|
|
|
|
|
|
|
|
It usually applies to the whole buffer, but in transient mark
|
|
|
|
|
mode when the mark is active, it applies to the region. It also
|
2008-10-18 15:51:35 +00:00
|
|
|
|
applies to the region when it is not in transient mark mode, the
|
2008-04-16 03:41:17 +00:00
|
|
|
|
mark is active and \\[universal-argument] was pressed just before
|
|
|
|
|
calling `whitespace-cleanup' interactively.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
See also `whitespace-cleanup-region'.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
(whitespace): Set :version tag to 23.1.
(whitespace-turn-off, whitespace-toggle-options): Fix typos.
(whitespace-style, whitespace-chars, whitespace-space, whitespace-hspace,
whitespace-tab, whitespace-newline, whitespace-trailing, whitespace-line,
whitespace-space-before-tab, whitespace-indentation, whitespace-empty,
whitespace-space-after-tab, whitespace-hspace-regexp, whitespace-space-regexp,
whitespace-tab-regexp, whitespace-trailing-regexp,
whitespace-space-before-tab-regexp, whitespace-indentation-regexp,
whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp,
whitespace-space-after-tab-regexp, whitespace-line-column,
whitespace-display-mappings, global-whitespace-toggle-options,
whitespace-cleanup, whitespace-cleanup-region, whitespace-interactive-char):
Doc fixes.
2008-02-01 14:44:44 +00:00
|
|
|
|
The problems cleaned up are:
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
|
|
|
|
1. empty lines at beginning of buffer.
|
|
|
|
|
2. empty lines at end of buffer.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value `empty', remove all
|
2008-01-31 16:08:29 +00:00
|
|
|
|
empty lines at beginning and/or end of buffer.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2016-10-25 22:04:18 +00:00
|
|
|
|
3. `tab-width' or more SPACEs at beginning of line.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value `indentation':
|
2016-10-25 22:04:18 +00:00
|
|
|
|
replace `tab-width' or more SPACEs at beginning of line by
|
|
|
|
|
TABs, if `indent-tabs-mode' is non-nil; otherwise, replace TABs by
|
2008-04-16 03:41:17 +00:00
|
|
|
|
SPACEs.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value `indentation::tab',
|
2016-10-25 22:04:18 +00:00
|
|
|
|
replace `tab-width' or more SPACEs at beginning of line by TABs.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value `indentation::space',
|
|
|
|
|
replace TABs by SPACEs.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
|
|
|
|
4. SPACEs before TAB.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value `space-before-tab':
|
2008-04-16 03:41:17 +00:00
|
|
|
|
replace SPACEs by TABs, if `indent-tabs-mode' is non-nil;
|
|
|
|
|
otherwise, replace TABs by SPACEs.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value
|
2008-04-16 03:41:17 +00:00
|
|
|
|
`space-before-tab::tab', replace SPACEs by TABs.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value
|
2008-04-16 03:41:17 +00:00
|
|
|
|
`space-before-tab::space', replace TABs by SPACEs.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
|
|
|
|
5. SPACEs or TABs at end of line.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value `trailing', remove
|
2008-04-16 03:41:17 +00:00
|
|
|
|
all SPACEs or TABs at end of line.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2016-10-25 22:04:18 +00:00
|
|
|
|
6. `tab-width' or more SPACEs after TAB.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value `space-after-tab':
|
2008-04-16 03:41:17 +00:00
|
|
|
|
replace SPACEs by TABs, if `indent-tabs-mode' is non-nil;
|
|
|
|
|
otherwise, replace TABs by SPACEs.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value
|
2008-04-16 03:41:17 +00:00
|
|
|
|
`space-after-tab::tab', replace SPACEs by TABs.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value
|
2008-04-16 03:41:17 +00:00
|
|
|
|
`space-after-tab::space', replace TABs by SPACEs.
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
See `whitespace-style', `indent-tabs-mode' and `tab-width' for
|
|
|
|
|
documentation."
|
2008-09-06 00:19:31 +00:00
|
|
|
|
(interactive "@")
|
|
|
|
|
(cond
|
|
|
|
|
;; read-only buffer
|
|
|
|
|
(buffer-read-only
|
|
|
|
|
(whitespace-warn-read-only "cleanup"))
|
|
|
|
|
;; region active
|
|
|
|
|
((and (or transient-mark-mode
|
|
|
|
|
current-prefix-arg)
|
|
|
|
|
mark-active)
|
|
|
|
|
;; PROBLEMs 1 and 2 are not handled in region
|
2016-10-25 22:04:18 +00:00
|
|
|
|
;; PROBLEM 3: `tab-width' or more SPACEs at bol
|
2008-09-06 00:19:31 +00:00
|
|
|
|
;; PROBLEM 4: SPACEs before TAB
|
|
|
|
|
;; PROBLEM 5: SPACEs or TABs at eol
|
2016-10-25 22:04:18 +00:00
|
|
|
|
;; PROBLEM 6: `tab-width' or more SPACEs after TAB
|
2008-09-06 00:19:31 +00:00
|
|
|
|
(whitespace-cleanup-region (region-beginning) (region-end)))
|
|
|
|
|
;; whole buffer
|
|
|
|
|
(t
|
2008-01-25 14:09:57 +00:00
|
|
|
|
(save-excursion
|
2016-12-24 14:41:46 +00:00
|
|
|
|
;; PROBLEM 1: empty lines at bob
|
|
|
|
|
;; PROBLEM 2: empty lines at eob
|
|
|
|
|
;; ACTION: remove all empty lines at bob and/or eob
|
|
|
|
|
(when (memq 'empty whitespace-style)
|
|
|
|
|
(let (overwrite-mode) ; enforce no overwrite
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(when (looking-at whitespace-empty-at-bob-regexp)
|
|
|
|
|
(delete-region (match-beginning 1) (match-end 1)))
|
|
|
|
|
(when (re-search-forward
|
|
|
|
|
whitespace-empty-at-eob-regexp nil t)
|
|
|
|
|
(delete-region (match-beginning 1) (match-end 1))))))
|
2016-10-25 22:04:18 +00:00
|
|
|
|
;; PROBLEM 3: `tab-width' or more SPACEs at bol
|
2008-04-16 03:41:17 +00:00
|
|
|
|
;; PROBLEM 4: SPACEs before TAB
|
|
|
|
|
;; PROBLEM 5: SPACEs or TABs at eol
|
2016-10-25 22:04:18 +00:00
|
|
|
|
;; PROBLEM 6: `tab-width' or more SPACEs after TAB
|
2008-09-06 00:19:31 +00:00
|
|
|
|
(whitespace-cleanup-region (point-min) (point-max)))))
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defun whitespace-cleanup-region (start end)
|
2008-01-25 14:09:57 +00:00
|
|
|
|
"Cleanup some blank problems at region.
|
|
|
|
|
|
(whitespace): Set :version tag to 23.1.
(whitespace-turn-off, whitespace-toggle-options): Fix typos.
(whitespace-style, whitespace-chars, whitespace-space, whitespace-hspace,
whitespace-tab, whitespace-newline, whitespace-trailing, whitespace-line,
whitespace-space-before-tab, whitespace-indentation, whitespace-empty,
whitespace-space-after-tab, whitespace-hspace-regexp, whitespace-space-regexp,
whitespace-tab-regexp, whitespace-trailing-regexp,
whitespace-space-before-tab-regexp, whitespace-indentation-regexp,
whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp,
whitespace-space-after-tab-regexp, whitespace-line-column,
whitespace-display-mappings, global-whitespace-toggle-options,
whitespace-cleanup, whitespace-cleanup-region, whitespace-interactive-char):
Doc fixes.
2008-02-01 14:44:44 +00:00
|
|
|
|
The problems cleaned up are:
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2016-10-25 22:04:18 +00:00
|
|
|
|
1. `tab-width' or more SPACEs at beginning of line.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value `indentation':
|
2016-10-25 22:04:18 +00:00
|
|
|
|
replace `tab-width' or more SPACEs at beginning of line by TABs,
|
|
|
|
|
if `indent-tabs-mode' is non-nil; otherwise, replace TABs by
|
2008-04-16 03:41:17 +00:00
|
|
|
|
SPACEs.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value `indentation::tab',
|
2016-10-25 22:04:18 +00:00
|
|
|
|
replace `tab-width' or more SPACEs at beginning of line by TABs.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value `indentation::space',
|
|
|
|
|
replace TABs by SPACEs.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
|
|
|
|
2. SPACEs before TAB.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value `space-before-tab':
|
2008-04-16 03:41:17 +00:00
|
|
|
|
replace SPACEs by TABs, if `indent-tabs-mode' is non-nil;
|
|
|
|
|
otherwise, replace TABs by SPACEs.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value
|
2008-04-16 03:41:17 +00:00
|
|
|
|
`space-before-tab::tab', replace SPACEs by TABs.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value
|
2008-04-16 03:41:17 +00:00
|
|
|
|
`space-before-tab::space', replace TABs by SPACEs.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
|
|
|
|
3. SPACEs or TABs at end of line.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value `trailing', remove
|
2008-04-16 03:41:17 +00:00
|
|
|
|
all SPACEs or TABs at end of line.
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2016-10-25 22:04:18 +00:00
|
|
|
|
4. `tab-width' or more SPACEs after TAB.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value `space-after-tab':
|
2008-04-16 03:41:17 +00:00
|
|
|
|
replace SPACEs by TABs, if `indent-tabs-mode' is non-nil;
|
|
|
|
|
otherwise, replace TABs by SPACEs.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value
|
2008-04-16 03:41:17 +00:00
|
|
|
|
`space-after-tab::tab', replace SPACEs by TABs.
|
2008-04-26 11:38:50 +00:00
|
|
|
|
If `whitespace-style' includes the value
|
2008-04-16 03:41:17 +00:00
|
|
|
|
`space-after-tab::space', replace TABs by SPACEs.
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
See `whitespace-style', `indent-tabs-mode' and `tab-width' for
|
|
|
|
|
documentation."
|
2008-09-06 00:19:31 +00:00
|
|
|
|
(interactive "@r")
|
|
|
|
|
(if buffer-read-only
|
|
|
|
|
;; read-only buffer
|
|
|
|
|
(whitespace-warn-read-only "cleanup region")
|
|
|
|
|
;; non-read-only buffer
|
|
|
|
|
(let ((rstart (min start end))
|
|
|
|
|
(rend (copy-marker (max start end)))
|
|
|
|
|
overwrite-mode ; enforce no overwrite
|
|
|
|
|
tmp)
|
|
|
|
|
(save-excursion
|
2016-12-24 14:41:46 +00:00
|
|
|
|
;; PROBLEM 1: `tab-width' or more SPACEs at bol
|
|
|
|
|
(cond
|
|
|
|
|
;; ACTION: replace `tab-width' or more SPACEs at bol by TABs, if
|
|
|
|
|
;; `indent-tabs-mode' is non-nil; otherwise, replace TABs
|
|
|
|
|
;; by SPACEs.
|
|
|
|
|
((memq 'indentation whitespace-style)
|
|
|
|
|
(let ((regexp (whitespace-indentation-regexp)))
|
|
|
|
|
(goto-char rstart)
|
|
|
|
|
(while (re-search-forward regexp rend t)
|
|
|
|
|
(setq tmp (current-indentation))
|
|
|
|
|
(goto-char (match-beginning 0))
|
|
|
|
|
(delete-horizontal-space)
|
|
|
|
|
(unless (eolp)
|
|
|
|
|
(indent-to tmp)))))
|
|
|
|
|
;; ACTION: replace `tab-width' or more SPACEs at bol by TABs.
|
|
|
|
|
((memq 'indentation::tab whitespace-style)
|
|
|
|
|
(whitespace-replace-action
|
|
|
|
|
'tabify rstart rend
|
|
|
|
|
(whitespace-indentation-regexp 'tab) 0))
|
|
|
|
|
;; ACTION: replace TABs by SPACEs.
|
|
|
|
|
((memq 'indentation::space whitespace-style)
|
|
|
|
|
(whitespace-replace-action
|
|
|
|
|
'untabify rstart rend
|
|
|
|
|
(whitespace-indentation-regexp 'space) 0)))
|
|
|
|
|
;; PROBLEM 3: SPACEs or TABs at eol
|
|
|
|
|
;; ACTION: remove all SPACEs or TABs at eol
|
|
|
|
|
(when (memq 'trailing whitespace-style)
|
|
|
|
|
(whitespace-replace-action
|
|
|
|
|
'delete-region rstart rend
|
|
|
|
|
whitespace-trailing-regexp 1))
|
|
|
|
|
;; PROBLEM 4: `tab-width' or more SPACEs after TAB
|
|
|
|
|
(cond
|
|
|
|
|
;; ACTION: replace `tab-width' or more SPACEs by TABs, if
|
|
|
|
|
;; `indent-tabs-mode' is non-nil; otherwise, replace TABs
|
|
|
|
|
;; by SPACEs.
|
|
|
|
|
((memq 'space-after-tab whitespace-style)
|
|
|
|
|
(whitespace-replace-action
|
2017-03-02 12:50:06 +00:00
|
|
|
|
(if indent-tabs-mode 'tabify 'untabify)
|
2016-12-24 14:41:46 +00:00
|
|
|
|
rstart rend (whitespace-space-after-tab-regexp) 1))
|
|
|
|
|
;; ACTION: replace `tab-width' or more SPACEs by TABs.
|
|
|
|
|
((memq 'space-after-tab::tab whitespace-style)
|
|
|
|
|
(whitespace-replace-action
|
|
|
|
|
'tabify rstart rend
|
|
|
|
|
(whitespace-space-after-tab-regexp 'tab) 1))
|
|
|
|
|
;; ACTION: replace TABs by SPACEs.
|
|
|
|
|
((memq 'space-after-tab::space whitespace-style)
|
|
|
|
|
(whitespace-replace-action
|
|
|
|
|
'untabify rstart rend
|
|
|
|
|
(whitespace-space-after-tab-regexp 'space) 1)))
|
|
|
|
|
;; PROBLEM 2: SPACEs before TAB
|
|
|
|
|
(cond
|
|
|
|
|
;; ACTION: replace SPACEs before TAB by TABs, if
|
|
|
|
|
;; `indent-tabs-mode' is non-nil; otherwise, replace TABs
|
|
|
|
|
;; by SPACEs.
|
|
|
|
|
((memq 'space-before-tab whitespace-style)
|
|
|
|
|
(whitespace-replace-action
|
2017-03-02 12:50:06 +00:00
|
|
|
|
(if indent-tabs-mode 'tabify 'untabify)
|
2016-12-24 14:41:46 +00:00
|
|
|
|
rstart rend whitespace-space-before-tab-regexp
|
2017-03-02 12:50:06 +00:00
|
|
|
|
(if indent-tabs-mode 0 2)))
|
2016-12-24 14:41:46 +00:00
|
|
|
|
;; ACTION: replace SPACEs before TAB by TABs.
|
|
|
|
|
((memq 'space-before-tab::tab whitespace-style)
|
|
|
|
|
(whitespace-replace-action
|
|
|
|
|
'tabify rstart rend
|
|
|
|
|
whitespace-space-before-tab-regexp 0))
|
|
|
|
|
;; ACTION: replace TABs by SPACEs.
|
|
|
|
|
((memq 'space-before-tab::space whitespace-style)
|
|
|
|
|
(whitespace-replace-action
|
|
|
|
|
'untabify rstart rend
|
|
|
|
|
whitespace-space-before-tab-regexp 2))))
|
2008-09-06 00:19:31 +00:00
|
|
|
|
(set-marker rend nil)))) ; point marker to nowhere
|
2008-01-25 14:09:57 +00:00
|
|
|
|
|
2008-01-26 01:47:21 +00:00
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(defun whitespace-replace-action (action rstart rend regexp index)
|
|
|
|
|
"Do ACTION in the string matched by REGEXP between RSTART and REND.
|
|
|
|
|
|
|
|
|
|
INDEX is the level group matched by REGEXP and used by ACTION.
|
|
|
|
|
|
|
|
|
|
See also `tab-width'."
|
2008-01-26 01:47:21 +00:00
|
|
|
|
(goto-char rstart)
|
|
|
|
|
(while (re-search-forward regexp rend t)
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(goto-char (match-end index))
|
|
|
|
|
(funcall action (match-beginning index) (match-end index))))
|
2008-01-26 01:47:21 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2008-03-01 19:00:24 +00:00
|
|
|
|
;;;; User command - report
|
|
|
|
|
|
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(defun whitespace-regexp (regexp &optional kind)
|
2017-03-02 12:50:06 +00:00
|
|
|
|
"Return REGEXP depending on `indent-tabs-mode'."
|
2016-10-21 14:23:08 +00:00
|
|
|
|
(format
|
|
|
|
|
(cond
|
|
|
|
|
((or (eq kind 'tab)
|
2017-03-02 12:50:06 +00:00
|
|
|
|
indent-tabs-mode)
|
2016-10-21 14:23:08 +00:00
|
|
|
|
(car regexp))
|
|
|
|
|
((or (eq kind 'space)
|
2017-03-02 12:50:06 +00:00
|
|
|
|
(not indent-tabs-mode))
|
2016-10-21 14:23:08 +00:00
|
|
|
|
(cdr regexp)))
|
2017-03-02 12:50:06 +00:00
|
|
|
|
tab-width))
|
2008-04-16 03:41:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun whitespace-indentation-regexp (&optional kind)
|
2017-03-02 12:50:06 +00:00
|
|
|
|
"Return the indentation regexp depending on `indent-tabs-mode'."
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(whitespace-regexp whitespace-indentation-regexp kind))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun whitespace-space-after-tab-regexp (&optional kind)
|
2017-03-02 12:50:06 +00:00
|
|
|
|
"Return the space-after-tab regexp depending on `indent-tabs-mode'."
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(whitespace-regexp whitespace-space-after-tab-regexp kind))
|
|
|
|
|
|
|
|
|
|
|
2008-03-01 19:00:24 +00:00
|
|
|
|
(defconst whitespace-report-list
|
|
|
|
|
(list
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(cons 'empty whitespace-empty-at-bob-regexp)
|
|
|
|
|
(cons 'empty whitespace-empty-at-eob-regexp)
|
2008-04-27 11:50:47 +00:00
|
|
|
|
(cons 'trailing whitespace-trailing-regexp)
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(cons 'indentation nil)
|
|
|
|
|
(cons 'indentation::tab nil)
|
|
|
|
|
(cons 'indentation::space nil)
|
|
|
|
|
(cons 'space-before-tab whitespace-space-before-tab-regexp)
|
|
|
|
|
(cons 'space-before-tab::tab whitespace-space-before-tab-regexp)
|
|
|
|
|
(cons 'space-before-tab::space whitespace-space-before-tab-regexp)
|
|
|
|
|
(cons 'space-after-tab nil)
|
|
|
|
|
(cons 'space-after-tab::tab nil)
|
|
|
|
|
(cons 'space-after-tab::space nil)
|
2008-03-01 19:00:24 +00:00
|
|
|
|
)
|
|
|
|
|
"List of whitespace bogus symbol and corresponding regexp.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defconst whitespace-report-text
|
2008-04-16 03:41:17 +00:00
|
|
|
|
'( ;; `indent-tabs-mode' has non-nil value
|
|
|
|
|
"\
|
|
|
|
|
Whitespace Report
|
|
|
|
|
|
|
|
|
|
Current Setting Whitespace Problem
|
|
|
|
|
|
|
|
|
|
empty [] [] empty lines at beginning of buffer
|
|
|
|
|
empty [] [] empty lines at end of buffer
|
|
|
|
|
trailing [] [] SPACEs or TABs at end of line
|
2016-10-25 22:04:18 +00:00
|
|
|
|
indentation [] [] >= `tab-width' SPACEs at beginning of line
|
|
|
|
|
indentation::tab [] [] >= `tab-width' SPACEs at beginning of line
|
2008-04-16 03:41:17 +00:00
|
|
|
|
indentation::space [] [] TABs at beginning of line
|
|
|
|
|
space-before-tab [] [] SPACEs before TAB
|
|
|
|
|
space-before-tab::tab [] [] SPACEs before TAB: SPACEs
|
|
|
|
|
space-before-tab::space [] [] SPACEs before TAB: TABs
|
2016-10-25 22:04:18 +00:00
|
|
|
|
space-after-tab [] [] >= `tab-width' SPACEs after TAB
|
|
|
|
|
space-after-tab::tab [] [] >= `tab-width' SPACEs after TAB: SPACEs
|
|
|
|
|
space-after-tab::space [] [] >= `tab-width' SPACEs after TAB: TABs
|
2008-04-16 03:41:17 +00:00
|
|
|
|
|
|
|
|
|
indent-tabs-mode =
|
|
|
|
|
tab-width = \n\n"
|
|
|
|
|
. ;; `indent-tabs-mode' has nil value
|
|
|
|
|
"\
|
|
|
|
|
Whitespace Report
|
|
|
|
|
|
|
|
|
|
Current Setting Whitespace Problem
|
|
|
|
|
|
|
|
|
|
empty [] [] empty lines at beginning of buffer
|
|
|
|
|
empty [] [] empty lines at end of buffer
|
|
|
|
|
trailing [] [] SPACEs or TABs at end of line
|
|
|
|
|
indentation [] [] TABs at beginning of line
|
2016-10-25 22:04:18 +00:00
|
|
|
|
indentation::tab [] [] >= `tab-width' SPACEs at beginning of line
|
2008-04-16 03:41:17 +00:00
|
|
|
|
indentation::space [] [] TABs at beginning of line
|
|
|
|
|
space-before-tab [] [] SPACEs before TAB
|
|
|
|
|
space-before-tab::tab [] [] SPACEs before TAB: SPACEs
|
|
|
|
|
space-before-tab::space [] [] SPACEs before TAB: TABs
|
2016-10-25 22:04:18 +00:00
|
|
|
|
space-after-tab [] [] >= `tab-width' SPACEs after TAB
|
|
|
|
|
space-after-tab::tab [] [] >= `tab-width' SPACEs after TAB: SPACEs
|
|
|
|
|
space-after-tab::space [] [] >= `tab-width' SPACEs after TAB: TABs
|
2008-04-16 03:41:17 +00:00
|
|
|
|
|
|
|
|
|
indent-tabs-mode =
|
|
|
|
|
tab-width = \n\n")
|
|
|
|
|
"Text for whitespace bogus report.
|
|
|
|
|
|
|
|
|
|
It is a cons of strings, where the car part is used when
|
|
|
|
|
`indent-tabs-mode' is non-nil, and the cdr part is used when
|
|
|
|
|
`indent-tabs-mode' is nil.")
|
2008-03-01 19:00:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defconst whitespace-report-buffer-name "*Whitespace Report*"
|
|
|
|
|
"The buffer name for whitespace bogus report.")
|
2008-01-31 16:08:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2008-03-01 19:00:24 +00:00
|
|
|
|
(defun whitespace-report (&optional force report-if-bogus)
|
|
|
|
|
"Report some whitespace problems in buffer.
|
2008-01-31 16:08:29 +00:00
|
|
|
|
|
2014-05-29 22:43:26 +00:00
|
|
|
|
Perform `whitespace-report-region' on the current buffer."
|
2008-03-01 19:00:24 +00:00
|
|
|
|
(interactive (list current-prefix-arg))
|
|
|
|
|
(whitespace-report-region (point-min) (point-max)
|
|
|
|
|
force report-if-bogus))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
|
(defun whitespace-report-region (start end &optional force report-if-bogus)
|
|
|
|
|
"Report some whitespace problems in a region.
|
|
|
|
|
|
|
|
|
|
Return nil if there is no whitespace problem; otherwise, return
|
|
|
|
|
non-nil.
|
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
If FORCE is non-nil or \\[universal-argument] was pressed just
|
|
|
|
|
before calling `whitespace-report-region' interactively, it
|
2016-10-25 22:20:59 +00:00
|
|
|
|
forces all classes of whitespace problem to be considered
|
|
|
|
|
significant.
|
2008-01-31 16:08:29 +00:00
|
|
|
|
|
2014-05-29 22:51:47 +00:00
|
|
|
|
If REPORT-IF-BOGUS is t, it reports only when there are any
|
|
|
|
|
whitespace problems in buffer; if it is `never', it does not
|
|
|
|
|
report problems.
|
2008-03-01 19:00:24 +00:00
|
|
|
|
|
|
|
|
|
Report if some of the following whitespace problems exist:
|
2008-01-31 16:08:29 +00:00
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
* If `indent-tabs-mode' is non-nil:
|
|
|
|
|
empty 1. empty lines at beginning of buffer.
|
|
|
|
|
empty 2. empty lines at end of buffer.
|
|
|
|
|
trailing 3. SPACEs or TABs at end of line.
|
2016-10-25 22:04:18 +00:00
|
|
|
|
indentation 4. line starts with `tab-width' or more SPACEs.
|
2008-04-16 03:41:17 +00:00
|
|
|
|
space-before-tab 5. SPACEs before TAB.
|
2016-10-25 22:04:18 +00:00
|
|
|
|
space-after-tab 6. `tab-width' or more SPACEs after TAB.
|
2008-04-16 03:41:17 +00:00
|
|
|
|
|
|
|
|
|
* If `indent-tabs-mode' is nil:
|
2008-01-31 16:08:29 +00:00
|
|
|
|
empty 1. empty lines at beginning of buffer.
|
|
|
|
|
empty 2. empty lines at end of buffer.
|
2008-04-16 03:41:17 +00:00
|
|
|
|
trailing 3. SPACEs or TABs at end of line.
|
|
|
|
|
indentation 4. TABS at beginning of line.
|
|
|
|
|
space-before-tab 5. SPACEs before TAB.
|
2016-10-25 22:04:18 +00:00
|
|
|
|
space-after-tab 6. `tab-width' or more SPACEs after TAB.
|
2008-01-31 16:08:29 +00:00
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
See `whitespace-style' for documentation.
|
2008-01-31 16:08:29 +00:00
|
|
|
|
See also `whitespace-cleanup' and `whitespace-cleanup-region' for
|
|
|
|
|
cleaning up these problems."
|
2008-03-01 19:00:24 +00:00
|
|
|
|
(interactive "r")
|
|
|
|
|
(setq force (or current-prefix-arg force))
|
|
|
|
|
(save-excursion
|
2016-12-24 14:41:46 +00:00
|
|
|
|
(let* ((has-bogus nil)
|
|
|
|
|
(rstart (min start end))
|
|
|
|
|
(rend (max start end))
|
|
|
|
|
;; Fall back to whitespace-style so we can run before
|
|
|
|
|
;; before the mode is active.
|
|
|
|
|
(style (copy-sequence
|
|
|
|
|
(or whitespace-active-style whitespace-style)))
|
|
|
|
|
(bogus-list
|
|
|
|
|
(mapcar
|
|
|
|
|
#'(lambda (option)
|
|
|
|
|
(when force
|
|
|
|
|
(add-to-list 'style (car option)))
|
|
|
|
|
(goto-char rstart)
|
|
|
|
|
(let ((regexp
|
|
|
|
|
(cond
|
|
|
|
|
((eq (car option) 'indentation)
|
|
|
|
|
(whitespace-indentation-regexp))
|
|
|
|
|
((eq (car option) 'indentation::tab)
|
|
|
|
|
(whitespace-indentation-regexp 'tab))
|
|
|
|
|
((eq (car option) 'indentation::space)
|
|
|
|
|
(whitespace-indentation-regexp 'space))
|
|
|
|
|
((eq (car option) 'space-after-tab)
|
|
|
|
|
(whitespace-space-after-tab-regexp))
|
|
|
|
|
((eq (car option) 'space-after-tab::tab)
|
|
|
|
|
(whitespace-space-after-tab-regexp 'tab))
|
|
|
|
|
((eq (car option) 'space-after-tab::space)
|
|
|
|
|
(whitespace-space-after-tab-regexp 'space))
|
|
|
|
|
(t
|
|
|
|
|
(cdr option)))))
|
|
|
|
|
(when (re-search-forward regexp rend t)
|
|
|
|
|
(unless has-bogus
|
|
|
|
|
(setq has-bogus (memq (car option) style)))
|
|
|
|
|
t)))
|
|
|
|
|
whitespace-report-list)))
|
2018-11-05 00:22:15 +00:00
|
|
|
|
(when (pcase report-if-bogus ('nil t) ('never nil) (_ has-bogus))
|
2016-12-24 14:41:46 +00:00
|
|
|
|
(whitespace-kill-buffer whitespace-report-buffer-name)
|
2017-03-02 12:50:06 +00:00
|
|
|
|
;; `indent-tabs-mode' may be local to current buffer
|
|
|
|
|
;; `tab-width' may be local to current buffer
|
|
|
|
|
(let ((ws-indent-tabs-mode indent-tabs-mode)
|
|
|
|
|
(ws-tab-width tab-width))
|
2016-12-24 14:41:46 +00:00
|
|
|
|
(with-current-buffer (get-buffer-create
|
|
|
|
|
whitespace-report-buffer-name)
|
|
|
|
|
(erase-buffer)
|
|
|
|
|
(insert (if ws-indent-tabs-mode
|
|
|
|
|
(car whitespace-report-text)
|
|
|
|
|
(cdr whitespace-report-text)))
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(forward-line 3)
|
|
|
|
|
(dolist (option whitespace-report-list)
|
|
|
|
|
(forward-line 1)
|
|
|
|
|
(whitespace-mark-x
|
|
|
|
|
27 (memq (car option) style))
|
|
|
|
|
(whitespace-mark-x 7 (car bogus-list))
|
|
|
|
|
(setq bogus-list (cdr bogus-list)))
|
|
|
|
|
(forward-line 1)
|
|
|
|
|
(whitespace-insert-value ws-indent-tabs-mode)
|
|
|
|
|
(whitespace-insert-value ws-tab-width)
|
|
|
|
|
(when has-bogus
|
|
|
|
|
(goto-char (point-max))
|
|
|
|
|
(insert (substitute-command-keys
|
|
|
|
|
" Type `\\[whitespace-cleanup]'")
|
|
|
|
|
" to cleanup the buffer.\n\n"
|
|
|
|
|
(substitute-command-keys
|
|
|
|
|
" Type `\\[whitespace-cleanup-region]'")
|
|
|
|
|
" to cleanup a region.\n\n"))
|
|
|
|
|
(whitespace-display-window (current-buffer)))))
|
|
|
|
|
has-bogus)))
|
2008-01-31 16:08:29 +00:00
|
|
|
|
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;;;; Internal functions
|
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defvar whitespace-font-lock-keywords nil
|
2013-03-19 05:06:49 +00:00
|
|
|
|
"Used to save the value `whitespace-color-on' adds to `font-lock-keywords'.")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defconst whitespace-help-text
|
2008-01-17 12:46:55 +00:00
|
|
|
|
"\
|
2010-08-25 02:27:58 +00:00
|
|
|
|
Whitespace Toggle Options | scroll up : SPC or > |
|
|
|
|
|
| scroll down: M-SPC or < |
|
|
|
|
|
FACES \\__________________________/
|
|
|
|
|
[] f - toggle face visualization
|
2008-04-16 03:41:17 +00:00
|
|
|
|
[] t - toggle TAB visualization
|
|
|
|
|
[] s - toggle SPACE and HARD SPACE visualization
|
|
|
|
|
[] r - toggle trailing blanks visualization
|
|
|
|
|
[] l - toggle \"long lines\" visualization
|
|
|
|
|
[] L - toggle \"long lines\" tail visualization
|
|
|
|
|
[] n - toggle NEWLINE visualization
|
|
|
|
|
[] e - toggle empty line at bob and/or eob visualization
|
|
|
|
|
[] C-i - toggle indentation SPACEs visualization (via `indent-tabs-mode')
|
|
|
|
|
[] I - toggle indentation SPACEs visualization
|
|
|
|
|
[] i - toggle indentation TABs visualization
|
2014-10-18 00:23:03 +00:00
|
|
|
|
[] C-t - toggle big indentation visualization
|
2008-04-16 03:41:17 +00:00
|
|
|
|
[] C-a - toggle SPACEs after TAB visualization (via `indent-tabs-mode')
|
|
|
|
|
[] A - toggle SPACEs after TAB: SPACEs visualization
|
|
|
|
|
[] a - toggle SPACEs after TAB: TABs visualization
|
|
|
|
|
[] C-b - toggle SPACEs before TAB visualization (via `indent-tabs-mode')
|
|
|
|
|
[] B - toggle SPACEs before TAB: SPACEs visualization
|
|
|
|
|
[] b - toggle SPACEs before TAB: TABs visualization
|
|
|
|
|
|
|
|
|
|
DISPLAY TABLE
|
|
|
|
|
[] T - toggle TAB visualization
|
|
|
|
|
[] S - toggle SPACE and HARD SPACE visualization
|
|
|
|
|
[] N - toggle NEWLINE visualization
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
x - restore `whitespace-style' value
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
? - display this text\n\n"
|
2008-01-31 16:08:29 +00:00
|
|
|
|
"Text for whitespace toggle options.")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defconst whitespace-help-buffer-name "*Whitespace Toggle Options*"
|
|
|
|
|
"The buffer name for whitespace toggle options.")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(defun whitespace-insert-value (value)
|
|
|
|
|
"Insert VALUE at column 20 of next line."
|
|
|
|
|
(forward-line 1)
|
|
|
|
|
(move-to-column 20 t)
|
|
|
|
|
(insert (format "%s" value)))
|
|
|
|
|
|
|
|
|
|
|
2008-03-01 19:00:24 +00:00
|
|
|
|
(defun whitespace-mark-x (nchars condition)
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 15:41:44 +00:00
|
|
|
|
"Insert the mark (`X' or ` ') after NCHARS depending on CONDITION."
|
2008-03-01 19:00:24 +00:00
|
|
|
|
(forward-char nchars)
|
|
|
|
|
(insert (if condition "X" " ")))
|
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defun whitespace-insert-option-mark (the-list the-value)
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 15:41:44 +00:00
|
|
|
|
"Insert the option mark (`X' or ` ') in toggle options buffer."
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(goto-char (point-min))
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(forward-line 2)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(dolist (sym the-list)
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(if (eq sym 'help-newline)
|
|
|
|
|
(forward-line 2)
|
|
|
|
|
(forward-line 1)
|
|
|
|
|
(whitespace-mark-x 2 (memq sym the-value)))))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(defun whitespace-help-on (style)
|
2008-01-31 16:08:29 +00:00
|
|
|
|
"Display the whitespace toggle options."
|
|
|
|
|
(unless (get-buffer whitespace-help-buffer-name)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(delete-other-windows)
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(let ((buffer (get-buffer-create whitespace-help-buffer-name)))
|
* x-dnd.el (x-dnd-maybe-call-test-function):
* window.el (split-window-vertically):
* whitespace.el (whitespace-help-on):
* vc-rcs.el (vc-rcs-consult-headers):
* userlock.el (ask-user-about-lock-help)
(ask-user-about-supersession-help):
* type-break.el (type-break-force-mode-line-update):
* time-stamp.el (time-stamp-conv-warn):
* terminal.el (te-set-output-log, te-more-break, te-filter)
(te-sentinel,terminal-emulator):
* term.el (make-term, term-exec, term-sentinel, term-read-input-ring)
(term-write-input-ring, term-check-source, term-start-output-log):
(term-display-buffer-line, term-dynamic-list-completions):
(term-ansi-make-term, serial-term):
* subr.el (selective-display):
* strokes.el (strokes-xpm-to-compressed-string, strokes-decode-buffer)
(strokes-encode-buffer, strokes-xpm-for-compressed-string):
* speedbar.el (speedbar-buffers-tail-notes, speedbar-buffers-item-info)
(speedbar-reconfigure-keymaps, speedbar-add-localized-speedbar-support)
(speedbar-remove-localized-speedbar-support)
(speedbar-set-mode-line-format, speedbar-create-tag-hierarchy)
(speedbar-update-special-contents, speedbar-buffer-buttons-engine)
(speedbar-buffers-line-directory):
* simple.el (shell-command-on-region, append-to-buffer)
(prepend-to-buffer):
* shadowfile.el (shadow-save-todo-file):
* scroll-bar.el (scroll-bar-set-window-start, scroll-bar-drag-1)
(scroll-bar-maybe-set-window-start):
* sb-image.el (speedbar-image-dump):
* saveplace.el (save-place-alist-to-file, save-places-to-alist)
(load-save-place-alist-from-file):
* ps-samp.el (ps-print-message-from-summary):
* ps-print.el (ps-flush-output, ps-insert-file, ps-get-boundingbox)
(ps-background-image, ps-begin-job, ps-do-despool):
* ps-bdf.el (bdf-find-file, bdf-read-font-info):
* printing.el (pr-interface, pr-ps-file-print, pr-find-buffer-visiting)
(pr-ps-message-from-summary, pr-lpr-message-from-summary):
(pr-call-process, pr-file-list, pr-interface-save):
* novice.el (disabled-command-function)
(enable-command, disable-command):
* mouse.el (mouse-buffer-menu-alist):
* mouse-copy.el (mouse-kill-preserving-secondary):
* macros.el (kbd-macro-query):
* ledit.el (ledit-go-to-lisp, ledit-go-to-liszt):
* informat.el (batch-info-validate):
* ido.el (ido-copy-current-word, ido-initiate-auto-merge):
* hippie-exp.el (try-expand-dabbrev-visible):
* help-mode.el (help-make-xrefs):
* help-fns.el (describe-variable):
* generic-x.el (bat-generic-mode-run-as-comint):
* finder.el (finder-mouse-select):
* find-dired.el (find-dired-sentinel):
* filesets.el (filesets-file-close):
* files.el (list-directory):
* faces.el (list-faces-display, describe-face):
* facemenu.el (list-colors-display):
* ezimage.el (ezimage-image-association-dump, ezimage-image-dump):
* epg.el (epg--process-filter, epg-cancel):
* epa.el (epa--marked-keys, epa--select-keys, epa-display-info)
(epa--read-signature-type):
* emerge.el (emerge-copy-as-kill-A, emerge-copy-as-kill-B)
(emerge-file-names):
* ehelp.el (electric-helpify):
* ediff.el (ediff-regions-wordwise, ediff-regions-linewise):
* ediff-vers.el (rcs-ediff-view-revision):
* ediff-util.el (ediff-setup):
* ediff-mult.el (ediff-append-custom-diff):
* ediff-diff.el (ediff-exec-process, ediff-process-sentinel)
(ediff-wordify):
* echistory.el (Electric-command-history-redo-expression):
* dos-w32.el (find-file-not-found-set-buffer-file-coding-system):
* disp-table.el (describe-display-table):
* dired.el (dired-find-buffer-nocreate):
* dired-aux.el (dired-rename-subdir, dired-dwim-target-directory):
* dabbrev.el (dabbrev--same-major-mode-p):
* chistory.el (list-command-history):
* apropos.el (apropos-documentation):
* allout.el (allout-obtain-passphrase):
(allout-copy-exposed-to-buffer):
(allout-verify-passphrase): Use with-current-buffer.
2009-11-13 22:19:45 +00:00
|
|
|
|
(with-current-buffer buffer
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(erase-buffer)
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(insert whitespace-help-text)
|
|
|
|
|
(whitespace-insert-option-mark
|
2008-04-26 11:38:50 +00:00
|
|
|
|
whitespace-style-value-list style)
|
2008-03-01 19:00:24 +00:00
|
|
|
|
(whitespace-display-window buffer)))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun whitespace-display-window (buffer)
|
|
|
|
|
"Display BUFFER in a new window."
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(set-buffer-modified-p nil)
|
2010-08-25 02:27:58 +00:00
|
|
|
|
(when (< (window-height) (* 2 window-min-height))
|
|
|
|
|
(kill-buffer buffer)
|
|
|
|
|
(error "Window height is too small; \
|
2008-01-31 16:08:29 +00:00
|
|
|
|
can't split window to display whitespace toggle options"))
|
2010-08-25 02:27:58 +00:00
|
|
|
|
(let ((win (split-window)))
|
|
|
|
|
(set-window-buffer win buffer)
|
|
|
|
|
(shrink-window-if-larger-than-buffer win)))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(defun whitespace-kill-buffer (buffer-name)
|
|
|
|
|
"Kill buffer BUFFER-NAME and windows related with it."
|
|
|
|
|
(let ((buffer (get-buffer buffer-name)))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(when buffer
|
|
|
|
|
(delete-windows-on buffer)
|
|
|
|
|
(kill-buffer buffer))))
|
|
|
|
|
|
|
|
|
|
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(defun whitespace-help-off ()
|
|
|
|
|
"Remove the buffer and window of the whitespace toggle options."
|
|
|
|
|
(whitespace-kill-buffer whitespace-help-buffer-name))
|
|
|
|
|
|
|
|
|
|
|
2010-08-25 02:27:58 +00:00
|
|
|
|
(defun whitespace-help-scroll (&optional up)
|
|
|
|
|
"Scroll help window, if it exists.
|
|
|
|
|
|
|
|
|
|
If UP is non-nil, scroll up; otherwise, scroll down."
|
2011-04-19 13:44:55 +00:00
|
|
|
|
(condition-case nil
|
2010-08-25 02:27:58 +00:00
|
|
|
|
(let ((buffer (get-buffer whitespace-help-buffer-name)))
|
|
|
|
|
(if buffer
|
|
|
|
|
(with-selected-window (get-buffer-window buffer)
|
|
|
|
|
(if up
|
|
|
|
|
(scroll-up 3)
|
|
|
|
|
(scroll-down 3)))
|
|
|
|
|
(ding)))
|
|
|
|
|
;; handler
|
|
|
|
|
((error)
|
|
|
|
|
;; just ignore error
|
|
|
|
|
)))
|
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defun whitespace-interactive-char (local-p)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
"Interactive function to read a char and return a symbol.
|
|
|
|
|
|
|
|
|
|
If LOCAL-P is non-nil, it uses a local context; otherwise, it
|
|
|
|
|
uses a global context.
|
|
|
|
|
|
(whitespace): Set :version tag to 23.1.
(whitespace-turn-off, whitespace-toggle-options): Fix typos.
(whitespace-style, whitespace-chars, whitespace-space, whitespace-hspace,
whitespace-tab, whitespace-newline, whitespace-trailing, whitespace-line,
whitespace-space-before-tab, whitespace-indentation, whitespace-empty,
whitespace-space-after-tab, whitespace-hspace-regexp, whitespace-space-regexp,
whitespace-tab-regexp, whitespace-trailing-regexp,
whitespace-space-before-tab-regexp, whitespace-indentation-regexp,
whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp,
whitespace-space-after-tab-regexp, whitespace-line-column,
whitespace-display-mappings, global-whitespace-toggle-options,
whitespace-cleanup, whitespace-cleanup-region, whitespace-interactive-char):
Doc fixes.
2008-02-01 14:44:44 +00:00
|
|
|
|
It accepts one of the following chars:
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
CHAR MEANING
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(VIA FACES)
|
2010-08-25 02:27:58 +00:00
|
|
|
|
f toggle face visualization
|
2008-01-21 12:45:58 +00:00
|
|
|
|
t toggle TAB visualization
|
|
|
|
|
s toggle SPACE and HARD SPACE visualization
|
|
|
|
|
r toggle trailing blanks visualization
|
|
|
|
|
l toggle \"long lines\" visualization
|
2008-01-26 01:47:21 +00:00
|
|
|
|
L toggle \"long lines\" tail visualization
|
2008-01-21 12:45:58 +00:00
|
|
|
|
n toggle NEWLINE visualization
|
2008-01-25 14:09:57 +00:00
|
|
|
|
e toggle empty line at bob and/or eob visualization
|
2008-04-16 03:41:17 +00:00
|
|
|
|
C-i toggle indentation SPACEs visualization (via `indent-tabs-mode')
|
|
|
|
|
I toggle indentation SPACEs visualization
|
|
|
|
|
i toggle indentation TABs visualization
|
|
|
|
|
C-a toggle SPACEs after TAB visualization (via `indent-tabs-mode')
|
|
|
|
|
A toggle SPACEs after TAB: SPACEs visualization
|
|
|
|
|
a toggle SPACEs after TAB: TABs visualization
|
|
|
|
|
C-b toggle SPACEs before TAB visualization (via `indent-tabs-mode')
|
|
|
|
|
B toggle SPACEs before TAB: SPACEs visualization
|
|
|
|
|
b toggle SPACEs before TAB: TABs visualization
|
|
|
|
|
|
|
|
|
|
(VIA DISPLAY TABLE)
|
|
|
|
|
T toggle TAB visualization
|
|
|
|
|
S toggle SPACE and HARD SPACE visualization
|
|
|
|
|
N toggle NEWLINE visualization
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
x restore `whitespace-style' value
|
2008-01-17 12:46:55 +00:00
|
|
|
|
? display brief help
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
See also `whitespace-toggle-option-alist'."
|
|
|
|
|
(let* ((is-off (not (if local-p
|
|
|
|
|
whitespace-mode
|
|
|
|
|
global-whitespace-mode)))
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(style (cond (is-off whitespace-style) ; use default value
|
|
|
|
|
(local-p whitespace-active-style)
|
|
|
|
|
(t whitespace-toggle-style)))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(prompt
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(format "Whitespace Toggle %s (type ? for further options)-"
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(if local-p "Local" "Global")))
|
|
|
|
|
ch sym)
|
|
|
|
|
;; read a valid option and get the corresponding symbol
|
|
|
|
|
(save-window-excursion
|
|
|
|
|
(condition-case data
|
|
|
|
|
(progn
|
|
|
|
|
(while
|
|
|
|
|
;; while condition
|
|
|
|
|
(progn
|
|
|
|
|
(setq ch (read-char prompt))
|
|
|
|
|
(not
|
|
|
|
|
(setq sym
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(cdr
|
|
|
|
|
(assq ch whitespace-toggle-option-alist)))))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; while body
|
2010-08-25 02:27:58 +00:00
|
|
|
|
(cond
|
|
|
|
|
((eq ch ?\?) (whitespace-help-on style))
|
|
|
|
|
((eq ch ?\ ) (whitespace-help-scroll t))
|
|
|
|
|
((eq ch ?\M- ) (whitespace-help-scroll))
|
|
|
|
|
((eq ch ?>) (whitespace-help-scroll t))
|
|
|
|
|
((eq ch ?<) (whitespace-help-scroll))
|
|
|
|
|
(t (ding))))
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(whitespace-help-off)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(message " ")) ; clean echo area
|
|
|
|
|
;; handler
|
|
|
|
|
((quit error)
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(whitespace-help-off)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(error (error-message-string data)))))
|
2010-01-18 04:39:40 +00:00
|
|
|
|
(list sym))) ; return the appropriate symbol
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(defun whitespace-toggle-list (local-p arg the-list)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
"Toggle options in THE-LIST based on list ARG.
|
|
|
|
|
|
|
|
|
|
If LOCAL-P is non-nil, it uses a local context; otherwise, it
|
|
|
|
|
uses a global context.
|
|
|
|
|
|
|
|
|
|
ARG is a list of options to be toggled.
|
|
|
|
|
|
|
|
|
|
THE-LIST is a list of options. This list will be toggled and the
|
2008-04-26 11:38:50 +00:00
|
|
|
|
resultant list will be returned."
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(unless (if local-p whitespace-mode global-whitespace-mode)
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(setq the-list whitespace-style))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(setq the-list (copy-sequence the-list)) ; keep original list
|
|
|
|
|
(dolist (sym (if (listp arg) arg (list arg)))
|
|
|
|
|
(cond
|
2008-04-26 11:38:50 +00:00
|
|
|
|
;; ignore help value
|
|
|
|
|
((eq sym 'help-newline))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; restore default values
|
2008-04-26 11:38:50 +00:00
|
|
|
|
((eq sym 'whitespace-style)
|
|
|
|
|
(setq the-list whitespace-style))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; toggle valid values
|
2008-04-26 11:38:50 +00:00
|
|
|
|
((memq sym whitespace-style-value-list)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(setq the-list (if (memq sym the-list)
|
|
|
|
|
(delq sym the-list)
|
|
|
|
|
(cons sym the-list))))))
|
|
|
|
|
the-list)
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
|
2008-04-22 02:55:30 +00:00
|
|
|
|
(defvar whitespace-display-table nil
|
|
|
|
|
"Used to save a local display table.")
|
|
|
|
|
|
|
|
|
|
(defvar whitespace-display-table-was-local nil
|
|
|
|
|
"Used to remember whether a buffer initially had a local display table.")
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defun whitespace-turn-on ()
|
|
|
|
|
"Turn on whitespace visualization."
|
2008-04-16 03:41:17 +00:00
|
|
|
|
;; prepare local hooks
|
2008-10-02 00:49:49 +00:00
|
|
|
|
(add-hook 'write-file-functions 'whitespace-write-file-hook nil t)
|
2008-04-16 03:41:17 +00:00
|
|
|
|
;; create whitespace local buffer environment
|
|
|
|
|
(set (make-local-variable 'whitespace-font-lock-keywords) nil)
|
|
|
|
|
(set (make-local-variable 'whitespace-display-table) nil)
|
|
|
|
|
(set (make-local-variable 'whitespace-display-table-was-local) nil)
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(set (make-local-variable 'whitespace-active-style)
|
|
|
|
|
(if (listp whitespace-style)
|
|
|
|
|
whitespace-style
|
|
|
|
|
(list whitespace-style)))
|
2008-04-16 03:41:17 +00:00
|
|
|
|
;; turn on whitespace
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(when whitespace-active-style
|
|
|
|
|
(whitespace-color-on)
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(whitespace-display-char-on)))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defun whitespace-turn-off ()
|
(whitespace): Set :version tag to 23.1.
(whitespace-turn-off, whitespace-toggle-options): Fix typos.
(whitespace-style, whitespace-chars, whitespace-space, whitespace-hspace,
whitespace-tab, whitespace-newline, whitespace-trailing, whitespace-line,
whitespace-space-before-tab, whitespace-indentation, whitespace-empty,
whitespace-space-after-tab, whitespace-hspace-regexp, whitespace-space-regexp,
whitespace-tab-regexp, whitespace-trailing-regexp,
whitespace-space-before-tab-regexp, whitespace-indentation-regexp,
whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp,
whitespace-space-after-tab-regexp, whitespace-line-column,
whitespace-display-mappings, global-whitespace-toggle-options,
whitespace-cleanup, whitespace-cleanup-region, whitespace-interactive-char):
Doc fixes.
2008-02-01 14:44:44 +00:00
|
|
|
|
"Turn off whitespace visualization."
|
2008-10-02 00:49:49 +00:00
|
|
|
|
(remove-hook 'write-file-functions 'whitespace-write-file-hook t)
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(when whitespace-active-style
|
|
|
|
|
(whitespace-color-off)
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(whitespace-display-char-off)))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(defun whitespace-style-face-p ()
|
|
|
|
|
"Return t if there is some visualization via face."
|
2010-08-25 02:27:58 +00:00
|
|
|
|
(and (memq 'face whitespace-active-style)
|
|
|
|
|
(or (memq 'tabs whitespace-active-style)
|
|
|
|
|
(memq 'spaces whitespace-active-style)
|
|
|
|
|
(memq 'trailing whitespace-active-style)
|
|
|
|
|
(memq 'lines whitespace-active-style)
|
|
|
|
|
(memq 'lines-tail whitespace-active-style)
|
|
|
|
|
(memq 'newline whitespace-active-style)
|
|
|
|
|
(memq 'empty whitespace-active-style)
|
|
|
|
|
(memq 'indentation whitespace-active-style)
|
|
|
|
|
(memq 'indentation::tab whitespace-active-style)
|
|
|
|
|
(memq 'indentation::space whitespace-active-style)
|
2014-10-18 00:23:03 +00:00
|
|
|
|
(memq 'big-indent whitespace-active-style)
|
2010-08-25 02:27:58 +00:00
|
|
|
|
(memq 'space-after-tab whitespace-active-style)
|
|
|
|
|
(memq 'space-after-tab::tab whitespace-active-style)
|
|
|
|
|
(memq 'space-after-tab::space whitespace-active-style)
|
|
|
|
|
(memq 'space-before-tab whitespace-active-style)
|
|
|
|
|
(memq 'space-before-tab::tab whitespace-active-style)
|
2019-10-14 21:52:21 +00:00
|
|
|
|
(memq 'space-before-tab::space whitespace-active-style))
|
|
|
|
|
t))
|
2008-04-26 11:38:50 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defun whitespace-color-on ()
|
2008-01-21 12:45:58 +00:00
|
|
|
|
"Turn on color visualization."
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(when (whitespace-style-face-p)
|
2009-09-25 02:23:51 +00:00
|
|
|
|
;; save current point and refontify when necessary
|
|
|
|
|
(set (make-local-variable 'whitespace-point)
|
2014-05-29 03:54:37 +00:00
|
|
|
|
(point))
|
|
|
|
|
(setq whitespace-point--used
|
|
|
|
|
(let ((ol (make-overlay (point) (point) nil nil t)))
|
|
|
|
|
(delete-overlay ol) ol))
|
2009-09-25 02:23:51 +00:00
|
|
|
|
(set (make-local-variable 'whitespace-font-lock-refontify)
|
2010-08-21 04:43:04 +00:00
|
|
|
|
0)
|
|
|
|
|
(set (make-local-variable 'whitespace-bob-marker)
|
|
|
|
|
(point-min-marker))
|
|
|
|
|
(set (make-local-variable 'whitespace-eob-marker)
|
|
|
|
|
(point-max-marker))
|
|
|
|
|
(set (make-local-variable 'whitespace-buffer-changed)
|
2009-09-25 02:23:51 +00:00
|
|
|
|
nil)
|
|
|
|
|
(add-hook 'post-command-hook #'whitespace-post-command-hook nil t)
|
2010-08-21 04:43:04 +00:00
|
|
|
|
(add-hook 'before-change-functions #'whitespace-buffer-changed nil t)
|
2013-03-18 01:50:32 +00:00
|
|
|
|
;; Add whitespace-mode color into font lock.
|
2013-03-19 05:06:49 +00:00
|
|
|
|
(setq
|
|
|
|
|
whitespace-font-lock-keywords
|
2013-03-18 01:50:32 +00:00
|
|
|
|
`(
|
2014-05-29 03:54:37 +00:00
|
|
|
|
(whitespace-point--flush-used)
|
2013-03-18 01:50:32 +00:00
|
|
|
|
,@(when (memq 'spaces whitespace-active-style)
|
|
|
|
|
;; Show SPACEs.
|
|
|
|
|
`((,whitespace-space-regexp 1 whitespace-space t)
|
|
|
|
|
;; Show HARD SPACEs.
|
|
|
|
|
(,whitespace-hspace-regexp 1 whitespace-hspace t)))
|
|
|
|
|
,@(when (memq 'tabs whitespace-active-style)
|
|
|
|
|
;; Show TABs.
|
|
|
|
|
`((,whitespace-tab-regexp 1 whitespace-tab t)))
|
|
|
|
|
,@(when (memq 'trailing whitespace-active-style)
|
|
|
|
|
;; Show trailing blanks.
|
|
|
|
|
`((,#'whitespace-trailing-regexp 1 whitespace-trailing t)))
|
|
|
|
|
,@(when (or (memq 'lines whitespace-active-style)
|
|
|
|
|
(memq 'lines-tail whitespace-active-style))
|
|
|
|
|
;; Show "long" lines.
|
|
|
|
|
`((,(let ((line-column (or whitespace-line-column fill-column)))
|
|
|
|
|
(format
|
|
|
|
|
"^\\([^\t\n]\\{%s\\}\\|[^\t\n]\\{0,%s\\}\t\\)\\{%d\\}%s\\(.+\\)$"
|
2017-03-02 12:50:06 +00:00
|
|
|
|
tab-width
|
|
|
|
|
(1- tab-width)
|
|
|
|
|
(/ line-column tab-width)
|
|
|
|
|
(let ((rem (% line-column tab-width)))
|
2013-03-18 01:50:32 +00:00
|
|
|
|
(if (zerop rem)
|
|
|
|
|
""
|
|
|
|
|
(format ".\\{%d\\}" rem)))))
|
|
|
|
|
,(if (memq 'lines whitespace-active-style)
|
|
|
|
|
0 ; whole line
|
|
|
|
|
2) ; line tail
|
2013-03-19 04:23:36 +00:00
|
|
|
|
whitespace-line prepend)))
|
2013-03-18 01:50:32 +00:00
|
|
|
|
,@(when (or (memq 'space-before-tab whitespace-active-style)
|
|
|
|
|
(memq 'space-before-tab::tab whitespace-active-style)
|
|
|
|
|
(memq 'space-before-tab::space whitespace-active-style))
|
|
|
|
|
`((,whitespace-space-before-tab-regexp
|
|
|
|
|
,(cond
|
|
|
|
|
((memq 'space-before-tab whitespace-active-style)
|
|
|
|
|
;; Show SPACEs before TAB (indent-tabs-mode).
|
2017-03-02 12:50:06 +00:00
|
|
|
|
(if indent-tabs-mode 1 2))
|
2013-03-18 01:50:32 +00:00
|
|
|
|
((memq 'space-before-tab::tab whitespace-active-style)
|
|
|
|
|
1)
|
|
|
|
|
((memq 'space-before-tab::space whitespace-active-style)
|
|
|
|
|
2))
|
|
|
|
|
whitespace-space-before-tab t)))
|
|
|
|
|
,@(when (or (memq 'indentation whitespace-active-style)
|
|
|
|
|
(memq 'indentation::tab whitespace-active-style)
|
|
|
|
|
(memq 'indentation::space whitespace-active-style))
|
|
|
|
|
`((,(cond
|
|
|
|
|
((memq 'indentation whitespace-active-style)
|
|
|
|
|
;; Show indentation SPACEs (indent-tabs-mode).
|
|
|
|
|
(whitespace-indentation-regexp))
|
|
|
|
|
((memq 'indentation::tab whitespace-active-style)
|
|
|
|
|
;; Show indentation SPACEs (SPACEs).
|
|
|
|
|
(whitespace-indentation-regexp 'tab))
|
|
|
|
|
((memq 'indentation::space whitespace-active-style)
|
|
|
|
|
;; Show indentation SPACEs (TABs).
|
|
|
|
|
(whitespace-indentation-regexp 'space)))
|
|
|
|
|
1 whitespace-indentation t)))
|
2014-10-18 00:23:03 +00:00
|
|
|
|
,@(when (memq 'big-indent whitespace-active-style)
|
|
|
|
|
;; Show big indentation.
|
|
|
|
|
`((,whitespace-big-indent-regexp 1 'whitespace-big-indent t)))
|
2013-03-18 01:50:32 +00:00
|
|
|
|
,@(when (memq 'empty whitespace-active-style)
|
|
|
|
|
;; Show empty lines at beginning of buffer.
|
|
|
|
|
`((,#'whitespace-empty-at-bob-regexp
|
|
|
|
|
1 whitespace-empty t)
|
|
|
|
|
;; Show empty lines at end of buffer.
|
|
|
|
|
(,#'whitespace-empty-at-eob-regexp
|
|
|
|
|
1 whitespace-empty t)))
|
|
|
|
|
,@(when (or (memq 'space-after-tab whitespace-active-style)
|
|
|
|
|
(memq 'space-after-tab::tab whitespace-active-style)
|
|
|
|
|
(memq 'space-after-tab::space whitespace-active-style))
|
|
|
|
|
`((,(cond
|
|
|
|
|
((memq 'space-after-tab whitespace-active-style)
|
|
|
|
|
;; Show SPACEs after TAB (indent-tabs-mode).
|
|
|
|
|
(whitespace-space-after-tab-regexp))
|
|
|
|
|
((memq 'space-after-tab::tab whitespace-active-style)
|
|
|
|
|
;; Show SPACEs after TAB (SPACEs).
|
|
|
|
|
(whitespace-space-after-tab-regexp 'tab))
|
|
|
|
|
((memq 'space-after-tab::space whitespace-active-style)
|
|
|
|
|
;; Show SPACEs after TAB (TABs).
|
|
|
|
|
(whitespace-space-after-tab-regexp 'space)))
|
2013-03-19 05:06:49 +00:00
|
|
|
|
1 whitespace-space-after-tab t)))))
|
|
|
|
|
(font-lock-add-keywords nil whitespace-font-lock-keywords t)
|
2014-05-29 03:54:37 +00:00
|
|
|
|
(font-lock-flush)))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defun whitespace-color-off ()
|
2008-01-21 12:45:58 +00:00
|
|
|
|
"Turn off color visualization."
|
2008-04-26 11:38:50 +00:00
|
|
|
|
;; turn off font lock
|
2014-05-29 03:54:37 +00:00
|
|
|
|
(kill-local-variable 'whitespace-point--used)
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(when (whitespace-style-face-p)
|
2010-08-21 04:43:04 +00:00
|
|
|
|
(remove-hook 'post-command-hook #'whitespace-post-command-hook t)
|
|
|
|
|
(remove-hook 'before-change-functions #'whitespace-buffer-changed t)
|
2013-03-19 05:06:49 +00:00
|
|
|
|
(font-lock-remove-keywords nil whitespace-font-lock-keywords)
|
2014-05-29 03:54:37 +00:00
|
|
|
|
(font-lock-flush)))
|
|
|
|
|
|
|
|
|
|
(defun whitespace-point--used (start end)
|
|
|
|
|
(let ((ostart (overlay-start whitespace-point--used)))
|
|
|
|
|
(if ostart
|
|
|
|
|
(move-overlay whitespace-point--used
|
|
|
|
|
(min start ostart)
|
|
|
|
|
(max end (overlay-end whitespace-point--used)))
|
|
|
|
|
(move-overlay whitespace-point--used start end))))
|
|
|
|
|
|
|
|
|
|
(defun whitespace-point--flush-used (limit)
|
|
|
|
|
(let ((ostart (overlay-start whitespace-point--used)))
|
|
|
|
|
;; Strip parts of whitespace-point--used we're about to refresh.
|
|
|
|
|
(when ostart
|
|
|
|
|
(let ((oend (overlay-end whitespace-point--used)))
|
|
|
|
|
(if (<= (point) ostart)
|
|
|
|
|
(if (<= oend limit)
|
|
|
|
|
(delete-overlay whitespace-point--used)
|
|
|
|
|
(move-overlay whitespace-point--used limit oend)))
|
|
|
|
|
(if (<= oend limit)
|
|
|
|
|
(move-overlay whitespace-point--used ostart (point))))))
|
|
|
|
|
nil)
|
2009-09-25 02:23:51 +00:00
|
|
|
|
|
|
|
|
|
(defun whitespace-trailing-regexp (limit)
|
2009-09-28 01:57:33 +00:00
|
|
|
|
"Match trailing spaces which do not contain the point at end of line."
|
2009-09-25 02:23:51 +00:00
|
|
|
|
(let ((status t))
|
|
|
|
|
(while (if (re-search-forward whitespace-trailing-regexp limit t)
|
2014-05-29 03:54:37 +00:00
|
|
|
|
(when (= whitespace-point (match-end 1)) ; Loop if point at eol.
|
|
|
|
|
(whitespace-point--used (match-beginning 0) (match-end 0))
|
|
|
|
|
t)
|
2011-10-31 01:39:04 +00:00
|
|
|
|
(setq status nil))) ;; end of buffer
|
2009-09-25 02:23:51 +00:00
|
|
|
|
status))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun whitespace-empty-at-bob-regexp (limit)
|
2009-09-28 01:57:33 +00:00
|
|
|
|
"Match spaces at beginning of buffer which do not contain the point at \
|
2009-09-25 02:23:51 +00:00
|
|
|
|
beginning of buffer."
|
2010-08-21 04:43:04 +00:00
|
|
|
|
(let ((b (point))
|
|
|
|
|
r)
|
|
|
|
|
(cond
|
|
|
|
|
;; at bob
|
|
|
|
|
((= b 1)
|
2014-05-29 03:54:37 +00:00
|
|
|
|
(setq r (and (looking-at whitespace-empty-at-bob-regexp)
|
|
|
|
|
(or (/= whitespace-point 1)
|
|
|
|
|
(progn (whitespace-point--used (match-beginning 0)
|
|
|
|
|
(match-end 0))
|
|
|
|
|
nil))))
|
2011-05-04 01:02:09 +00:00
|
|
|
|
(set-marker whitespace-bob-marker (if r (match-end 1) b)))
|
2010-08-21 04:43:04 +00:00
|
|
|
|
;; inside bob empty region
|
|
|
|
|
((<= limit whitespace-bob-marker)
|
|
|
|
|
(setq r (looking-at whitespace-empty-at-bob-regexp))
|
|
|
|
|
(if r
|
|
|
|
|
(when (< (match-end 1) limit)
|
|
|
|
|
(set-marker whitespace-bob-marker (match-end 1)))
|
|
|
|
|
(set-marker whitespace-bob-marker b)))
|
|
|
|
|
;; intersection with end of bob empty region
|
|
|
|
|
((<= b whitespace-bob-marker)
|
|
|
|
|
(setq r (looking-at whitespace-empty-at-bob-regexp))
|
2011-05-04 01:02:09 +00:00
|
|
|
|
(set-marker whitespace-bob-marker (if r (match-end 1) b)))
|
2010-08-21 04:43:04 +00:00
|
|
|
|
;; it is not inside bob empty region
|
|
|
|
|
(t
|
|
|
|
|
(setq r nil)))
|
|
|
|
|
;; move to end of matching
|
|
|
|
|
(and r (goto-char (match-end 1)))
|
|
|
|
|
r))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defsubst whitespace-looking-back (regexp limit)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(when (/= 0 (skip-chars-backward " \t\n" limit))
|
|
|
|
|
(unless (bolp)
|
|
|
|
|
(forward-line 1))
|
|
|
|
|
(looking-at regexp))))
|
2009-09-25 02:23:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun whitespace-empty-at-eob-regexp (limit)
|
2009-09-28 01:57:33 +00:00
|
|
|
|
"Match spaces at end of buffer which do not contain the point at end of \
|
2009-09-25 02:23:51 +00:00
|
|
|
|
buffer."
|
2010-08-21 04:43:04 +00:00
|
|
|
|
(let ((b (point))
|
|
|
|
|
(e (1+ (buffer-size)))
|
|
|
|
|
r)
|
|
|
|
|
(cond
|
|
|
|
|
;; at eob
|
|
|
|
|
((= limit e)
|
2014-05-29 03:54:37 +00:00
|
|
|
|
(goto-char limit)
|
|
|
|
|
(setq r (whitespace-looking-back whitespace-empty-at-eob-regexp b))
|
|
|
|
|
(when (and r (= whitespace-point e))
|
|
|
|
|
(setq r nil)
|
|
|
|
|
(whitespace-point--used (match-beginning 0) (match-end 0)))
|
2010-08-21 04:43:04 +00:00
|
|
|
|
(if r
|
|
|
|
|
(set-marker whitespace-eob-marker (match-beginning 1))
|
|
|
|
|
(set-marker whitespace-eob-marker limit)
|
|
|
|
|
(goto-char b))) ; return back to initial position
|
|
|
|
|
;; inside eob empty region
|
|
|
|
|
((>= b whitespace-eob-marker)
|
|
|
|
|
(goto-char limit)
|
|
|
|
|
(setq r (whitespace-looking-back whitespace-empty-at-eob-regexp b))
|
|
|
|
|
(if r
|
|
|
|
|
(when (> (match-beginning 1) b)
|
|
|
|
|
(set-marker whitespace-eob-marker (match-beginning 1)))
|
|
|
|
|
(set-marker whitespace-eob-marker limit)
|
|
|
|
|
(goto-char b))) ; return back to initial position
|
|
|
|
|
;; intersection with beginning of eob empty region
|
|
|
|
|
((>= limit whitespace-eob-marker)
|
|
|
|
|
(goto-char limit)
|
|
|
|
|
(setq r (whitespace-looking-back whitespace-empty-at-eob-regexp b))
|
|
|
|
|
(if r
|
|
|
|
|
(set-marker whitespace-eob-marker (match-beginning 1))
|
|
|
|
|
(set-marker whitespace-eob-marker limit)
|
|
|
|
|
(goto-char b))) ; return back to initial position
|
|
|
|
|
;; it is not inside eob empty region
|
|
|
|
|
(t
|
|
|
|
|
(setq r nil)))
|
|
|
|
|
r))
|
|
|
|
|
|
|
|
|
|
|
2011-04-19 13:44:55 +00:00
|
|
|
|
(defun whitespace-buffer-changed (_beg _end)
|
2010-08-21 04:43:04 +00:00
|
|
|
|
"Set `whitespace-buffer-changed' variable to t."
|
|
|
|
|
(setq whitespace-buffer-changed t))
|
2009-09-25 02:23:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun whitespace-post-command-hook ()
|
|
|
|
|
"Save current point into `whitespace-point' variable.
|
|
|
|
|
Also refontify when necessary."
|
2014-05-29 03:54:37 +00:00
|
|
|
|
(unless (and (eq whitespace-point (point))
|
|
|
|
|
(not whitespace-buffer-changed))
|
|
|
|
|
(setq whitespace-point (point)) ; current point position
|
|
|
|
|
(let ((refontify
|
|
|
|
|
(cond
|
|
|
|
|
;; It is at end of buffer (eob).
|
|
|
|
|
((= whitespace-point (1+ (buffer-size)))
|
|
|
|
|
(when (whitespace-looking-back whitespace-empty-at-eob-regexp
|
|
|
|
|
nil)
|
|
|
|
|
(match-beginning 0)))
|
|
|
|
|
;; It is at end of line ...
|
|
|
|
|
((and (eolp)
|
|
|
|
|
;; ... with trailing SPACE or TAB
|
|
|
|
|
(or (memq (preceding-char) '(?\s ?\t))))
|
|
|
|
|
(line-beginning-position))
|
|
|
|
|
;; It is at beginning of buffer (bob).
|
|
|
|
|
((and (= whitespace-point 1)
|
|
|
|
|
(looking-at whitespace-empty-at-bob-regexp))
|
|
|
|
|
(match-end 0))))
|
|
|
|
|
(ostart (overlay-start whitespace-point--used)))
|
|
|
|
|
(cond
|
|
|
|
|
((not refontify)
|
|
|
|
|
;; New point does not affect highlighting: just refresh the
|
|
|
|
|
;; highlighting of old point, if needed.
|
|
|
|
|
(when ostart
|
|
|
|
|
(font-lock-flush ostart
|
|
|
|
|
(overlay-end whitespace-point--used))
|
|
|
|
|
(delete-overlay whitespace-point--used)))
|
|
|
|
|
((not ostart)
|
|
|
|
|
;; Old point did not affect highlighting, but new one does: refresh the
|
|
|
|
|
;; highlighting of new point.
|
|
|
|
|
(font-lock-flush (min refontify (point)) (max refontify (point))))
|
|
|
|
|
((save-excursion
|
|
|
|
|
(goto-char ostart)
|
|
|
|
|
(setq ostart (line-beginning-position))
|
|
|
|
|
(and (<= ostart (max refontify (point)))
|
|
|
|
|
(progn
|
|
|
|
|
(goto-char (overlay-end whitespace-point--used))
|
|
|
|
|
(let ((oend (line-beginning-position 2)))
|
|
|
|
|
(<= (min refontify (point)) oend)))))
|
|
|
|
|
;; The old point highlighting and the new point highlighting
|
|
|
|
|
;; cover a contiguous region: do a single refresh.
|
|
|
|
|
(font-lock-flush (min refontify (point) ostart)
|
|
|
|
|
(max refontify (point)
|
|
|
|
|
(overlay-end whitespace-point--used)))
|
|
|
|
|
(delete-overlay whitespace-point--used))
|
|
|
|
|
(t
|
|
|
|
|
(font-lock-flush (min refontify (point))
|
|
|
|
|
(max refontify (point)))
|
|
|
|
|
(font-lock-flush ostart (overlay-end whitespace-point--used))
|
|
|
|
|
(delete-overlay whitespace-point--used))))))
|
2009-09-25 02:23:51 +00:00
|
|
|
|
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;;;; Hacked from visws.el (Miles Bader <miles@gnu.org>)
|
|
|
|
|
|
|
|
|
|
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(defun whitespace-style-mark-p ()
|
|
|
|
|
"Return t if there is some visualization via display table."
|
2019-10-14 21:52:21 +00:00
|
|
|
|
(and (or (memq 'tab-mark whitespace-active-style)
|
|
|
|
|
(memq 'space-mark whitespace-active-style)
|
|
|
|
|
(memq 'newline-mark whitespace-active-style))
|
|
|
|
|
t))
|
2008-04-26 11:38:50 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defsubst whitespace-char-valid-p (char)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; This check should be improved!!!
|
|
|
|
|
(or (< char 256)
|
2008-02-02 04:17:54 +00:00
|
|
|
|
(characterp char)))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defun whitespace-display-vector-p (vec)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
"Return true if every character in vector VEC can be displayed."
|
|
|
|
|
(let ((i (length vec)))
|
|
|
|
|
(when (> i 0)
|
|
|
|
|
(while (and (>= (setq i (1- i)) 0)
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(whitespace-char-valid-p (aref vec i))))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(< i 0))))
|
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defun whitespace-display-char-on ()
|
2008-01-17 12:46:55 +00:00
|
|
|
|
"Turn on character display mapping."
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(when (and whitespace-display-mappings
|
|
|
|
|
(whitespace-style-mark-p))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(let (vecs vec)
|
|
|
|
|
;; Remember whether a buffer has a local display table.
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(unless whitespace-display-table-was-local
|
2017-05-19 12:20:59 +00:00
|
|
|
|
(setq whitespace-display-table-was-local t)
|
|
|
|
|
(unless (or whitespace-mode global-whitespace-mode)
|
|
|
|
|
(setq whitespace-display-table
|
|
|
|
|
(copy-sequence buffer-display-table)))
|
2011-11-14 23:59:56 +00:00
|
|
|
|
;; Assure `buffer-display-table' is unique
|
2010-08-21 04:43:04 +00:00
|
|
|
|
;; when two or more windows are visible.
|
|
|
|
|
(setq buffer-display-table
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(copy-sequence buffer-display-table)))
|
|
|
|
|
(unless buffer-display-table
|
|
|
|
|
(setq buffer-display-table (make-display-table)))
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(dolist (entry whitespace-display-mappings)
|
2008-04-16 03:41:17 +00:00
|
|
|
|
;; check if it is to display this mark
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(when (memq (car entry) whitespace-style)
|
2008-04-16 03:41:17 +00:00
|
|
|
|
;; Get a displayable mapping.
|
|
|
|
|
(setq vecs (cddr entry))
|
|
|
|
|
(while (and vecs
|
|
|
|
|
(not (whitespace-display-vector-p (car vecs))))
|
|
|
|
|
(setq vecs (cdr vecs)))
|
|
|
|
|
;; Display a valid mapping.
|
|
|
|
|
(when vecs
|
|
|
|
|
(setq vec (copy-sequence (car vecs)))
|
|
|
|
|
;; NEWLINE char
|
|
|
|
|
(when (and (eq (cadr entry) ?\n)
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(memq 'newline whitespace-active-style))
|
2008-04-16 03:41:17 +00:00
|
|
|
|
;; Only insert face bits on NEWLINE char mapping to avoid
|
|
|
|
|
;; obstruction of other faces like TABs and (HARD) SPACEs
|
|
|
|
|
;; faces, font-lock faces, etc.
|
2008-01-17 12:46:55 +00:00
|
|
|
|
(dotimes (i (length vec))
|
|
|
|
|
(or (eq (aref vec i) ?\n)
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(aset vec i
|
|
|
|
|
(make-glyph-code (aref vec i)
|
|
|
|
|
whitespace-newline)))))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
;; Display mapping
|
2008-04-16 03:41:17 +00:00
|
|
|
|
(aset buffer-display-table (cadr entry) vec)))))))
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(defun whitespace-display-char-off ()
|
2008-01-17 12:46:55 +00:00
|
|
|
|
"Turn off character display mapping."
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(and whitespace-display-mappings
|
2008-04-26 11:38:50 +00:00
|
|
|
|
(whitespace-style-mark-p)
|
2008-01-31 16:08:29 +00:00
|
|
|
|
whitespace-display-table-was-local
|
|
|
|
|
(setq whitespace-display-table-was-local nil
|
|
|
|
|
buffer-display-table whitespace-display-table)))
|
2008-01-28 13:58:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2008-03-01 19:00:24 +00:00
|
|
|
|
;;;; Hook
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun whitespace-action-when-on ()
|
|
|
|
|
"Action to be taken always when local whitespace is turned on."
|
|
|
|
|
(cond ((memq 'cleanup whitespace-action)
|
|
|
|
|
(whitespace-cleanup))
|
|
|
|
|
((memq 'report-on-bogus whitespace-action)
|
|
|
|
|
(whitespace-report nil t))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun whitespace-write-file-hook ()
|
|
|
|
|
"Action to be taken when buffer is written.
|
|
|
|
|
It should be added buffer-locally to `write-file-functions'."
|
|
|
|
|
(cond ((memq 'auto-cleanup whitespace-action)
|
2008-10-02 00:49:49 +00:00
|
|
|
|
(whitespace-cleanup))
|
2008-03-01 19:00:24 +00:00
|
|
|
|
((memq 'abort-on-bogus whitespace-action)
|
2008-10-02 00:49:49 +00:00
|
|
|
|
(when (whitespace-report nil t)
|
|
|
|
|
(error "Abort write due to whitespace problems in %s"
|
|
|
|
|
(buffer-name)))))
|
|
|
|
|
nil) ; continue hook processing
|
2008-03-01 19:00:24 +00:00
|
|
|
|
|
2008-09-06 00:19:31 +00:00
|
|
|
|
|
|
|
|
|
(defun whitespace-warn-read-only (msg)
|
|
|
|
|
"Warn if buffer is read-only."
|
2008-10-02 00:49:49 +00:00
|
|
|
|
(when (memq 'warn-if-read-only whitespace-action)
|
2008-09-06 00:19:31 +00:00
|
|
|
|
(message "Can't %s: %s is read-only" msg (buffer-name))))
|
|
|
|
|
|
2008-03-01 19:00:24 +00:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-02-01 11:25:16 +00:00
|
|
|
|
(defun whitespace-unload-function ()
|
2008-03-01 19:00:24 +00:00
|
|
|
|
"Unload the whitespace library."
|
|
|
|
|
(global-whitespace-mode -1)
|
|
|
|
|
;; be sure all local whitespace mode is turned off
|
|
|
|
|
(save-current-buffer
|
|
|
|
|
(dolist (buf (buffer-list))
|
|
|
|
|
(set-buffer buf)
|
|
|
|
|
(whitespace-mode -1)))
|
|
|
|
|
nil) ; continue standard unloading
|
|
|
|
|
|
2008-02-01 11:25:16 +00:00
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(provide 'whitespace)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
(run-hooks 'whitespace-load-hook)
|
2008-01-17 12:46:55 +00:00
|
|
|
|
|
|
|
|
|
|
2008-01-31 16:08:29 +00:00
|
|
|
|
;;; whitespace.el ends here
|