emacs-devel
[Top][All Lists]
Advanced

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

Re: overlay property `after-string'


From: Kenichi Handa
Subject: Re: overlay property `after-string'
Date: Fri, 11 Apr 2003 15:30:33 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.2.92 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

In article <address@hidden>, Miles Bader <address@hidden> writes:
> It's dependent on the insertion-type of the overlay; basically, the
> cursor should be displayed relative to the overlay text wherever text
> will be inserted relative to the overlay text.

> For instance, try this modified version of your example:

>    (let (overlay)
>      (insert "abc")
>      (setq overlay (make-overlay (- (point) 3) (point) nil nil t))
>      (overlay-put overlay 'after-string "[hello]"))

> Now type -- whoa, wierd!

I see your point.  You mean this:
    Showing the cursor at where the next typed character
    will be displayed.
Correct?

I agree that it is the best behaviour, but, yes, fixing
seems very difficult.

By the way, we will encouter this very tricky case, but it
seems ok to igore such a case.

(let (ov1 ov2)
  (insert "abcdef")
  (setq ov1 (make-overlay (- (point) 6) (- (point) 3) nil nil t))
  (overlay-put ov1 'after-string "[hello]")
  (setq ov2 (make-overlay (- (point) 3) (point)))
  (overlay-put ov2 'before-string "[world]")
  (forward-char -3)
  (unwind-protect
      (while t
        (insert (read-char))
        (message (format "%d-%d, %d-%d" 
                         (overlay-start ov1) (overlay-end ov1)
                         (overlay-start ov2) (overlay-end ov2))))
    (delete-overlay ov1)
    (delete-overlay ov2)))

---
Ken'ichi HANDA
address@hidden




reply via email to

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