From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#11094: Wrong cursor positioning with display+invisible Date: Sun, 01 Apr 2012 21:06:59 -0400 Message-ID: References: <83vclljesi.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1333328876 17135 80.91.229.3 (2 Apr 2012 01:07:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 Apr 2012 01:07:56 +0000 (UTC) Cc: 11094@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 02 03:07:55 2012 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 1SEVkQ-0003yj-Nx for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Apr 2012 03:07:54 +0200 Original-Received: from localhost ([::1]:41550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEVkP-0005Dr-Vr for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Apr 2012 21:07:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEVkN-0005Dl-Ij for bug-gnu-emacs@gnu.org; Sun, 01 Apr 2012 21:07:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEVkL-00054k-Nb for bug-gnu-emacs@gnu.org; Sun, 01 Apr 2012 21:07:51 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEVkL-00054f-K4 for bug-gnu-emacs@gnu.org; Sun, 01 Apr 2012 21:07:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SEVkY-0006oA-5X for bug-gnu-emacs@gnu.org; Sun, 01 Apr 2012 21:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Apr 2012 01:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11094 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11094-submit@debbugs.gnu.org id=B11094.133332883626115 (code B ref 11094); Mon, 02 Apr 2012 01:08:02 +0000 Original-Received: (at 11094) by debbugs.gnu.org; 2 Apr 2012 01:07:16 +0000 Original-Received: from localhost ([127.0.0.1]:35212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SEVjn-0006n9-Nd for submit@debbugs.gnu.org; Sun, 01 Apr 2012 21:07:16 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:24866) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SEVjl-0006n2-Ut for 11094@debbugs.gnu.org; Sun, 01 Apr 2012 21:07:14 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicFAKU/KE9soXt6/2dsb2JhbACBX5x7eYhwnhmGGQSbGYQJ X-IronPort-AV: E=Sophos;i="4.73,1,1325480400"; d="scan'208";a="171211337" Original-Received: from 108-161-123-122.dsl.teksavvy.com (HELO pastel.home) ([108.161.123.122]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 01 Apr 2012 21:06:59 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 5F873590C9; Sun, 1 Apr 2012 21:06:59 -0400 (EDT) In-Reply-To: <83vclljesi.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 31 Mar 2012 12:33:17 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) 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 (newer, 2) 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:58454 Archived-At: >> Extract the test.cpio and cpio-mode.el files attached, and then try: >> src/emacs -Q -l .../cpio-mode.el .../test.cpio > Ouch! ;-) > (Btw, test.cpio is an invalid archive, according to 2 different > implementations of the cpio command. The one from GNU/Linux says > "cpio: premature end of file". Not that it matters for the purposes > of this discussion.) I just truncated it, since the original (an initrd) is 10MB long. >> In Emacs-23, the cursor jumps correctly over the various display and >> invisible fields > For some value of "correctly". E.g., position the cursor over the > ".", which is the first file name in the archive, and type "C-x =". > You will see "63", which is a lie: the actual value of point is 111. I don't think it's a lie because that text is preceded by invisible text, so while "." is at 111, point is indeed at 63 (and that's just because of adjust_point_for_property, so we can get point to stay at 111 by being more careful with text property's stickiness). > The old, unidirectional display engine could get away (albeit by the > skin of its teeth) with such code because it relied on buffer > positions to increase monotonically with screen positions. So once it > found a glyph from buffer position N that is greater or equal to the > value of point, it could place the cursor there, because it "knew" all > the later glyphs _must_ correspond to positions beyond N. That is why > it "works" in Emacs 23. I see that the problem is not so much that all the text is covered by those properties, but rather that there is are contiguous texts with `invisible' and `display' properties. I get Emacs-24 to behave correctly by turning all "invisible span followed by display span" into just a single display span. E.g. if you do emacs -Q (put-text-property (point-min) (+ 2 (point-min)) 'invisible t) (put-text-property (+ 2 (point-min)) (+ 4 (point-min)) 'display "<>") (goto-char (point-min)) you'll see that the cursor is drawn at the wrong place (i.e. after the <>), whereas if you do emacs -Q (put-text-property (point-min) (+ 4 (point-min)) 'display "<>") (goto-char (point-min)) the cursor is drawn at the right place. I think this is the core of the problem that's handled differently from Emacs-23. [ IIUC you've gotten to the same conclusion. ] > If you still think we should support your original code, we should > schedule some post-24.1 redesign and refactoring. Let me know what > you think. I don't think it's a very high priority problem, but it would be good to try and tackle it, yes (post-24.1). Stefan