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#13863: 24.2; Cursor position after after-string on overlay at point-max Date: Sun, 03 Mar 2013 23:20:13 +0200 Message-ID: <83mwuktc36.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1362345713 17307 80.91.229.3 (3 Mar 2013 21:21:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Mar 2013 21:21:53 +0000 (UTC) Cc: 13863@debbugs.gnu.org To: Magnar Sveen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 03 22:22:17 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UCGMK-0005A6-MM for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Mar 2013 22:22:16 +0100 Original-Received: from localhost ([::1]:34919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCGLz-0000ts-93 for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Mar 2013 16:21:55 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCGLw-0000tn-EY for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2013 16:21:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCGLv-0001Tw-Fb for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2013 16:21:52 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCGLv-0001Th-Bt for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2013 16:21:51 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UCGM5-0004lS-Q2 for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2013 16:22:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Mar 2013 21:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13863 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13863-submit@debbugs.gnu.org id=B13863.136234571618303 (code B ref 13863); Sun, 03 Mar 2013 21:22:01 +0000 Original-Received: (at 13863) by debbugs.gnu.org; 3 Mar 2013 21:21:56 +0000 Original-Received: from localhost ([127.0.0.1]:57599 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCGLz-0004lA-V5 for submit@debbugs.gnu.org; Sun, 03 Mar 2013 16:21:56 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:51776) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCGLw-0004kv-T2 for 13863@debbugs.gnu.org; Sun, 03 Mar 2013 16:21:54 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MJ300D00RV0ND00@a-mtaout20.012.net.il> for 13863@debbugs.gnu.org; Sun, 03 Mar 2013 23:20:26 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MJ300DFASLYO620@a-mtaout20.012.net.il>; Sun, 03 Mar 2013 23:20:22 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72051 Archived-At: > From: Magnar Sveen > Date: Sun, 03 Mar 2013 20:19:33 +0100 > > - Write some text into a buffer > - Create this overlay: > > (let ((o (make-overlay (point-max) (point-max) nil t t)) > (s "There's\na multiline\nstring here")) > (set-text-properties 0 (length s) > `(face (:foreground ,(format "#%02x%02x%02x" 90 90 90))) s) > (overlay-put o 'priority 100) > (overlay-put o 'after-string s)) > > ;; the text-properties aren't important, it's just there to > ;; separate the overlay visually. > > - Go to point-max. > - Type something. > > Notice that the point of insertion is not reflected by the position of > the cursor. > > Basically, the cursor is positioned after the after-string of an overlay > at point-max, even if it does not accurately reflect where text is > inserted. If the after-string is large enough, you could be inserting > text outside the screen and not know about it. Emacs always behaved like that with after-string display. > I am trying to use this so that I can display some extra information > after contents of the buffer. However, it gets mighty annoying when the > cursor is placed after all the second-order information I am displaying > there. > > Maybe the placement of the cursor should depend on the the value of > rear-advance? Try this (note the marked line I added): (let ((o (make-overlay (point-max) (point-max) nil t t)) (s "There's\na multiline\nstring here")) (set-text-properties 0 (length s) `(face (:foreground ,(format "#%02x%02x%02x" 90 90 90))) s) (put-text-property 0 1 'cursor t s) ;;; <<<<<<<<<<<<<<<<<<<<<< (overlay-put o 'priority 100) (overlay-put o 'after-string s)) IOW, when Emacs is too dumb to put the cursor where you want, you can guide it with the 'cursor' text property.