diff options
| author | Stefan Monnier | 2012-10-29 11:14:10 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-10-29 11:14:10 -0400 |
| commit | d7f9cc85284bc159166d1c600100b0080bfad494 (patch) | |
| tree | e855d25fbf767c3c97c74950e31761b1bfdd01c4 | |
| parent | c606253cb5849ad04282b2f116e79963abdcea9d (diff) | |
| download | emacs-d7f9cc85284bc159166d1c600100b0080bfad494.tar.gz emacs-d7f9cc85284bc159166d1c600100b0080bfad494.zip | |
* lisp/vc/diff-mode.el (diff-context->unified): Don't get confused by "hunk
header comments".
(diff-unified->context, diff-context->unified)
(diff-reverse-direction, diff-fixup-modifs): Use `use-region-p'.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/vc/diff-mode.el | 14 | ||||
| -rwxr-xr-x | test/indent/shell.sh | 5 |
3 files changed, 17 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 387a8b0e619..54285a589eb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2012-10-29 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2012-10-29 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * vc/diff-mode.el (diff-context->unified): Don't get confused by "hunk | ||
| 4 | header comments". | ||
| 5 | (diff-unified->context, diff-context->unified) | ||
| 6 | (diff-reverse-direction, diff-fixup-modifs): Use `use-region-p'. | ||
| 7 | |||
| 3 | * emacs-lisp/cl.el (letf): Add missing indent rules (bug#12759). | 8 | * emacs-lisp/cl.el (letf): Add missing indent rules (bug#12759). |
| 4 | 9 | ||
| 5 | * files.el (find-alternate-file): Only ask one question (bug#12487). | 10 | * files.el (find-alternate-file): Only ask one question (bug#12487). |
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index bbe31205c0e..49b76a8e3bc 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el | |||
| @@ -911,7 +911,7 @@ PREFIX is only used internally: don't use it." | |||
| 911 | "Convert unified diffs to context diffs. | 911 | "Convert unified diffs to context diffs. |
| 912 | START and END are either taken from the region (if a prefix arg is given) or | 912 | START and END are either taken from the region (if a prefix arg is given) or |
| 913 | else cover the whole buffer." | 913 | else cover the whole buffer." |
| 914 | (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) | 914 | (interactive (if (or current-prefix-arg (use-region-p)) |
| 915 | (list (region-beginning) (region-end)) | 915 | (list (region-beginning) (region-end)) |
| 916 | (list (point-min) (point-max)))) | 916 | (list (point-min) (point-max)))) |
| 917 | (unless (markerp end) (setq end (copy-marker end t))) | 917 | (unless (markerp end) (setq end (copy-marker end t))) |
| @@ -1035,7 +1035,7 @@ else cover the whole buffer." | |||
| 1035 | START and END are either taken from the region | 1035 | START and END are either taken from the region |
| 1036 | \(when it is highlighted) or else cover the whole buffer. | 1036 | \(when it is highlighted) or else cover the whole buffer. |
| 1037 | With a prefix argument, convert unified format to context format." | 1037 | With a prefix argument, convert unified format to context format." |
| 1038 | (interactive (if (and transient-mark-mode mark-active) | 1038 | (interactive (if (use-region-p) |
| 1039 | (list (region-beginning) (region-end) current-prefix-arg) | 1039 | (list (region-beginning) (region-end) current-prefix-arg) |
| 1040 | (list (point-min) (point-max) current-prefix-arg))) | 1040 | (list (point-min) (point-max) current-prefix-arg))) |
| 1041 | (if to-context | 1041 | (if to-context |
| @@ -1045,7 +1045,7 @@ With a prefix argument, convert unified format to context format." | |||
| 1045 | (inhibit-read-only t)) | 1045 | (inhibit-read-only t)) |
| 1046 | (save-excursion | 1046 | (save-excursion |
| 1047 | (goto-char start) | 1047 | (goto-char start) |
| 1048 | (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t) | 1048 | (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)\\(?: \\(.*\\)\\|$\\)" nil t) |
| 1049 | (< (point) end)) | 1049 | (< (point) end)) |
| 1050 | (combine-after-change-calls | 1050 | (combine-after-change-calls |
| 1051 | (if (match-beginning 2) | 1051 | (if (match-beginning 2) |
| @@ -1061,7 +1061,9 @@ With a prefix argument, convert unified format to context format." | |||
| 1061 | ;; Variables to use the special undo function. | 1061 | ;; Variables to use the special undo function. |
| 1062 | (old-undo buffer-undo-list) | 1062 | (old-undo buffer-undo-list) |
| 1063 | (old-end (marker-position end)) | 1063 | (old-end (marker-position end)) |
| 1064 | (reversible t)) | 1064 | ;; We currently throw away the comment that can follow |
| 1065 | ;; the hunk header. FIXME: Preserve it instead! | ||
| 1066 | (reversible (not (match-end 6)))) | ||
| 1065 | (replace-match "") | 1067 | (replace-match "") |
| 1066 | (unless (re-search-forward | 1068 | (unless (re-search-forward |
| 1067 | diff-context-mid-hunk-header-re nil t) | 1069 | diff-context-mid-hunk-header-re nil t) |
| @@ -1131,7 +1133,7 @@ With a prefix argument, convert unified format to context format." | |||
| 1131 | "Reverse the direction of the diffs. | 1133 | "Reverse the direction of the diffs. |
| 1132 | START and END are either taken from the region (if a prefix arg is given) or | 1134 | START and END are either taken from the region (if a prefix arg is given) or |
| 1133 | else cover the whole buffer." | 1135 | else cover the whole buffer." |
| 1134 | (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) | 1136 | (interactive (if (or current-prefix-arg (use-region-p)) |
| 1135 | (list (region-beginning) (region-end)) | 1137 | (list (region-beginning) (region-end)) |
| 1136 | (list (point-min) (point-max)))) | 1138 | (list (point-min) (point-max)))) |
| 1137 | (unless (markerp end) (setq end (copy-marker end t))) | 1139 | (unless (markerp end) (setq end (copy-marker end t))) |
| @@ -1197,7 +1199,7 @@ else cover the whole buffer." | |||
| 1197 | "Fixup the hunk headers (in case the buffer was modified). | 1199 | "Fixup the hunk headers (in case the buffer was modified). |
| 1198 | START and END are either taken from the region (if a prefix arg is given) or | 1200 | START and END are either taken from the region (if a prefix arg is given) or |
| 1199 | else cover the whole buffer." | 1201 | else cover the whole buffer." |
| 1200 | (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) | 1202 | (interactive (if (or current-prefix-arg (use-region-p)) |
| 1201 | (list (region-beginning) (region-end)) | 1203 | (list (region-beginning) (region-end)) |
| 1202 | (list (point-min) (point-max)))) | 1204 | (list (point-min) (point-max)))) |
| 1203 | (let ((inhibit-read-only t)) | 1205 | (let ((inhibit-read-only t)) |
diff --git a/test/indent/shell.sh b/test/indent/shell.sh index 957fe74fdee..895a9325b7e 100755 --- a/test/indent/shell.sh +++ b/test/indent/shell.sh | |||
| @@ -26,7 +26,10 @@ foo () { | |||
| 26 | 26 | ||
| 27 | case $toto in | 27 | case $toto in |
| 28 | a) echo 1;; b) echo 2;; | 28 | a) echo 1;; b) echo 2;; |
| 29 | c) echo 3;; | 29 | (c) |
| 30 | echo 3;; | ||
| 31 | d) | ||
| 32 | echo 3;; | ||
| 30 | esac | 33 | esac |
| 31 | 34 | ||
| 32 | case $as_nl`(ac_space=' '; set) 2>&1` in #( | 35 | case $as_nl`(ac_space=' '; set) 2>&1` in #( |