GNU bug report logs -
#5809
23.1.94; cross-reference by anchor yields in accurate position
Previous Next
Reported by: Eli Zaretskii <eliz <at> gnu.org>
Date: Wed, 31 Mar 2010 10:00:03 UTC
Severity: normal
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
Full log
Message #80 received at 5809 <at> debbugs.gnu.org (full text, mbox):
> From: Juri Linkov <juri <at> jurta.org>
> Cc: monnier <at> iro.umontreal.ca, 5809 <at> debbugs.gnu.org
> Date: Sun, 04 Apr 2010 14:07:28 +0300
>
> >> There are still a problem. I can't find a way to move the cursor
> >> inside the overlay's after-string and click links inside it.
> >> Any suggestions?
> >
> > Does it work to change the character of the overlay string on which
> > you put the `cursor' property? (You will need to redefine C-f, C-b,
> > and friends for that.)
>
> Sorry, I don't understand what do you mean. Could you modify the example
> you recently sent to emacs-devel:
>
> (let ((pos (goto-char (point-max))))
> (insert "foobar")
> (overlay-put
> (make-overlay (+ pos 2) (+ pos 3))
> 'after-string (propertize "-" 'cursor t)))
>
> to allow the cursor to move inside 'after-string and to not jump over it?
Compare the results of evaluating the two forms below:
(let ((pos (goto-char (point-max))))
(insert "foobar")
(overlay-put
(make-overlay (+ pos 2) (+ pos 3))
'after-string (concat "1" (propertize "2" 'cursor t) "34")))
(let ((pos (goto-char (point-max))))
(insert "foobar")
(overlay-put
(make-overlay (+ pos 2) (+ pos 3))
'after-string (concat "12" (propertize "3" 'cursor t) "4")))
Both display "foo1234bar", with "1234" coming from the `after-string'
overlay.
When you type C-f on the second `o' in "foo", the cursor will be
displayed on `2' with the first form and on `3' with the second. More
generally, the cursor will be displayed on the character in "1234"
which you propertize with a non-nil `cursor' property.
What I meant in my suggestion is to move the property from one
character to another of the `after-string' when the user types C-f
with cursor on the overlay. E.g., if the cursor is on `2' and I type
C-f, modify the `after-string' from
(concat "1" (propertize "2" 'cursor t) "34")
to
(concat "12" (propertize "3" 'cursor t) "4")
Then it will appear as if the cursor moved inside the `after-string'.
This bug report was last modified 15 years and 90 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.