]> git.eshelyaron.com Git - emacs.git/commitdiff
Ediff's overlay priorities cause more trouble than they solve.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 10 Apr 2014 19:15:01 +0000 (15:15 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 10 Apr 2014 19:15:01 +0000 (15:15 -0400)
* lisp/vc/ediff-init.el (ediff-shadow-overlay-priority): Remove variable.
(ediff-highest-priority): Remove function.
* lisp/vc/ediff-util.el (ediff-highlight-diff-in-one-buffer):
* lisp/vc/ediff-diff.el (ediff-set-diff-overlays-in-one-buffer)
(ediff-set-fine-diff-properties-in-one-buffer): Don't mess with
overlay priorities.

Fixes: debbugs:17234
lisp/ChangeLog
lisp/vc/ediff-diff.el
lisp/vc/ediff-init.el
lisp/vc/ediff-util.el

index ad27e2fc8b4212b1590a1eef1091aeaf0ef4c702..c3721febc1a669995e69cc2acd355f13dfaae91b 100644 (file)
@@ -1,3 +1,13 @@
+2014-04-10  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       Ediff's overlay priorities cause more trouble than they solve.
+       * vc/ediff-init.el (ediff-shadow-overlay-priority): Remove variable.
+       (ediff-highest-priority): Remove function (bug#17234).
+       * vc/ediff-util.el (ediff-highlight-diff-in-one-buffer):
+       * vc/ediff-diff.el (ediff-set-diff-overlays-in-one-buffer)
+       (ediff-set-fine-diff-properties-in-one-buffer): Don't mess with
+       overlay priorities.
+
 2014-04-10  Feng Li  <fengli@gmail.com>  (tiny change)
 
        * progmodes/pascal.el (pascal-font-lock-keywords): Fix incorrect format
index 96e8acca29442b4a3931dc2f5f8c3ce8158c1117..f429eb35d70ff24db9fce3f2f4e2f02742d53f6b 100644 (file)
@@ -587,7 +587,6 @@ one optional arguments, diff-number to refine.")
            (setq pt-saved (ediff-with-current-buffer buff (point)))))
       (setq overlay (ediff-make-bullet-proof-overlay begin end buff))
 
-      (ediff-overlay-put overlay 'priority ediff-shadow-overlay-priority)
       (ediff-overlay-put overlay 'ediff-diff-num current-diff)
       (if (and (ediff-has-face-support-p)
               ediff-use-faces ediff-highlight-all-diffs)
@@ -822,20 +821,9 @@ one optional arguments, diff-number to refine.")
                  'default
                (ediff-get-symbol-from-alist
                 buf-type ediff-fine-diff-face-alist)
-               ))
-       (priority (if default
-                     0
-                   (1+ (or (ediff-overlay-get
-                            (symbol-value
-                             (ediff-get-symbol-from-alist
-                              buf-type
-                              ediff-current-diff-overlay-alist))
-                            'priority)
-                           0)))))
-    (mapcar (lambda (overl)
-             (ediff-set-overlay-face overl face)
-             (ediff-overlay-put overl 'priority priority))
-           fine-diff-vector)))
+               )))
+    (dolist (overl fine-diff-vector)
+      (ediff-set-overlay-face overl face))))
 
 ;; Set overlays over the regions that denote delimiters
 (defun ediff-set-fine-overlays-for-combined-merge (diff-list reg-num)
index 000fdb916e39f98111ac6cafc1045176e62fe7ca..f3781c5388535681d8a25c18589d25d171dea0d0 100644 (file)
@@ -707,9 +707,6 @@ shown in brighter colors."
 ;; List of difference overlays disturbed by working with the current diff.
 (defvar ediff-disturbed-overlays nil "")
 
-;; Priority of non-selected overlays.
-(defvar ediff-shadow-overlay-priority  100 "")
-
 (defcustom ediff-version-control-package 'vc
   "Version control package used.
 Currently, Ediff supports vc.el, rcs.el, pcl-cvs.el, and generic-sc.el.  The
@@ -1329,34 +1326,6 @@ this variable represents.")
 (ediff-defvar-local ediff-current-diff-overlay-Ancestor nil
   "Overlay for the current difference region in the ancestor buffer.")
 
-;; Compute priority of a current ediff overlay.
-(defun ediff-highest-priority (start end buffer)
-  (let ((pos (max 1 (1- start)))
-       ovr-list)
-    (if (featurep 'xemacs)
-       (1+ ediff-shadow-overlay-priority)
-      (ediff-with-current-buffer buffer
-       (while (< pos (min (point-max) (1+ end)))
-         (setq ovr-list (append (overlays-at pos) ovr-list))
-         (setq pos (next-overlay-change pos)))
-       (+ 1 ediff-shadow-overlay-priority
-          (apply 'max
-                 (cons
-                  1
-                  (mapcar
-                   (lambda (ovr)
-                     (if (and ovr
-                              ;; exclude ediff overlays from priority
-                              ;; calculation, or else priority will keep
-                              ;; increasing
-                              (null (ediff-overlay-get ovr 'ediff))
-                              (null (ediff-overlay-get ovr 'ediff-diff-num)))
-                         ;; use the overlay priority or 0
-                         (or (ediff-overlay-get ovr 'priority) 0)
-                       0))
-                   ovr-list))))))))
-
-
 (defvar ediff-toggle-read-only-function 'toggle-read-only
   "Function to be used to toggle read-only status of the buffer.
 If nil, Ediff tries using the command bound to C-x C-q.")
index 127e6b2cfc056a8a6ef21be52bddc4545aeff718..649ef8840596467fc0fd8407dcef1c4ee7d508f9 100644 (file)
@@ -3023,8 +3023,6 @@ Hit \\[ediff-recenter] to reset the windows afterward."
        (if (featurep 'xemacs)
            (ediff-move-overlay current-diff-overlay begin end-hilit)
          (ediff-move-overlay current-diff-overlay begin end-hilit buff))
-       (ediff-overlay-put current-diff-overlay 'priority
-                          (ediff-highest-priority begin end-hilit buff))
        (ediff-overlay-put current-diff-overlay 'ediff-diff-num n)
 
        ;; unhighlight the background overlay for diff n so it won't