X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/fbf349734468d48b421c3d03074bb66dfcf3115b..93afd0f1d463bec0fc8d3127c1d34ccaa4dbe99b:/lisp/smerge-mode.el diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el index 4b677edc36..bda569a1e0 100644 --- a/lisp/smerge-mode.el +++ b/lisp/smerge-mode.el @@ -1,10 +1,10 @@ ;;; smerge-mode.el --- Minor mode to resolve diff3 conflicts ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, -;; 2004, 2005 Free Software Foundation, Inc. +;; 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -;; Author: Stefan Monnier -;; Keywords: revision-control merge diff3 cvs conflict +;; Author: Stefan Monnier +;; Keywords: tools revision-control merge diff3 cvs conflict ;; This file is part of GNU Emacs. @@ -335,7 +335,17 @@ according to `smerge-match-conflict'.") (defun smerge-remove-props (beg end) (remove-overlays beg end 'smerge 'refine) - (remove-overlays beg end 'smerge 'conflict)) + (remove-overlays beg end 'smerge 'conflict) + ;; Now that we use overlays rather than text-properties, this function + ;; does not cause refontification any more. It can be seen very clearly + ;; in buffers where jit-lock-contextually is not t, in which case deleting + ;; the "<<<<<<< foobar" leading line leaves the rest of the conflict + ;; highlighted as if it were still a valid conflict. Note that in many + ;; important cases (such as the previous example) we're actually called + ;; 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) + (remove-text-properties beg end '(fontified nil))) (defun smerge-popup-context-menu (event) "Pop up the Smerge mode context menu under mouse." @@ -372,7 +382,7 @@ This relies on mode-specific knowledge and thus only works in some major modes. Uses `smerge-resolve-function' to do the actual work." (interactive) (smerge-match-conflict) - (smerge-remove-props) + (smerge-remove-props (match-beginning 0) (match-end 0)) (cond ;; Trivial diff3 -A non-conflicts. ((and (eq (match-end 1) (match-end 3))