aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-11-08 00:14:23 -0800
committerGlenn Morris2012-11-08 00:14:23 -0800
commit26f596760dcbedc775d69ce829426b9d8dbd1870 (patch)
treee0e8acef4058cbe18f626c1efb3fe46d99a59edf
parent7858872b755fd48d82f26a488351ac7ef8512f71 (diff)
downloademacs-26f596760dcbedc775d69ce829426b9d8dbd1870.tar.gz
emacs-26f596760dcbedc775d69ce829426b9d8dbd1870.zip
Document diff-remove-trailing-whitespace
* doc/emacs/files.texi (Diff Mode): Trailing whitespace updates. * lisp/vc/diff-mode.el (diff-remove-trailing-whitespace): Doc fix. * etc/NEWS: Related markup.
-rw-r--r--doc/emacs/ChangeLog4
-rw-r--r--doc/emacs/files.texi18
-rw-r--r--etc/NEWS11
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/vc/diff-mode.el12
5 files changed, 34 insertions, 15 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 7ffb22daf30..3893e3c6513 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,7 @@
12012-11-08 Glenn Morris <rgm@gnu.org>
2
3 * files.texi (Diff Mode): Trailing whitespace updates.
4
12012-11-07 Chong Yidong <cyd@gnu.org> 52012-11-07 Chong Yidong <cyd@gnu.org>
2 6
3 * misc.texi (Terminal emulator): Document Term mode faces. 7 * misc.texi (Terminal emulator): Document Term mode faces.
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 36cd3658e2d..e2a85c6d138 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -1470,11 +1470,19 @@ name from the patch itself. This is useful for making log entries for
1470functions that are deleted by the patch. 1470functions that are deleted by the patch.
1471@end table 1471@end table
1472 1472
1473 By default, Diff mode highlights trailing whitespace on modified 1473@c Trailing whitespace is NOT shown by default.
1474lines, so that they are more obvious. This is done by enabling 1474@c Emacs's dir-locals file enables this (for some reason).
1475Whitespace mode in the Diff buffer (@pxref{Useless Whitespace}). Diff 1475@cindex trailing whitespace, in diffs
1476mode buffers are set up so that Whitespace mode avoids highlighting 1476@findex diff-remove-trailing-whitespace
1477trailing whitespace occurring in the diff context. 1477 Diff mode has various features for dealing with trailing whitespace
1478on modified lines, since this is often an unintentional and unwanted
1479change. If you enable Whitespace mode in a Diff buffer, trailing
1480whitespace is highlighted (@pxref{Useless Whitespace}). The command
1481@kbd{M-x diff-remove-trailing-whitespace} searches for trailing
1482whitespace in the lines modified or added by a diff. If it finds any,
1483it tries to visit the associated file(s) and remove it. It does not
1484save the modifications, rather it lists any buffers that were modified
1485so you can decide for yourself what to do.
1478 1486
1479@node Misc File Ops 1487@node Misc File Ops
1480@section Miscellaneous File Operations 1488@section Miscellaneous File Operations
diff --git a/etc/NEWS b/etc/NEWS
index 275e33d8026..5fa57ac23bd 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -392,18 +392,21 @@ details.
392 392
393** Diff mode 393** Diff mode
394 394
395---
395*** Changes are now highlighted using the same color scheme as in 396*** Changes are now highlighted using the same color scheme as in
396modern VCSes. Deletions are displayed in red (new faces 397modern VCSes. Deletions are displayed in red (new faces
397`diff-refine-removed' and `smerge-refined-removed' and new definition 398`diff-refine-removed' and `smerge-refined-removed', and new definition
398of `diff-removed'), insertions in green (new faces `diff-refine-added' 399of `diff-removed'), insertions in green (new faces `diff-refine-added'
399and `smerge-refined-added' and new definition of `diff-added'). 400and `smerge-refined-added', and new definition of `diff-added').
400 401
402---
401*** The variable `diff-use-changed-face' defines whether to use the 403*** The variable `diff-use-changed-face' defines whether to use the
402face `diff-changed', or `diff-removed' and `diff-added' to highlight 404face `diff-changed', or `diff-removed' and `diff-added' to highlight
403changes in context diffs. 405changes in context diffs.
404 406
405*** The new command `diff-remove-trailing-whitespace' fixes trailing 407+++
406whitespace problems introduced by the diff. 408*** The new command `diff-remove-trailing-whitespace' removes trailing
409whitespace introduced by a diff.
407 410
408** Dired 411** Dired
409+++ 412+++
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6a574f4b26d..b141afe67e6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12012-11-08 Glenn Morris <rgm@gnu.org>
2
3 * vc/diff-mode.el (diff-remove-trailing-whitespace): Doc fix.
4
12012-11-08 Stefan Monnier <monnier@iro.umontreal.ca> 52012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2 6
3 * emacs-lisp/gv.el (gv-define-simple-setter): Fix last change 7 * emacs-lisp/gv.el (gv-define-simple-setter): Fix last change
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 49b76a8e3bc..daf43c5c167 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2049,12 +2049,12 @@ I.e. like `add-change-log-entry-other-window' but applied to all hunks."
2049 (error nil)))) 2049 (error nil))))
2050 2050
2051(defun diff-remove-trailing-whitespace () 2051(defun diff-remove-trailing-whitespace ()
2052 "When on a buffer that contains a diff, inspects the 2052 "Remove trailing whitespace from the lines modified/added by a diff.
2053differences and removes trailing whitespace (spaces, tabs) from 2053Called from a buffer containing a diff, this searches for trailing
2054the lines modified or introduced by this diff. Shows a message 2054whitespace (spaces, tabs) in the modified/added lines. If the
2055with the name of the altered buffers, which are unsaved. If a 2055file that such a line refers to can be found, it visits it and
2056file referenced on the diff has no buffer and needs to be fixed, 2056removes the associated whitespace, if it is present. It does not
2057a buffer visiting that file is created." 2057save any changed buffers, it just gives a message naming them."
2058 (interactive) 2058 (interactive)
2059 ;; We assume that the diff header has no trailing whitespace. 2059 ;; We assume that the diff header has no trailing whitespace.
2060 (let ((modified-buffers nil)) 2060 (let ((modified-buffers nil))