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#21368: 25.0.50; Core navigation commands fail in a multi-line intangible text with fringe Date: Fri, 28 Aug 2015 22:45:47 +0300 Message-ID: <83r3mn2o44.fsf@gnu.org> References: <87r3mnjtzl.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1440791184 14789 80.91.229.3 (28 Aug 2015 19:46:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Aug 2015 19:46:24 +0000 (UTC) Cc: 21368@debbugs.gnu.org To: Vitalie Spinu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 28 21:46: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 1ZVPbG-0006k3-2O for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Aug 2015 21:46:10 +0200 Original-Received: from localhost ([::1]:49644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVPbF-0007yH-5b for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Aug 2015 15:46:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVPbC-0007yB-3U for bug-gnu-emacs@gnu.org; Fri, 28 Aug 2015 15:46:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZVPb8-0001Ht-Tt for bug-gnu-emacs@gnu.org; Fri, 28 Aug 2015 15:46:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVPb8-0001Hn-Qv for bug-gnu-emacs@gnu.org; Fri, 28 Aug 2015 15:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZVPb8-0004U8-CF for bug-gnu-emacs@gnu.org; Fri, 28 Aug 2015 15:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Aug 2015 19:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21368 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21368-submit@debbugs.gnu.org id=B21368.144079114817214 (code B ref 21368); Fri, 28 Aug 2015 19:46:02 +0000 Original-Received: (at 21368) by debbugs.gnu.org; 28 Aug 2015 19:45:48 +0000 Original-Received: from localhost ([127.0.0.1]:41699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZVPau-0004TZ-BA for submit@debbugs.gnu.org; Fri, 28 Aug 2015 15:45:48 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:40239) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZVPar-0004TO-6d for 21368@debbugs.gnu.org; Fri, 28 Aug 2015 15:45:46 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NTT00E004YZEI00@a-mtaout20.012.net.il> for 21368@debbugs.gnu.org; Fri, 28 Aug 2015 22:45:43 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NTT00E375K7DJ40@a-mtaout20.012.net.il>; Fri, 28 Aug 2015 22:45:43 +0300 (IDT) In-reply-to: <87r3mnjtzl.fsf@gmail.com> 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: 208.118.235.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:105931 Archived-At: > From: Vitalie Spinu > Date: Fri, 28 Aug 2015 17:46:54 +0200 > > (defun insert-with-fringe () > (insert > " " > (concat > (propertize "fringe" 'display (list 'left-fringe 'filled-square font-lock-doc-face)) > (propertize "dummy" 'display "AAA\n" 'font-lock-face font-lock-doc-face)) > "some more text") > (previous-line)) > > Execute (insert-with-fringe). It should position the cursor just in front of the > "AAA" string. > > Now (backward-char 1) or (goto-char (1- (point))) don't have any effect, and > (previous-line) goes to bol instead of the previous line. The first two do work, you just need to invoke backward-char twice to see the cursor move. But "C-x =" will show you that backward-char did move even after the first time. The cursor doesn't move the first time because you have buffer positions covered by a display property that is displayed on the fringe, and the first backward-char moves into those buffer positions. This is nothing new: you can see it whenever you use the fringe property without all the rest in this scenario. So this part of the behavior is not a bug. The behavior of previous-line is indeed a bug, and it is hard to fix. > It has to do with the trailing "\n" in "AAA\n". If that new line is removed, > everything works as expected. No, it's because you have 2 consecutive display properties, _and_ the second one ends in a newline. There's code in vertical-motion that attempts to avoid the lossage when a display property includes newlines, but the fringe display property before that defeats that code. Is there some important real-life use case that needs this to work? Otherwise, I'm inclined to leave this alone. After all, it's not a catastrophe: the next call to previous-line will go to the line you want.