]> git.eshelyaron.com Git - emacs.git/commitdiff
Document Whitespace mode in manual, plus its use in Diff mode.
authorChong Yidong <cyd@gnu.org>
Sat, 7 Jan 2012 08:55:43 +0000 (16:55 +0800)
committerChong Yidong <cyd@gnu.org>
Sat, 7 Jan 2012 08:55:43 +0000 (16:55 +0800)
* 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
doc/emacs/display.texi
doc/emacs/files.texi

index 7b42f58c4f5f338ca88e996c8fc22a2db74be2c7..cd0d30615a285c6c9cc2813ced2e1b0f411c5153 100644 (file)
@@ -1,9 +1,11 @@
 2012-01-07  Chong Yidong  <cyd@gnu.org>
 
+       * 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.
index 4373718926d65a8a093151a9efe12bdd57b45f9d..b098f26eea55756d92635f6d3e8ec49ca16acd13 100644 (file)
@@ -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
index 8d3e8c9c0859050bde69befc20e0b36f6d793be4..a522e055d2bbfc7da785415bfd5482430db4ad99 100644 (file)
@@ -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