emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r116934: Ediff's overlay priorities cause more tr


From: Stefan Monnier
Subject: [Emacs-diffs] emacs-24 r116934: Ediff's overlay priorities cause more trouble than they solve.
Date: Thu, 10 Apr 2014 19:15:08 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116934
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17234
committer: Stefan Monnier <address@hidden>
branch nick: emacs-24
timestamp: Thu 2014-04-10 15:15:01 -0400
message:
  Ediff's overlay priorities cause more trouble than they solve.
  * 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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/vc/ediff-diff.el          
ediffdiff.el-20091113204419-o5vbwnq5f7feedwu-845
  lisp/vc/ediff-init.el          
ediffinit.el-20091113204419-o5vbwnq5f7feedwu-846
  lisp/vc/ediff-util.el          
ediffutil.el-20091113204419-o5vbwnq5f7feedwu-848
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-04-10 13:56:28 +0000
+++ b/lisp/ChangeLog    2014-04-10 19:15:01 +0000
@@ -1,3 +1,13 @@
+2014-04-10  Stefan Monnier  <address@hidden>
+
+       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  <address@hidden>  (tiny change)
 
        * progmodes/pascal.el (pascal-font-lock-keywords): Fix incorrect format

=== modified file 'lisp/vc/ediff-diff.el'
--- a/lisp/vc/ediff-diff.el     2014-01-01 07:43:34 +0000
+++ b/lisp/vc/ediff-diff.el     2014-04-10 19:15:01 +0000
@@ -587,7 +587,6 @@
            (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 @@
                  '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)

=== modified file 'lisp/vc/ediff-init.el'
--- a/lisp/vc/ediff-init.el     2014-02-16 03:09:27 +0000
+++ b/lisp/vc/ediff-init.el     2014-04-10 19:15:01 +0000
@@ -707,9 +707,6 @@
 ;; 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 @@
 (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.")

=== modified file 'lisp/vc/ediff-util.el'
--- a/lisp/vc/ediff-util.el     2014-01-01 07:43:34 +0000
+++ b/lisp/vc/ediff-util.el     2014-04-10 19:15:01 +0000
@@ -3023,8 +3023,6 @@
        (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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]