unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17234: 24.3.50; overlay priority : cons cells make an error in ediff
@ 2014-04-10  9:36 Nicolas Richard
  2014-04-10 19:17 ` Stefan Monnier
  2014-04-11  0:56 ` Glenn Morris
  0 siblings, 2 replies; 13+ messages in thread
From: Nicolas Richard @ 2014-04-10  9:36 UTC (permalink / raw)
  To: 17234

Steps to reproduce from -Q :
M-x ediff-regions-wordwise RET
RET ; selects scratch buf
RET ; ditto
C-SPC C-n C-M-c ; select first line of scratch buffer
C-n C-SPC C-n C-M-c ; select second line of scratch buffer
n ; go to next difference

That makes an error
> Wrong type argument: number-or-marker-p, (nil . 100)
in function ediff-highest-priority, which comes from commit
> cdb3fff3f588caeed50cbb5b64c09bce0a0b31e3
> Author: Stefan Monnier <monnier@iro.umontreal.ca>
> Date:   Sun Mar 23 18:30:47 2014 -0400

>     * lisp/simple.el (redisplay-highlight-region-function): Increase priority of
>     overlay to make sure boundaries are visible.
>     * src/buffer.c (struct sortvec): Add field `spriority'.
>     (compare_overlays): Use it.
>     (sort_overlays): Set it.
where the notion of the "priority" of an overlay was changed : it can
now be a cons cell (which holds a priority and a secondary priority).
The changelog mentions bug#15899 but I saw nothing in that (very long)
thread mentionning the fix.

At (info "(elisp) Overlay Properties") however it is said that the
priority "should be a non-negative integer".

Also, and that's where the error comes from, ediff-init.el relies on the
priority being either nil or an integer, in function
ediff-highest-priority. For this I can suggest a fix (see patch below)
but I don't know what lispref should say about the change.

In GNU Emacs 24.3.50.6 (i686-pc-linux-gnu, GTK+ Version 2.24.20)
 of 2014-04-09 on LDLC-portable

	Modified   lisp/ChangeLog
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 54ac144..3ed0195 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-04-10  Nicolas Richard  <theonewiththeevillook@yahoo.fr>
+
+	* vc/ediff-init.el (ediff-highest-priority): Don't make an error
+	if overlay priority is a cons.
+
 2014-04-09  Dmitry Gutov  <dgutov@yandex.ru>
 
 	* progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight more
	Modified   lisp/vc/ediff-init.el
diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el
index 000fdb9..110dc63 100644
--- a/lisp/vc/ediff-init.el
+++ b/lisp/vc/ediff-init.el
@@ -1352,7 +1352,12 @@ this variable represents.")
 			       (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)
+			  (let ((priority (ediff-overlay-get ovr 'priority)))
+                            (cond ((integerp priority)
+                                   priority)
+                                  ((consp priority)
+                                   (or (car priority) (cdr priority)))
+                                  (t 0)))
 			0))
 		    ovr-list))))))))
 
-- 
Nico.





^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-04-21 13:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-10  9:36 bug#17234: 24.3.50; overlay priority : cons cells make an error in ediff Nicolas Richard
2014-04-10 19:17 ` Stefan Monnier
2014-04-11  0:56 ` Glenn Morris
2014-04-11 12:30   ` Stefan Monnier
2014-04-11 13:08     ` Eli Zaretskii
2014-04-11 15:56       ` Stefan Monnier
2014-04-11 16:31         ` Glenn Morris
2014-04-11 20:06           ` Stefan Monnier
2014-04-11 20:22             ` Glenn Morris
2014-04-15 16:55               ` Stefan Monnier
2014-04-11 17:12         ` Eli Zaretskii
2014-04-11 20:07           ` Stefan Monnier
2014-04-21 13:47             ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).