From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#5809: 23.1.94; cross-reference by anchor yields in accurate position Date: Sun, 04 Apr 2010 15:12:11 +0300 Message-ID: <83sk7bzaas.fsf@gnu.org> References: <837hoszubi.fsf@gnu.org> <87hbnwy2un.fsf@mail.jurta.org> <83y6h8xz8a.fsf@gnu.org> <8739zf5bif.fsf@mail.jurta.org> <83y6h7vy6p.fsf@gnu.org> <87y6h7uitd.fsf@mail.jurta.org> <83wrwqx6r2.fsf@gnu.org> <83vdcax5hu.fsf@gnu.org> <87d3yi85sv.fsf@mail.jurta.org> <87eiix5u1a.fsf@mail.jurta.org> <878w94dxf2.fsf@mail.jurta.org> <831vev21be.fsf@gnu.org> <87bpdzzdfu.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1270383972 19338 80.91.229.12 (4 Apr 2010 12:26:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 4 Apr 2010 12:26:12 +0000 (UTC) Cc: 5809@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 04 14:26:07 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NyOtz-0005Vu-EF for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Apr 2010 14:26:07 +0200 Original-Received: from localhost ([127.0.0.1]:59889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NyOty-0000cK-FO for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Apr 2010 08:26:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NyOts-0000as-3H for bug-gnu-emacs@gnu.org; Sun, 04 Apr 2010 08:26:00 -0400 Original-Received: from [140.186.70.92] (port=43055 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NyOtq-0000YX-Ag for bug-gnu-emacs@gnu.org; Sun, 04 Apr 2010 08:25:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NyOtn-0000ku-Vq for bug-gnu-emacs@gnu.org; Sun, 04 Apr 2010 08:25:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50259) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyOtn-0000ko-Ox for bug-gnu-emacs@gnu.org; Sun, 04 Apr 2010 08:25:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NyOiI-0006RD-Hn; Sun, 04 Apr 2010 08:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Apr 2010 12:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5809 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5809-submit@debbugs.gnu.org id=B5809.127038319724739 (code B ref 5809); Sun, 04 Apr 2010 12:14:02 +0000 Original-Received: (at 5809) by debbugs.gnu.org; 4 Apr 2010 12:13:17 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyOhZ-0006Qy-3f for submit@debbugs.gnu.org; Sun, 04 Apr 2010 08:13:17 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyOhW-0006Qt-PV for 5809@debbugs.gnu.org; Sun, 04 Apr 2010 08:13:15 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L0C00A00PTU9I00@a-mtaout20.012.net.il> for 5809@debbugs.gnu.org; Sun, 04 Apr 2010 15:12:11 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.124.92.42]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L0C009Z6PW5ZO00@a-mtaout20.012.net.il>; Sun, 04 Apr 2010 15:12:08 +0300 (IDT) In-reply-to: <87bpdzzdfu.fsf@mail.jurta.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 04 Apr 2010 08:14:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:35922 Archived-At: > From: Juri Linkov > Cc: monnier@iro.umontreal.ca, 5809@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'.