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#21468: 24.5; When next-line (visual) crosses overlay with before-string="\n" point goes to column 0 Date: Sun, 13 Sep 2015 13:30:52 +0300 Message-ID: <834miybogz.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1442140344 13097 80.91.229.3 (13 Sep 2015 10:32:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Sep 2015 10:32:24 +0000 (UTC) Cc: 21468@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 13 12:32: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 1Zb4Zv-0008Gj-HN for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Sep 2015 12:32:11 +0200 Original-Received: from localhost ([::1]:35219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb4Zv-0005ZH-0g for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Sep 2015 06:32:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb4Zr-0005Z8-EO for bug-gnu-emacs@gnu.org; Sun, 13 Sep 2015 06:32:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zb4Zm-0001DV-Ev for bug-gnu-emacs@gnu.org; Sun, 13 Sep 2015 06:32:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38250) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb4Zm-0001DR-CV for bug-gnu-emacs@gnu.org; Sun, 13 Sep 2015 06:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zb4Zm-0006XX-67 for bug-gnu-emacs@gnu.org; Sun, 13 Sep 2015 06:32: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: Sun, 13 Sep 2015 10:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21468 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21468-submit@debbugs.gnu.org id=B21468.144214032125132 (code B ref 21468); Sun, 13 Sep 2015 10:32:02 +0000 Original-Received: (at 21468) by debbugs.gnu.org; 13 Sep 2015 10:32:01 +0000 Original-Received: from localhost ([127.0.0.1]:58693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zb4Zk-0006XH-Cu for submit@debbugs.gnu.org; Sun, 13 Sep 2015 06:32:00 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:56613) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zb4Zh-0006X7-L7 for 21468@debbugs.gnu.org; Sun, 13 Sep 2015 06:31:59 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NUM00A002I4SC00@a-mtaout22.012.net.il> for 21468@debbugs.gnu.org; Sun, 13 Sep 2015 13:30:55 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NUM00AOX2JJGQA0@a-mtaout22.012.net.il>; Sun, 13 Sep 2015 13:30:55 +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: 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:106471 Archived-At: > Date: Sun, 13 Sep 2015 01:17:39 -0400 > From: Noam Postavsky > > Run > > emacs -Q next-line-fail.el -l next-line-fail.el > > where next-line-fail.el contains > > (let ((pos 17)) > (goto-char pos) > (overlay-put (make-overlay pos (1+ pos)) 'before-string > (propertize "\n" 'face 'highlight))) > > The overlay will create a highlighted blank line below line 1. > Move point forward so it's on line 1, column X (where X != 0), then do > C-n (next-line). > > Expected: point should be on line 2 column X. > Actual: point goes to line 2, but in column 0. Note that hitting C-n > a second time goes to line 3 column X. Fixed in commit 6514b30 on master. Once again, I must respectfully request that Magit maintainers refrain from these practices of (ab)using Emacs display features where simpler alternatives are readily available. The buffer displayed by Magit is entirely ephemeral, i.e. does not come from any file, so a much simpler way would be to arrange the text in that buffer as Magit needs, instead of using overlays and display strings to show something that is not in the buffer. E.g., in this fragment, cited by the Magit issue: (ov rend (1+ rend) 'after-string (propertize (concat (propertize "\s" 'display '(space :height (1))) (propertize "\n" 'line-height t)) 'face 'magit-diff-lines-boundary))) why can't Magit simply change the buffer text to be what it wants to display? why does it need to use an overlay string? All those text properties are supported on buffer text as well. Overlay strings and display strings with embedded newlines are especially painful wrt vertical cursor motion; changing the buffer text instead to present the same display makes vertical motion's job much simpler. The Emacs display engine was not designed for too heavy use of these features. By over-using them, you make Magit much less stable than necessary, certainly much less future-proof and consistent across different Emacs releases. Please don't.