+2014-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * vc/smerge-mode.el (smerge-swap): New command.
+
+ * vc/diff-mode.el (diff-kill-applied-hunks): New command.
+
2014-12-01 Ulf Jasper <ulf.jasper@web.de>
- * net/newst-treeview.el (newsticker--treeview-item-show): Check
- window liveliness before measuring its width.
+ * net/newst-treeview.el (newsticker--treeview-item-show):
+ Check window liveliness before measuring its width.
* net/newst-backend.el (newsticker--get-news-by-url-callback):
Pass correct status to `newsticker--sentinel-work'.
* vc/vc.el, vc/vc-cvs.el, vc/vc-rcs.el, vc/vc-svn.el: The 'merge'
backend method of RCS/CVS/SVN is now 'merge-file', to contrast with
- 'merge-branch'. Prompting for merge revisions is pushed down to
+ 'merge-branch'. Prompting for merge revisions is pushed down to
the back ends; this fixes a layering violation that caused bad
behavior with SVN.
* vc/vc.el, vc-hooks.el, and all backends: API simplification;
vc-stay-local-p and repository-hostname are no longer public
- methods. Only the CVS and SVN backends used these, and the SVN
+ methods. Only the CVS and SVN backends used these, and the SVN
support was conditioned out because svn status -v is too slow.
The CVS back end retains this machibery and the vc-stay-local
configuration variable now only affects it.
(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)
(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)