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: Sat, 29 Aug 2015 10:25:22 +0300 Message-ID: <83oahq36al.fsf@gnu.org> References: <87r3mnjtzl.fsf@gmail.com> <83r3mn2o44.fsf@gnu.org> <87io7zjclt.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1440833188 14756 80.91.229.3 (29 Aug 2015 07:26:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Aug 2015 07:26:28 +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 Sat Aug 29 09:26:15 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 1ZVaWj-0005xN-DV for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Aug 2015 09:26:13 +0200 Original-Received: from localhost ([::1]:51381 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVaWi-00048l-3c for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Aug 2015 03:26:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVaWd-00048g-T2 for bug-gnu-emacs@gnu.org; Sat, 29 Aug 2015 03:26:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZVaWY-0000u9-VH for bug-gnu-emacs@gnu.org; Sat, 29 Aug 2015 03:26:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVaWY-0000tz-RB for bug-gnu-emacs@gnu.org; Sat, 29 Aug 2015 03:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZVaWY-0005zw-D8 for bug-gnu-emacs@gnu.org; Sat, 29 Aug 2015 03:26: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: Sat, 29 Aug 2015 07:26: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.144083312423013 (code B ref 21368); Sat, 29 Aug 2015 07:26:02 +0000 Original-Received: (at 21368) by debbugs.gnu.org; 29 Aug 2015 07:25:24 +0000 Original-Received: from localhost ([127.0.0.1]:41963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZVaVw-0005z6-0U for submit@debbugs.gnu.org; Sat, 29 Aug 2015 03:25:24 -0400 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:35666) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZVaVs-0005yv-NW for 21368@debbugs.gnu.org; Sat, 29 Aug 2015 03:25:22 -0400 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NTU00E001IFW400@mtaout25.012.net.il> for 21368@debbugs.gnu.org; Sat, 29 Aug 2015 10:21:55 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NTU004CP1SHN6A0@mtaout25.012.net.il>; Sat, 29 Aug 2015 10:21:55 +0300 (IDT) In-reply-to: <87io7zjclt.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:105940 Archived-At: > From: Vitalie Spinu > Cc: 21368@debbugs.gnu.org > Date: Sat, 29 Aug 2015 00:02:22 +0200 > > >> On Fri, Aug 28 2015 22:45, Eli Zaretskii wrote: > > > The first two do work, you just need to invoke backward-char twice to > > see the cursor move. > > This is not happening with `M-x (backward-char 1)`. It does indeed work when > backward-char is invoked interactively with C-b. > > This is a relatively recent change in behavior (past 2-3 months or so). What is a relatively recent change? The C-b part or the M-x part? > > 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. > > I have encountered this issue in 3 different projects. One is the implementation > of visual breakpoints in ESS which look like this: > > https://ess-tracebug.googlecode.com/svn/trunk/img/breakpoint_types.PNG > > For years I used to have a defadvice workaround along the following lines: > ... > (when (and (eq major-mode 'ess-mode) > (get-text-property (point) 'intangible)) > (backward-char 1)) > add-do-it > ... > > With the new emacs dev the backward-char stopped working. That's why I am > finally reporting this bug. Can't you use an overlay to show the bitmap on the fringe? IOW, instead of the first display property, define an empty overlay (i.e. overlay whose start and end positions are equal) with a before-string that is propertized with a 'fringe' display property. Here's an example, based on your original scenario: (defun insert-with-fringe () (let ((pt (point)) ov) (insert " " (propertize "dummy" 'display "AAA\n" 'font-lock-face font-lock-doc-face) "some more text") (setq ov (make-overlay (+ pt 5) (+ pt 5))) (overlay-put ov 'before-string (propertize "fringe" 'display (list 'left-fringe 'filled-square font-lock-doc-face))) (previous-line))) This produces the same display as in your example, but has none of its problems, because the situation with 2 consecutive display strings on adjacent buffer positions is eliminated. > Another real life use case is the yet unfinished image-display package where I > attempted to build a grid of images with intangible segments and simply rely on > emacs motion commands for navigation between cells. This didn't work properly > because the vertical motion was jumping columns. > > Another example is a spredsheet application for data manipulation where I have > read-only cells which I want to navigate with standard emacs motion > commands. Same design as above and the same problem. OK, but if using overlays as shown above doesn't fill your needs, please don't hold your breath for a quick solution. It's a hard problem, and the code that handles it is already too convoluted. Visual line movement is a tough nut when there's a lot of invisible text around. (Btw, yet another solution is to disable line-move-visual in these cases -- would that be a good idea in those real-life examples?)