From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: overlay property `after-string' Date: Fri, 11 Apr 2003 15:30:33 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200304110630.PAA18689@etlken.m17n.org> References: <200304100144.KAA16944@etlken.m17n.org> <200304101344.h3ADiMe3003713@rum.cs.yale.edu> <200304110222.LAA18413@etlken.m17n.org> <200304110431.NAA18545@etlken.m17n.org> <200304110453.NAA18583@etlken.m17n.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1050042715 3320 80.91.224.249 (11 Apr 2003 06:31:55 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 11 Apr 2003 06:31:55 +0000 (UTC) Cc: monnier+gnu/emacs@rum.cs.yale.edu Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Apr 11 08:31:53 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 193s4n-0000rQ-00 for ; Fri, 11 Apr 2003 08:31:53 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 193sA7-0000kK-00 for ; Fri, 11 Apr 2003 08:37:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 193s4Y-0006vV-02 for emacs-devel@quimby.gnus.org; Fri, 11 Apr 2003 02:31:38 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 193s3q-00068r-00 for emacs-devel@gnu.org; Fri, 11 Apr 2003 02:30:55 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 193s3f-0005Ya-00 for emacs-devel@gnu.org; Fri, 11 Apr 2003 02:30:47 -0400 Original-Received: from tsukuba.m17n.org ([192.47.44.130]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 193s3X-000532-00; Fri, 11 Apr 2003 02:30:36 -0400 Original-Received: from fs.m17n.org (fs.m17n.org [192.47.44.2])h3B6UXo22619; Fri, 11 Apr 2003 15:30:33 +0900 (JST) (envelope-from handa@m17n.org) Original-Received: from etlken.m17n.org (etlken.m17n.org [192.47.44.125]) h3B6UXA12615; Fri, 11 Apr 2003 15:30:33 +0900 (JST) Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id PAA18689; Fri, 11 Apr 2003 15:30:33 +0900 (JST) Original-To: miles@gnu.org In-reply-to: (message from Miles Bader on 11 Apr 2003 14:02:23 +0900) 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) Original-cc: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13140 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13140 In article , Miles Bader 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 handa@m17n.org