Mercurial > emacs
comparison lisp/smerge-mode.el @ 91059:12589730c028
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 901)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-273
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sat, 20 Oct 2007 02:30:26 +0000 |
parents | 4b09bb044f38 |
children | 4bc33ffdda1a |
comparison
equal
deleted
inserted
replaced
91058:4b09bb044f38 | 91059:12589730c028 |
---|---|
75 :type '(repeat string)) | 75 :type '(repeat string)) |
76 | 76 |
77 (defcustom smerge-auto-leave t | 77 (defcustom smerge-auto-leave t |
78 "Non-nil means to leave `smerge-mode' when the last conflict is resolved." | 78 "Non-nil means to leave `smerge-mode' when the last conflict is resolved." |
79 :group 'smerge | 79 :group 'smerge |
80 :type 'boolean) | |
81 | |
82 (defcustom smerge-auto-refine t | |
83 "Automatically highlight changes in detail as the user visits conflicts." | |
80 :type 'boolean) | 84 :type 'boolean) |
81 | 85 |
82 (defface smerge-mine | 86 (defface smerge-mine |
83 '((((min-colors 88) (background light)) | 87 '((((min-colors 88) (background light)) |
84 (:foreground "blue1")) | 88 (:foreground "blue1")) |
250 ;;;; | 254 ;;;; |
251 ;;;; Actual code | 255 ;;;; Actual code |
252 ;;;; | 256 ;;;; |
253 | 257 |
254 ;; Define smerge-next and smerge-prev | 258 ;; Define smerge-next and smerge-prev |
255 (easy-mmode-define-navigation smerge smerge-begin-re "conflict") | 259 (easy-mmode-define-navigation smerge smerge-begin-re "conflict" nil nil |
260 (if smerge-auto-refine | |
261 (condition-case nil (smerge-refine) (error nil)))) | |
256 | 262 |
257 (defconst smerge-match-names ["conflict" "mine" "base" "other"]) | 263 (defconst smerge-match-names ["conflict" "mine" "base" "other"]) |
258 | 264 |
259 (defun smerge-ensure-match (n) | 265 (defun smerge-ensure-match (n) |
260 (unless (match-end n) | 266 (unless (match-end n) |
431 ;; command-line-args-left is what is left of the command line. | 437 ;; command-line-args-left is what is left of the command line. |
432 (if (not noninteractive) | 438 (if (not noninteractive) |
433 (error "`smerge-batch-resolve' is to be used only with -batch")) | 439 (error "`smerge-batch-resolve' is to be used only with -batch")) |
434 (while command-line-args-left | 440 (while command-line-args-left |
435 (let ((file (pop command-line-args-left))) | 441 (let ((file (pop command-line-args-left))) |
442 (if (string-match "\\.rej\\'" file) | |
443 ;; .rej files should never contain diff3 markers, on the other hand, | |
444 ;; in Arch, .rej files are sometimes used to indicate that the | |
445 ;; main file has diff3 markers. So you can pass **/*.rej and | |
446 ;; it will DTRT. | |
447 (setq file (substring file 0 (match-beginning 0)))) | |
436 (message "Resolving conflicts in %s..." file) | 448 (message "Resolving conflicts in %s..." file) |
437 (when (file-readable-p file) | 449 (when (file-readable-p file) |
438 (with-current-buffer (find-file-noselect file) | 450 (with-current-buffer (find-file-noselect file) |
439 (smerge-resolve-all) | 451 (smerge-resolve-all) |
440 (save-buffer) | 452 (save-buffer) |