[Top][All Lists]
[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.
- Re: Cursor positioning with `after-string' overlays, (continued)
- Re: Cursor positioning with `after-string' overlays, Stefan Monnier, 2010/04/01
- Re: Cursor positioning with `after-string' overlays, Eli Zaretskii, 2010/04/02
- Re: Cursor positioning with `after-string' overlays, Stefan Monnier, 2010/04/02
- Re: Cursor positioning with `after-string' overlays, Eli Zaretskii, 2010/04/02
- Re: Cursor positioning with `after-string' overlays, Stefan Monnier, 2010/04/02
- Re: Cursor positioning with `after-string' overlays, Eli Zaretskii, 2010/04/02
- Re: Cursor positioning with `after-string' overlays, Stefan Monnier, 2010/04/02
- Re: Cursor positioning with `after-string' overlays, Eli Zaretskii, 2010/04/03
- Re: redisplay code is ugly (was: Cursor positioning with `after-string' overlays), Eli Zaretskii, 2010/04/03
- Re: Cursor positioning with `after-string' overlays, Eli Zaretskii, 2010/04/03
- Re: Cursor positioning with `after-string' overlays,
Eli Zaretskii <=