From 2daf4bc6670f7a8004cf25c367888102190b4214 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 20 Oct 2007 01:52:22 +0000 Subject: [PATCH] (smerge-auto-refine): New var. (smerge-next, smerge-prev): Use it. (smerge-batch-resolve): Ad-hoc trick for Arch's .rej files. --- lisp/ChangeLog | 4 ++++ lisp/smerge-mode.el | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a9cf6c9078b..1bfb518f40f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2007-10-20 Stefan Monnier + * smerge-mode.el (smerge-auto-refine): New var. + (smerge-next, smerge-prev): Use it. + (smerge-batch-resolve): Ad-hoc trick for Arch's .rej files. + * emacs-lisp/easy-mmode.el (easy-mmode-define-navigation): Add `body' arg. Cleanup the check-narrow-maybe/re-narrow-maybe mess. diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el index a33d21925b7..16693f8a5e3 100644 --- a/lisp/smerge-mode.el +++ b/lisp/smerge-mode.el @@ -79,6 +79,10 @@ Used in `smerge-diff-base-mine' and related functions." :group 'smerge :type 'boolean) +(defcustom smerge-auto-refine t + "Automatically highlight changes in detail as the user visits conflicts." + :type 'boolean) + (defface smerge-mine '((((min-colors 88) (background light)) (:foreground "blue1")) @@ -252,7 +256,9 @@ Can be nil if the style is undecided, or else: ;;;; ;; Define smerge-next and smerge-prev -(easy-mmode-define-navigation smerge smerge-begin-re "conflict") +(easy-mmode-define-navigation smerge smerge-begin-re "conflict" nil nil + (if smerge-auto-refine + (condition-case nil (smerge-refine) (error nil)))) (defconst smerge-match-names ["conflict" "mine" "base" "other"]) @@ -433,6 +439,12 @@ some major modes. Uses `smerge-resolve-function' to do the actual work." (error "`smerge-batch-resolve' is to be used only with -batch")) (while command-line-args-left (let ((file (pop command-line-args-left))) + (if (string-match "\\.rej\\'" file) + ;; .rej files should never contain diff3 markers, on the other hand, + ;; in Arch, .rej files are sometimes used to indicate that the + ;; main file has diff3 markers. So you can pass **/*.rej and + ;; it will DTRT. + (setq file (substring file 0 (match-beginning 0)))) (message "Resolving conflicts in %s..." file) (when (file-readable-p file) (with-current-buffer (find-file-noselect file) -- 2.39.2