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#21207: 25.0.50; Cursor position behaves unpredictably on the 'display text property Date: Sat, 08 Aug 2015 10:27:12 +0300 Message-ID: <83egjeqlyn.fsf@gnu.org> References: <83twsbqfqx.fsf@gnu.org> <83oaijq7nq.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1439018904 16975 80.91.229.3 (8 Aug 2015 07:28:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Aug 2015 07:28:24 +0000 (UTC) Cc: 21207@debbugs.gnu.org To: bruce.connor.am@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 08 09:28:13 2015 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 1ZNyY6-0007G4-OI for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Aug 2015 09:28:10 +0200 Original-Received: from localhost ([::1]:52143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNyY6-0003Qn-4K for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Aug 2015 03:28:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNyY1-0003Lr-Pm for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2015 03:28:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNyXy-0000bP-L8 for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2015 03:28:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46349) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNyXy-0000bK-IK for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2015 03:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZNyXx-0001Nu-RU for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2015 03:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Aug 2015 07:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21207 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21207-submit@debbugs.gnu.org id=B21207.14390188385265 (code B ref 21207); Sat, 08 Aug 2015 07:28:01 +0000 Original-Received: (at 21207) by debbugs.gnu.org; 8 Aug 2015 07:27:18 +0000 Original-Received: from localhost ([127.0.0.1]:50565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZNyXF-0001Mp-Uj for submit@debbugs.gnu.org; Sat, 08 Aug 2015 03:27:18 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:45546) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZNyXD-0001Mg-23 for 21207@debbugs.gnu.org; Sat, 08 Aug 2015 03:27:16 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NSR005005K39900@a-mtaout22.012.net.il> for 21207@debbugs.gnu.org; Sat, 08 Aug 2015 10:27:13 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NSR005GW61D2O60@a-mtaout22.012.net.il>; Sat, 08 Aug 2015 10:27:13 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.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:105366 Archived-At: > Date: Fri, 7 Aug 2015 20:43:41 +0100 > From: Artur Malabarba > Cc: 21207@debbugs.gnu.org > > 2015-08-07 19:23 GMT+01:00 Eli Zaretskii : > >> Date: Fri, 07 Aug 2015 18:29:10 +0300 > >> From: Eli Zaretskii > >> Cc: 21207@debbugs.gnu.org > >> > >> > If I can place the cursor on the newline in the first scenario, why > >> > can't I do so in the second? > >> > >> Because we have special support for cursor positioning on display > >> strings that end in a newline > > > > More importantly: in the first scenario the newline ends the display > > string, whereas in the second it is in its middle. > > Isn't it at the start of the display string? Yes, sorry. The important part is that it's not at the end of the string. In any case, due to the way cursor positioning in these cases is implemented, in order to decide that the cursor could be placed on a line that is part of the display string, the display engine needs to see at least one glyph from that display string on that line. And a newline leaves no glyph. So if you change your second scenario to this: (add-text-properties (point) (1+ (point)) '(display "-\n------")) you will see that the cursor is placed on that line, before the newline.