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#19188: point adjustemnt moves *into* invisible text Date: Wed, 26 Nov 2014 09:51:12 -0500 Message-ID: References: <87tx1mwtgn.fsf@bernoul.li> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1417013551 24105 80.91.229.3 (26 Nov 2014 14:52:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Nov 2014 14:52:31 +0000 (UTC) Cc: 19188-done@debbugs.gnu.org To: Jonas Bernoulli Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 26 15:52:24 2014 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 1Xtdx9-0008PX-IO for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Nov 2014 15:52:23 +0100 Original-Received: from localhost ([::1]:34269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtdx9-0006O9-6r for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Nov 2014 09:52:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtdwx-0006Eo-3o for bug-gnu-emacs@gnu.org; Wed, 26 Nov 2014 09:52:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xtdwp-0004mm-9o for bug-gnu-emacs@gnu.org; Wed, 26 Nov 2014 09:52:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtdwp-0004mi-7R for bug-gnu-emacs@gnu.org; Wed, 26 Nov 2014 09:52:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xtdwo-0006jl-TV for bug-gnu-emacs@gnu.org; Wed, 26 Nov 2014 09:52:03 -0500 Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Nov 2014 14:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 19188 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Mail-Followup-To: 19188@debbugs.gnu.org, monnier@IRO.UMontreal.CA, jonas@bernoul.li Original-Received: via spool by 19188-done@debbugs.gnu.org id=D19188.141701348025823 (code D ref 19188); Wed, 26 Nov 2014 14:52:02 +0000 Original-Received: (at 19188-done) by debbugs.gnu.org; 26 Nov 2014 14:51:20 +0000 Original-Received: from localhost ([127.0.0.1]:45729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtdw8-0006iK-0S for submit@debbugs.gnu.org; Wed, 26 Nov 2014 09:51:20 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:56016) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtdw4-0006i6-Mn; Wed, 26 Nov 2014 09:51:17 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id sAQEpCrR025582; Wed, 26 Nov 2014 09:51:12 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 385224820; Wed, 26 Nov 2014 09:51:12 -0500 (EST) In-Reply-To: <87tx1mwtgn.fsf@bernoul.li> (Jonas Bernoulli's message of "Wed, 26 Nov 2014 04:07:04 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5137=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5137> : inlines <1561> : streams <1348990> : uri <1836222> 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:96617 Archived-At: tags 19188 notabug thanks > However point is not were the cursor is > M-: (point) => 3 > The problem is in the code that is supposed to move point *out* of an > invisible region, does the opposite when moving backward places point > on the first character after an invisible region. It moves to the > beginning of the preceding invisible region. That is a common misunderstanding. The fact that point is equal to 3 means that point is *between* character 2 and character 3. So it's not *inside* an invisible text, but is right at the boundary. The position 5 (i.e. between character 4 and character 5) is at the other end of the boundary. The reason why Emacs decided to put point at position 3 rather than leave it at position 5 is because the boundary at position 3 is "less invisible" than the boundary at position 5. You can check it with M-: (list (get-pos-property 3 'invisible) (get-pos-property 5 'invisible)) RET This is because text-properties by default are front-non-sticky and rear-sticky, so if point is at position 5 and you type a character, that character will inherit the invisible property, whereas if you're at position 3 and you type a character this character will not inherit the invisible property. If you want point to be at position 5 rather than position 3, then you need to change the front/rear-stickiness of this invisible property accordingly. > When point adjustment is disabled (non-nil disable-point-adjustment or > global-disable-point-adjustment) then this does not happen. I assume you know why ;-) > It also does not happen when moving forward, e.g. starting at "1" > C-p C-f places the cursor on "5" *and* point is also 5. C-p C-f doesn't do it for me (it doesn't even reach the invisible part of the text), and if I change the recipe to C-f C-f it doesn't work either (point stays at position 3). But indeed C-n gets me to position 5, which is wrong (and doing M-: (point) returns 5 but moves me to position 3, so doing it again returns 3 :-( ). So we do have a bug here. Stefan