emacs-devel
[Top][All Lists]
Advanced

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

Re: Cursor positioning with `after-string' overlays


From: Eli Zaretskii
Subject: Re: Cursor positioning with `after-string' overlays
Date: Sat, 03 Apr 2010 13:28:44 +0300

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Fri, 02 Apr 2010 14:17:31 -0400
> 
> >> But depending on the insertion-type of the end marker of your overlay,
> >> text inserted "at point" will be inserted (visually) between the o and
> >> the - rather than between the - and the b, so while this choice would
> >> sometimes be correct, it's sometimes incorrect.
> 
> > Sorry, I don't understand the specific situation.  In my example, when
> > the cursor is on `b', insertion happens between `-' and `b', which is
> > visually correct.  Can you modify my example to create the situation
> > you are describing?  Then I could try to reason about it and perhaps
> > modify the code if necessary.
> 
> Try:
> 
>     (let ((pos (goto-char (point-max))))
>       (insert "foobar")
>       (overlay-put
>       (make-overlay (+ pos 2) (+ pos 3) nil nil t)
>       'after-string (propertize "-" 'cursor t)))
> 
> (i.e. I added "nil nil t" to the call to make-overlay).

Yes, I see the issue now.  However, the old redisplay has a similar
problem when the additional arguments to make-overlay are "nil t nil":
the cursor is placed on `-', but the first insertion appears _after_
`-'.  So I'm not sure which one is better.  Maybe using the marker
insertion type (see my other email) will allow us to DTRT in each
case.




reply via email to

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