bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#9642: move-overlay creates an empty overlay with the evaporate prope


From: Eli Zaretskii
Subject: bug#9642: move-overlay creates an empty overlay with the evaporate property
Date: Mon, 03 Oct 2011 01:36:11 -0400

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Sun, 02 Oct 2011 23:15:56 -0400
> Cc: 9642@debbugs.gnu.org
> 
> >> In a nonempty buffer, the following:
> >> (let ((o (make-overlay 1 2)))
> >> (overlay-put o 'evaporate t)
> >> (move-overlay o 0 1))
> 
> >> returns an empty overlay that has the evaporate property.
> >> But this is not supposed to happen: when an overlay with that
> >> property becomes empty, it's supposed to be deleted.
> 
> > OTOH if the user goes through the trouble to do the above, he probably
> > doesn't want this overlay to disappear right away.  So I'm not sure we
> > want to second guess the user here.
> 
> I see I was confused: I didn't realize that your example's use of
> out-of-bounds position was important, and I thought your change also
> affected (move-overlay OL A A).  So, I now think your patch is
> perfectly fine, thank you.

If we are going to support this misbehavior (the fact that BEG can be
zero or negative), please add comments in the code to that effect, and
maybe also document it in the doc string.  Without comments, the
intent of the "tricksy" code with Fset_marker is entirely unclear.

FWIW, I think clipping of positions inside set-marker is for the case
of narrowed buffer, not for being able to handle positions outside the
valid range of values.  But I guess I will be ignored.




reply via email to

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