summaryrefslogtreecommitdiff
path: root/lisp/vc/smerge-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/smerge-mode.el
parent581914e45fbc08b020aa0aeb6a2967f4e77ee484 (diff)
downloademacs-8dac9c34d8a2575d44fc78824ec77a58b63701b6.tar.gz
emacs-8dac9c34d8a2575d44fc78824ec77a58b63701b6.tar.bz2
emacs-8dac9c34d8a2575d44fc78824ec77a58b63701b6.zip
* 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/smerge-mode.el')
-rw-r--r--lisp/vc/smerge-mode.el13
1 files changed, 13 insertions, 0 deletions
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."
(unless smerge-use-changed-face
'((smerge . refine) (face . smerge-refined-added))))))
+(defun smerge-swap ()
+ "Swap the \"Mine\" and the \"Other\" chunks.
+Can be used before things like `smerge-keep-all' or `smerge-resolve' where the
+ordering can have some subtle influence on the result, such as preferring the
+spacing of the \"Other\" chunk."
+ (interactive)
+ (smerge-match-conflict)
+ (goto-char (match-beginning 3))
+ (let ((txt3 (delete-and-extract-region (point) (match-end 3))))
+ (insert (delete-and-extract-region (match-beginning 1) (match-end 1)))
+ (goto-char (match-beginning 1))
+ (insert txt3)))
+
(defun smerge-diff (n1 n2)
(smerge-match-conflict)
(smerge-ensure-match n1)