aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2014-12-01 13:12:37 -0500
committerStefan Monnier2014-12-01 13:16:53 -0500
commit8dac9c34d8a2575d44fc78824ec77a58b63701b6 (patch)
tree686ef547d4a08c214991ca564dd7d281b8f9e1aa
parent581914e45fbc08b020aa0aeb6a2967f4e77ee484 (diff)
downloademacs-8dac9c34d8a2575d44fc78824ec77a58b63701b6.tar.gz
emacs-8dac9c34d8a2575d44fc78824ec77a58b63701b6.zip
* lisp/vc/diff-mode.el (diff-kill-applied-hunks): New command.
* lisp/vc/smerge-mode.el (smerge-swap): New command.
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/vc/diff-mode.el10
-rw-r--r--lisp/vc/smerge-mode.el13
3 files changed, 33 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9f233cdaadf..ec95af9441f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,13 @@
12014-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * vc/smerge-mode.el (smerge-swap): New command.
4
5 * vc/diff-mode.el (diff-kill-applied-hunks): New command.
6
12014-12-01 Ulf Jasper <ulf.jasper@web.de> 72014-12-01 Ulf Jasper <ulf.jasper@web.de>
2 8
3 * net/newst-treeview.el (newsticker--treeview-item-show): Check 9 * net/newst-treeview.el (newsticker--treeview-item-show):
4 window liveliness before measuring its width. 10 Check window liveliness before measuring its width.
5 11
6 * net/newst-backend.el (newsticker--get-news-by-url-callback): 12 * net/newst-backend.el (newsticker--get-news-by-url-callback):
7 Pass correct status to `newsticker--sentinel-work'. 13 Pass correct status to `newsticker--sentinel-work'.
@@ -25,13 +31,13 @@
25 31
26 * vc/vc.el, vc/vc-cvs.el, vc/vc-rcs.el, vc/vc-svn.el: The 'merge' 32 * vc/vc.el, vc/vc-cvs.el, vc/vc-rcs.el, vc/vc-svn.el: The 'merge'
27 backend method of RCS/CVS/SVN is now 'merge-file', to contrast with 33 backend method of RCS/CVS/SVN is now 'merge-file', to contrast with
28 'merge-branch'. Prompting for merge revisions is pushed down to 34 'merge-branch'. Prompting for merge revisions is pushed down to
29 the back ends; this fixes a layering violation that caused bad 35 the back ends; this fixes a layering violation that caused bad
30 behavior with SVN. 36 behavior with SVN.
31 37
32 * vc/vc.el, vc-hooks.el, and all backends: API simplification; 38 * vc/vc.el, vc-hooks.el, and all backends: API simplification;
33 vc-stay-local-p and repository-hostname are no longer public 39 vc-stay-local-p and repository-hostname are no longer public
34 methods. Only the CVS and SVN backends used these, and the SVN 40 methods. Only the CVS and SVN backends used these, and the SVN
35 support was conditioned out because svn status -v is too slow. 41 support was conditioned out because svn status -v is too slow.
36 The CVS back end retains this machibery and the vc-stay-local 42 The CVS back end retains this machibery and the vc-stay-local
37 configuration variable now only affects it. 43 configuration variable now only affects it.
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 9afb9f47e91..f3455efb294 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -1817,6 +1817,16 @@ With a prefix argument, try to REVERSE the hunk."
1817 (diff-hunk-status-msg line-offset (diff-xor reverse switched) t))) 1817 (diff-hunk-status-msg line-offset (diff-xor reverse switched) t)))
1818 1818
1819 1819
1820(defun diff-kill-applied-hunks ()
1821 "Kill all hunks that have already been applied starting at point."
1822 (interactive)
1823 (while (not (eobp))
1824 (pcase-let ((`(,buf ,line-offset ,pos ,src ,_dst ,switched)
1825 (diff-find-source-location nil nil)))
1826 (if (and line-offset switched)
1827 (diff-hunk-kill)
1828 (diff-hunk-next)))))
1829
1820(defalias 'diff-mouse-goto-source 'diff-goto-source) 1830(defalias 'diff-mouse-goto-source 'diff-goto-source)
1821 1831
1822(defun diff-goto-source (&optional other-file event) 1832(defun diff-goto-source (&optional other-file event)
diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el
index 771281555ab..0b7b70219c0 100644
--- a/lisp/vc/smerge-mode.el
+++ b/lisp/vc/smerge-mode.el
@@ -1132,6 +1132,19 @@ repeating the command will highlight other two parts."
1132 (unless smerge-use-changed-face 1132 (unless smerge-use-changed-face
1133 '((smerge . refine) (face . smerge-refined-added)))))) 1133 '((smerge . refine) (face . smerge-refined-added))))))
1134 1134
1135(defun smerge-swap ()
1136 "Swap the \"Mine\" and the \"Other\" chunks.
1137Can be used before things like `smerge-keep-all' or `smerge-resolve' where the
1138ordering can have some subtle influence on the result, such as preferring the
1139spacing of the \"Other\" chunk."
1140 (interactive)
1141 (smerge-match-conflict)
1142 (goto-char (match-beginning 3))
1143 (let ((txt3 (delete-and-extract-region (point) (match-end 3))))
1144 (insert (delete-and-extract-region (match-beginning 1) (match-end 1)))
1145 (goto-char (match-beginning 1))
1146 (insert txt3)))
1147
1135(defun smerge-diff (n1 n2) 1148(defun smerge-diff (n1 n2)
1136 (smerge-match-conflict) 1149 (smerge-match-conflict)
1137 (smerge-ensure-match n1) 1150 (smerge-ensure-match n1)