]> code.delx.au - gnu-emacs/commitdiff
Change diff-switches default to `-u'
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 14 Apr 2015 02:03:32 +0000 (05:03 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 14 Apr 2015 02:06:49 +0000 (05:06 +0300)
Fixes: debbugs:20290
* doc/emacs/files.texi (Comparing Files): Document the new default
value of `diff-switches'.

* doc/emacs/trouble.texi (Sending Patches): Document the preference
for unified diff format.  Escape the plus in the suggested `-F' regexp
value.

* lisp/vc/diff.el (diff-switches): Change the default to `-u'.

doc/emacs/files.texi
doc/emacs/trouble.texi
etc/NEWS
lisp/vc/diff.el

index c4b0c11f68bacdb728b3284c0dc459b469abc588..3a281d223b3e984e44500a459370ec9be5134971 100644 (file)
@@ -1272,7 +1272,7 @@ minibuffer, and displays the differences between the two files in a
 buffer named @file{*diff*}.  This works by running the @command{diff}
 program, using options taken from the variable @code{diff-switches}.
 The value of @code{diff-switches} should be a string; the default is
-@code{"-c"} to specify a context diff.
+@code{"-u"} to specify a unified context diff.
 @c Note that the actual name of the info file is diffutils.info,
 @c but it adds a dir entry for diff too.
 @c On older systems, only "info diff" works, not "info diffutils".
index 2c3de28628ecb70ba7ac2962ff53dfa5378285a0..42022cd14f621401c9832413565643ec40429100 100644 (file)
@@ -743,7 +743,7 @@ unmodified Emacs.  But if you've made modifications and you don't tell
 us, you are sending us on a wild goose chase.)
 
 Be precise about these changes.  A description in English is not
-enough---send a context diff for them.
+enough---send a unified context diff for them.
 
 Adding files of your own, or porting to another machine, is a
 modification of the source.
@@ -1131,13 +1131,12 @@ is important.
 @item
 The patch itself.
 
-Use @samp{diff -c} to make your diffs.  Diffs without context are hard
+Use @samp{diff -u} to make your diffs.  Diffs without context are hard
 to install reliably.  More than that, they are hard to study; we must
-always study a patch to decide whether we want to install it.  Unidiff
-format is better than contextless diffs, but not as easy to read as
-@samp{-c} format.
+always study a patch to decide whether we want to install it.  Context
+format is better than contextless diffs, but we prefer we unified format.
 
-If you have GNU diff, use @samp{diff -c -F'^[_a-zA-Z0-9$]+ *('} when
+If you have GNU diff, use @samp{diff -u -F'^[_a-zA-Z0-9$]\+ *('} when
 making diffs of C code.  This shows the name of the function that each
 change occurs in.
 
index 8a9fa7c5c84b57415c7fc19deccf7d8819774b9e..6d8b4c6faf8bcd21f880d8c4041bbd4dfda8d815 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -690,6 +690,10 @@ now match multibyte characters using Unicode character properties.
 If you want the old behavior where they matched any character with
 word syntax, use `\sw' instead.
 
++++
+** The `diff' command uses the unified format now.  To restore the old
+behavior, set `diff-switches' to `-c'.
+
 \f
 * Lisp Changes in Emacs 25.1
 
index 062248c8f14e5350d844e77982245b64aa3371b3..2a973cfdfb13ce135bae63be706221b395fe0579 100644 (file)
@@ -38,7 +38,7 @@
   :group 'tools)
 
 ;;;###autoload
-(defcustom diff-switches (purecopy "-c")
+(defcustom diff-switches (purecopy "-u")
   "A string or list of strings specifying switches to be passed to diff."
   :type '(choice string (repeat string))
   :group 'diff)