emacs-devel
[Top][All Lists]
Advanced

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

Re: Should invisible imply intangible?


From: David Kastrup
Subject: Re: Should invisible imply intangible?
Date: 16 Mar 2002 03:16:49 +0100

"Stefan Monnier" <monnier+gnu/address@hidden> writes:

> I believe that the behavior should again depend on the insertion-type
> of the overlay's boundary.  If point is just at the beginning of an
> overlay with a before-string and inserting a char will move the
> overlay's boundary, then the cursor should be displayed before
> the before-string.
> This was recently brought up when discussing code that adds a "ΒΆ" at
> end of paragraphs (using a before-string property): the current code
> always displays the cursor just after this string, which looks very odd
> since typed text will be inserted before the string.

You are going to make one mess out of my preview-latex package.  One
problem with making this depend on the insertion properties of overlay
markers is that it is not possible to change them once the overlay is
created.

Take preview-latex (illustration at the screen shot in
<URL:http://preview-latex.sourceforge.net>): if an overlay is opened
and I place the cursor at its beginning, it is after the before-string
carrying the "head" icon.  Inserting text here naturally inserts into
the overlay.  If the overlay is closed, it is replaced by the typeset
rendition of the text inside (by virtue of the display property, not
the before-string).  Inserting text when the cursor is on the start of
the overlay naturally inserts before the overlay.

How do I cope?  I cannot change the insertion type of those markers,
and if I did, undo would probably stop working (unless undo events
were invented that could record the change of a marker type).  So I
cope by always using non-moving markers, and if someone inserts text
in front of my overlay, I catch this with the insert-in-front-hook of
the overlay and move the overlay start by hand.  Unless
undo-in-progress is set, because an insertion carried out due to an
undo will already cope with the marker.

Hm.  Actually, it seems like the proposed change making the side on
which the cursor gets displayed depend on the insertion type of the
marker would not change the behavior of my code.  I luck out.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: address@hidden



reply via email to

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