summaryrefslogtreecommitdiff
path: root/lisp/vc/diff-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-12-01 13:12:37 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2014-12-01 13:16:53 -0500
commit8dac9c34d8a2575d44fc78824ec77a58b63701b6 (patch)
tree686ef547d4a08c214991ca564dd7d281b8f9e1aa /lisp/vc/diff-mode.el
parent581914e45fbc08b020aa0aeb6a2967f4e77ee484 (diff)
downloademacs-8dac9c34d8a2575d44fc78824ec77a58b63701b6.tar.gz
* lisp/vc/diff-mode.el (diff-kill-applied-hunks): New command.
* lisp/vc/smerge-mode.el (smerge-swap): New command.
Diffstat (limited to 'lisp/vc/diff-mode.el')
-rw-r--r--lisp/vc/diff-mode.el10
1 files changed, 10 insertions, 0 deletions
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."
(diff-hunk-status-msg line-offset (diff-xor reverse switched) t)))
+(defun diff-kill-applied-hunks ()
+ "Kill all hunks that have already been applied starting at point."
+ (interactive)
+ (while (not (eobp))
+ (pcase-let ((`(,buf ,line-offset ,pos ,src ,_dst ,switched)
+ (diff-find-source-location nil nil)))
+ (if (and line-offset switched)
+ (diff-hunk-kill)
+ (diff-hunk-next)))))
+
(defalias 'diff-mouse-goto-source 'diff-goto-source)
(defun diff-goto-source (&optional other-file event)