diff options
| author | Dmitry Gutov | 2015-04-14 05:03:32 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2015-04-14 05:06:49 +0300 |
| commit | a9ccfaefc1ca8fa5b0177101984f64b3b186339b (patch) | |
| tree | 70c652aeeb0b392d25702a1d75c531f449ed347e | |
| parent | e192281baae377a8702f3c048fce988d63ccfc1a (diff) | |
| download | emacs-a9ccfaefc1ca8fa5b0177101984f64b3b186339b.tar.gz emacs-a9ccfaefc1ca8fa5b0177101984f64b3b186339b.zip | |
Change diff-switches default to `-u'
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'.
| -rw-r--r-- | doc/emacs/files.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/trouble.texi | 11 | ||||
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/vc/diff.el | 2 |
4 files changed, 11 insertions, 8 deletions
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index c4b0c11f68b..3a281d223b3 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -1272,7 +1272,7 @@ minibuffer, and displays the differences between the two files in a | |||
| 1272 | buffer named @file{*diff*}. This works by running the @command{diff} | 1272 | buffer named @file{*diff*}. This works by running the @command{diff} |
| 1273 | program, using options taken from the variable @code{diff-switches}. | 1273 | program, using options taken from the variable @code{diff-switches}. |
| 1274 | The value of @code{diff-switches} should be a string; the default is | 1274 | The value of @code{diff-switches} should be a string; the default is |
| 1275 | @code{"-c"} to specify a context diff. | 1275 | @code{"-u"} to specify a unified context diff. |
| 1276 | @c Note that the actual name of the info file is diffutils.info, | 1276 | @c Note that the actual name of the info file is diffutils.info, |
| 1277 | @c but it adds a dir entry for diff too. | 1277 | @c but it adds a dir entry for diff too. |
| 1278 | @c On older systems, only "info diff" works, not "info diffutils". | 1278 | @c On older systems, only "info diff" works, not "info diffutils". |
diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index 2c3de28628e..42022cd14f6 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi | |||
| @@ -743,7 +743,7 @@ unmodified Emacs. But if you've made modifications and you don't tell | |||
| 743 | us, you are sending us on a wild goose chase.) | 743 | us, you are sending us on a wild goose chase.) |
| 744 | 744 | ||
| 745 | Be precise about these changes. A description in English is not | 745 | Be precise about these changes. A description in English is not |
| 746 | enough---send a context diff for them. | 746 | enough---send a unified context diff for them. |
| 747 | 747 | ||
| 748 | Adding files of your own, or porting to another machine, is a | 748 | Adding files of your own, or porting to another machine, is a |
| 749 | modification of the source. | 749 | modification of the source. |
| @@ -1131,13 +1131,12 @@ is important. | |||
| 1131 | @item | 1131 | @item |
| 1132 | The patch itself. | 1132 | The patch itself. |
| 1133 | 1133 | ||
| 1134 | Use @samp{diff -c} to make your diffs. Diffs without context are hard | 1134 | Use @samp{diff -u} to make your diffs. Diffs without context are hard |
| 1135 | to install reliably. More than that, they are hard to study; we must | 1135 | to install reliably. More than that, they are hard to study; we must |
| 1136 | always study a patch to decide whether we want to install it. Unidiff | 1136 | always study a patch to decide whether we want to install it. Context |
| 1137 | format is better than contextless diffs, but not as easy to read as | 1137 | format is better than contextless diffs, but we prefer we unified format. |
| 1138 | @samp{-c} format. | ||
| 1139 | 1138 | ||
| 1140 | If you have GNU diff, use @samp{diff -c -F'^[_a-zA-Z0-9$]+ *('} when | 1139 | If you have GNU diff, use @samp{diff -u -F'^[_a-zA-Z0-9$]\+ *('} when |
| 1141 | making diffs of C code. This shows the name of the function that each | 1140 | making diffs of C code. This shows the name of the function that each |
| 1142 | change occurs in. | 1141 | change occurs in. |
| 1143 | 1142 | ||
| @@ -690,6 +690,10 @@ now match multibyte characters using Unicode character properties. | |||
| 690 | If you want the old behavior where they matched any character with | 690 | If you want the old behavior where they matched any character with |
| 691 | word syntax, use `\sw' instead. | 691 | word syntax, use `\sw' instead. |
| 692 | 692 | ||
| 693 | +++ | ||
| 694 | ** The `diff' command uses the unified format now. To restore the old | ||
| 695 | behavior, set `diff-switches' to `-c'. | ||
| 696 | |||
| 693 | 697 | ||
| 694 | * Lisp Changes in Emacs 25.1 | 698 | * Lisp Changes in Emacs 25.1 |
| 695 | 699 | ||
diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el index 062248c8f14..2a973cfdfb1 100644 --- a/lisp/vc/diff.el +++ b/lisp/vc/diff.el | |||
| @@ -38,7 +38,7 @@ | |||
| 38 | :group 'tools) | 38 | :group 'tools) |
| 39 | 39 | ||
| 40 | ;;;###autoload | 40 | ;;;###autoload |
| 41 | (defcustom diff-switches (purecopy "-c") | 41 | (defcustom diff-switches (purecopy "-u") |
| 42 | "A string or list of strings specifying switches to be passed to diff." | 42 | "A string or list of strings specifying switches to be passed to diff." |
| 43 | :type '(choice string (repeat string)) | 43 | :type '(choice string (repeat string)) |
| 44 | :group 'diff) | 44 | :group 'diff) |