From e490b28922e17178224c6842b40429675b751cc8 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 7 Jan 2012 16:55:43 +0800 Subject: [PATCH] Document Whitespace mode in manual, plus its use in Diff mode. * doc/emacs/display.texi (Useless Whitespace): Add Whitespace mode. * doc/emacs/files.texi (Diff Mode): Discuss use of Whitespace mode. Fixes: debbugs:10300 --- doc/emacs/ChangeLog | 4 +++- doc/emacs/display.texi | 50 ++++++++++++++++++++++++++++++++++++++++++ doc/emacs/files.texi | 11 +++++----- 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 7b42f58c4f5..cd0d30615a2 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,9 +1,11 @@ 2012-01-07 Chong Yidong + * display.texi (Useless Whitespace): Add Whitespace mode. + * custom.texi (Hooks): Discuss how to disable minor modes. * files.texi (Diff Mode): Discuss diff-auto-refine-mode - (Bug#10309). + (Bug#10309). Discuss use of Whitespace mode (Bug#10300). * trouble.texi (Lossage): Refer to Bugs node for problems. (DEL Does Not Delete): Don't use "usual erasure key" teminology. diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 4373718926d..b098f26eea5 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -1062,6 +1062,56 @@ can enable or disable this feature for all new buffers by setting the default value of this variable, e.g.@: @code{(setq-default indicate-empty-lines t)}. +@cindex Whitespace mode +@cindex mode, Whitespace +@findex whitespace-mode +@vindex whitespace-style + Whitespace mode is a buffer-local minor mode that lets you +``visualize'' many kinds of whitespace in the buffer, by either +drawing the whitespace characters with a special face or displaying +them as special glyphs. To toggle this mode, type @kbd{M-x +whitespace-mode}. The kinds of whitespace visualized are determined +by the list variable @code{whitespace-style}. Here is a partial list +of possible elements (see the variable's documentation for the full +list): + +@table @code +@item face +Enable all visualizations which use special faces. This element has a +special meaing: if it is absent from the list, none of the other +visualizations take effect except @code{space-mark}, @code{tab-mark}, +and @code{newline-mark}. + +@item trailing +Highlight trailing whitespace. + +@item tabs +Highlight tab characters. + +@item spaces +Highlight space and non-breaking space characters. + +@item lines +@vindex whitespace-line-column +Highlight lines longer than 80 lines. To change the column limit, +customize the variable @code{whitespace-line-column}. + +@item newline +Highlight newlines. + +@item empty +Highlight empty lines. + +@item space-mark +Draw space and non-breaking characters with a special glyph. + +@item tab-mark +Draw tab characters with a special glyph. + +@item newline-mark +Draw newline characters with a special glyph. +@end table + @node Selective Display @section Selective Display @cindex selective display diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 8d3e8c9c085..a522e055d2b 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1463,13 +1463,14 @@ descriptions of the changes. @kbd{C-x 4 a} itself in Diff mode operates on behalf of the current hunk's file, but gets the function name from the patch itself. This is useful for making log entries for functions that are deleted by the patch. - -@item M-x diff-show-trailing-whitespaces RET -@findex diff-show-trailing-whitespaces -Highlight trailing whitespace characters, except for those used by the -patch syntax (@pxref{Useless Whitespace}). @end table + By default, Diff mode highlights trailing whitespace on modified +lines, so that they are more obvious. This is done by enabling +Whitespace mode in the Diff buffer (@pxref{Useless Whitespace}). Diff +mode buffers are set up so that Whitespace mode avoids highlighting +trailing whitespace occurring in the diff context. + @node Misc File Ops @section Miscellaneous File Operations -- 2.39.2