;;; smerge-mode.el --- Minor mode to resolve diff3 conflicts
;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-;; 2007, 2008 Free Software Foundation, Inc.
+;; 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: tools revision-control merge diff3 cvs conflict
;;; Code:
-(eval-when-compile (require 'cl) (require 'diff-mode))
+(eval-when-compile (require 'cl))
+(require 'diff-mode) ;For diff-auto-refine-mode.
;;; The real definition comes later.
(:foreground "cyan")))
"Face for your code."
:group 'smerge)
-;; backward-compatibility alias
-(put 'smerge-mine-face 'face-alias 'smerge-mine)
+(define-obsolete-face-alias 'smerge-mine-face 'smerge-mine "22.1")
(defvar smerge-mine-face 'smerge-mine)
(defface smerge-other
(:foreground "lightgreen")))
"Face for the other code."
:group 'smerge)
-;; backward-compatibility alias
-(put 'smerge-other-face 'face-alias 'smerge-other)
+(define-obsolete-face-alias 'smerge-other-face 'smerge-other "22.1")
(defvar smerge-other-face 'smerge-other)
(defface smerge-base
(:foreground "orange")))
"Face for the base code."
:group 'smerge)
-;; backward-compatibility alias
-(put 'smerge-base-face 'face-alias 'smerge-base)
+(define-obsolete-face-alias 'smerge-base-face 'smerge-base "22.1")
(defvar smerge-base-face 'smerge-base)
(defface smerge-markers
(:background "grey30")))
"Face for the conflict markers."
:group 'smerge)
-;; backward-compatibility alias
-(put 'smerge-markers-face 'face-alias 'smerge-markers)
+(define-obsolete-face-alias 'smerge-markers-face 'smerge-markers "22.1")
(defvar smerge-markers-face 'smerge-markers)
(defface smerge-refined-change
;; during font-locking so inhibit-modification-hooks is non-nil, so we
;; can't just modify the buffer and expect font-lock to be triggered as in:
;; (put-text-property beg end 'smerge-force-highlighting nil)
- (let ((modified (buffer-modified-p)))
- (remove-text-properties beg end '(fontified nil))
- (restore-buffer-modified-p modified)))
+ (with-silent-modifications
+ (remove-text-properties beg end '(fontified nil))))
(defun smerge-popup-context-menu (event)
"Pop up the Smerge mode context menu under mouse."
((save-excursion
(goto-char mine-start)
(re-search-forward smerge-begin-re end t))
- ;; There's a nested conflict and we're after the the beginning
+ ;; There's a nested conflict and we're after the beginning
;; of the outer one but before the beginning of the inner one.
;; Of course, maybe this is not a nested conflict but in that
;; case it can only be something nastier that we don't know how
(n2 (if (eq part 3) 2 3)))
(smerge-ensure-match n1)
(smerge-ensure-match n2)
- (put-text-property (match-beginning 0) (1+ (match-beginning 0))
- 'smerge-refine-part
- (cons (buffer-chars-modified-tick) part))
+ (with-silent-modifications
+ (put-text-property (match-beginning 0) (1+ (match-beginning 0))
+ 'smerge-refine-part
+ (cons (buffer-chars-modified-tick) part)))
(smerge-refine-subst (match-beginning n1) (match-end n1)
(match-beginning n2) (match-end n2)
'((smerge . refine)
(defun smerge-start-session ()
"Turn on `smerge-mode' and move point to first conflict marker.
If no conflict maker is found, turn off `smerge-mode'."
+ (interactive)
(smerge-mode 1)
(condition-case nil
(unless (looking-at smerge-begin-re)