GNU bug report logs - #9034
point adjustment (with invisible text) moves to the next line

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Dmitry Kurochkin <dmitry.kurochkin@HIDDEN>; Keywords: confirmed; dated Sat, 9 Jul 2011 13:05:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 9034 <at> debbugs.gnu.org:


Received: (at 9034) by debbugs.gnu.org; 26 Aug 2021 16:33:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 26 12:33:42 2021
Received: from localhost ([127.0.0.1]:50248 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mJIJy-0005lI-8f
	for submit <at> debbugs.gnu.org; Thu, 26 Aug 2021 12:33:42 -0400
Received: from quimby.gnus.org ([95.216.78.240]:49000)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mJIJw-0005l3-7T
 for 9034 <at> debbugs.gnu.org; Thu, 26 Aug 2021 12:33:40 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=Am+A3thQv1YbGRlt4KL3THodK9O06D7AawfsRgkbJlQ=; b=CbRxNFoTGGsPfd86O9O3v/jknE
 y5Fvawem3tzLi1K2YOU4TAd6sz/bHlW8ls5Yeg06wztWIpjivYn0L6aGP9W3qTKND5tfIvxMEMOua
 QKBUrKu11FsjWSanK2xjWiFylD/BOzvypfzhyMASww5jlf5U+2Mk+zPcyJ3niOBABDTA=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mJIJl-0002xW-Nq; Thu, 26 Aug 2021 18:33:33 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#9034: point adjustment (with invisible text) moves to the
 next line
References: <87iprb38sa.fsf@HIDDEN> <87tujd32pc.fsf@HIDDEN>
 <834kbdv5jd.fsf@HIDDEN> <877dg82u6n.fsf@HIDDEN>
 <8335qwtdia.fsf@HIDDEN>
Date: Thu, 26 Aug 2021 18:33:29 +0200
In-Reply-To: <8335qwtdia.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 26 Aug
 2021 18:46:37 +0300")
Message-ID: <871r6gyxly.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Eli Zaretskii <eliz@HIDDEN> writes: >> Just doing `M-: 4
 RET' will result in this code adjusting point in >> the buffer. Doing, for
 instance, `M-x foo RET' (where `foo' does >> nothing) does not result in
 this point movement. >> >> So i [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 9034
Cc: 9034 <at> debbugs.gnu.org, dmitry.kurochkin@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> Just doing `M-: 4 RET' will result in this code adjusting point in
>> the buffer.  Doing, for instance, `M-x foo RET' (where `foo' does
>> nothing) does not result in this point movement.
>> 
>> So is `M-:' doing some weird thing in the original buffer to trigger
>> this oddity?
>
> Doing M-: in what part of the recipe?

Eval this:

  (progn (switch-to-buffer "test")
         (insert "aline1\nbline2\ncline3\n")
         (put-text-property 7 14 'invisible t) ; region [\nbline2]
         (goto-char (point-min)))

Then

C-e
M-: 4 RET

This will move point to the start of the next line about half the time.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#9034; Package emacs. Full text available.

Message received at 9034 <at> debbugs.gnu.org:


Received: (at 9034) by debbugs.gnu.org; 26 Aug 2021 15:47:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 26 11:47:05 2021
Received: from localhost ([127.0.0.1]:50189 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mJHar-0002OM-BI
	for submit <at> debbugs.gnu.org; Thu, 26 Aug 2021 11:47:05 -0400
Received: from eggs.gnu.org ([209.51.188.92]:40444)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mJHap-0002No-E0
 for 9034 <at> debbugs.gnu.org; Thu, 26 Aug 2021 11:47:03 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40172)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mJHaj-0006Ga-Qh; Thu, 26 Aug 2021 11:46:57 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2618
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mJHaj-0000iV-E0; Thu, 26 Aug 2021 11:46:57 -0400
Date: Thu, 26 Aug 2021 18:46:37 +0300
Message-Id: <8335qwtdia.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
In-Reply-To: <877dg82u6n.fsf@HIDDEN> (message from Lars Ingebrigtsen on Thu, 
 26 Aug 2021 15:48:32 +0200)
Subject: Re: bug#9034: point adjustment (with invisible text) moves to the
 next line
References: <87iprb38sa.fsf@HIDDEN> <87tujd32pc.fsf@HIDDEN>
 <834kbdv5jd.fsf@HIDDEN> <877dg82u6n.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 9034
Cc: 9034 <at> debbugs.gnu.org, dmitry.kurochkin@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Lars Ingebrigtsen <larsi@HIDDEN>
> Cc: dmitry.kurochkin@HIDDEN,  9034 <at> debbugs.gnu.org
> Date: Thu, 26 Aug 2021 15:48:32 +0200
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > This code is chock-full of questionable heuristics, and in particular
> > tries to guess in which direction to move point out of the invisible
> > text.  The results are sometimes surprising.  The upside is that it
> > "mostly works".  But if someone can come up with a better heuristics,
> > I'm all ears.
> 
> Ah, right.  But...  the super-confusing thing about this is that we're
> not moving point in the buffer at all.

The original recipe moved from point-min to an end of a line.

> Just doing `M-: 4 RET' will result in this code adjusting point in
> the buffer.  Doing, for instance, `M-x foo RET' (where `foo' does
> nothing) does not result in this point movement.
> 
> So is `M-:' doing some weird thing in the original buffer to trigger
> this oddity?

Doing M-: in what part of the recipe?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#9034; Package emacs. Full text available.

Message received at 9034 <at> debbugs.gnu.org:


Received: (at 9034) by debbugs.gnu.org; 26 Aug 2021 13:48:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 26 09:48:59 2021
Received: from localhost ([127.0.0.1]:48594 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mJFkZ-0000vu-8N
	for submit <at> debbugs.gnu.org; Thu, 26 Aug 2021 09:48:59 -0400
Received: from quimby.gnus.org ([95.216.78.240]:47494)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mJFkN-0000vX-JA
 for 9034 <at> debbugs.gnu.org; Thu, 26 Aug 2021 09:48:58 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=mKJww2KgCTytDu7JmhaFfkgt4wuvydB9ldSzL2H47oA=; b=BoQnlxk178JORLjov6wZhnqL9x
 yTJ+8i6CNE0V6JUZWF/xoNDMcFVhn99IOxGGro0QILF1kcR0ZyYTh762SaR1gynzYL5wMXcOpV3NW
 ZQYJwxR0QX7ZYpcRAUkDNV7mExlvda9Ug81xpwxXTJkEuBa4R45fQ/evEiG3U4xZlz00=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mJFkC-0001NU-M5; Thu, 26 Aug 2021 15:48:40 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#9034: point adjustment (with invisible text) moves to the
 next line
References: <87iprb38sa.fsf@HIDDEN> <87tujd32pc.fsf@HIDDEN>
 <834kbdv5jd.fsf@HIDDEN>
Date: Thu, 26 Aug 2021 15:48:32 +0200
In-Reply-To: <834kbdv5jd.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 25 Aug
 2021 19:43:34 +0300")
Message-ID: <877dg82u6n.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Eli Zaretskii <eliz@HIDDEN> writes: > This code is
 chock-full of questionable heuristics,
 and in particular > tries to guess in which direction
 to move point out of the invisible > text. The results are sometimes
 surprising. The upside [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 9034
Cc: 9034 <at> debbugs.gnu.org, dmitry.kurochkin@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

> This code is chock-full of questionable heuristics, and in particular
> tries to guess in which direction to move point out of the invisible
> text.  The results are sometimes surprising.  The upside is that it
> "mostly works".  But if someone can come up with a better heuristics,
> I'm all ears.

Ah, right.  But...  the super-confusing thing about this is that we're
not moving point in the buffer at all.  Just doing `M-: 4 RET' will
result in this code adjusting point in the buffer.  Doing, for instance,
`M-x foo RET' (where `foo' does nothing) does not result in this point
movement.

So is `M-:' doing some weird thing in the original buffer to trigger
this oddity?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#9034; Package emacs. Full text available.

Message received at 9034 <at> debbugs.gnu.org:


Received: (at 9034) by debbugs.gnu.org; 25 Aug 2021 16:43:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 25 12:43:47 2021
Received: from localhost ([127.0.0.1]:47515 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mIw0B-00072W-II
	for submit <at> debbugs.gnu.org; Wed, 25 Aug 2021 12:43:47 -0400
Received: from eggs.gnu.org ([209.51.188.92]:54562)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mIw07-00072I-Qq
 for 9034 <at> debbugs.gnu.org; Wed, 25 Aug 2021 12:43:47 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53388)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mIw02-0006zy-Hd; Wed, 25 Aug 2021 12:43:38 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1283
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mIw02-0004nq-4h; Wed, 25 Aug 2021 12:43:38 -0400
Date: Wed, 25 Aug 2021 19:43:34 +0300
Message-Id: <834kbdv5jd.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
In-Reply-To: <87tujd32pc.fsf@HIDDEN> (message from Lars Ingebrigtsen on Wed, 
 25 Aug 2021 18:32:15 +0200)
Subject: Re: bug#9034: point adjustment (with invisible text) moves to the next
 line
References: <87iprb38sa.fsf@HIDDEN> <87tujd32pc.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 9034
Cc: 9034 <at> debbugs.gnu.org, dmitry.kurochkin@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Lars Ingebrigtsen <larsi@HIDDEN>
> Date: Wed, 25 Aug 2021 18:32:15 +0200
> Cc: 9034 <at> debbugs.gnu.org
> 
> Also as previously noted, if Vglobal_disable_point_adjustment is on,
> then this doesn't happen, so the problem almost has to be here:
> 
> command_loop_1
> ...
>       if (current_buffer == prev_buffer
> 	  && XBUFFER (XWINDOW (selected_window)->contents) == current_buffer
> 	  && last_point_position != PT
> 	  && NILP (Vdisable_point_adjustment)
> 	  && NILP (Vglobal_disable_point_adjustment))
> 	{
> 	  if (last_point_position > BEGV
> 	      && last_point_position < ZV
> 	      && (composition_adjust_point (last_point_position,
> 					    last_point_position)
> 		  != last_point_position))
> 	    /* The last point was temporarily set within a grapheme
> 	       cluster to prevent automatic composition.  To recover
> 	       the automatic composition, we must update the
> 	       display.  */
> 	    windows_or_buffers_changed = 21;
> 	  if (!already_adjusted)
> 	    adjust_point_for_property (last_point_position,
> 				       MODIFF != prev_modiff);
> 	}
> 
> I haven't tried to debug any further -- is it obvious to anybody what's
> failing here, by any chance?  :-)

This code is chock-full of questionable heuristics, and in particular
tries to guess in which direction to move point out of the invisible
text.  The results are sometimes surprising.  The upside is that it
"mostly works".  But if someone can come up with a better heuristics,
I'm all ears.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#9034; Package emacs. Full text available.
Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 9034 <at> debbugs.gnu.org:


Received: (at 9034) by debbugs.gnu.org; 25 Aug 2021 16:32:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 25 12:32:31 2021
Received: from localhost ([127.0.0.1]:47486 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mIvpH-0006jv-J4
	for submit <at> debbugs.gnu.org; Wed, 25 Aug 2021 12:32:31 -0400
Received: from quimby.gnus.org ([95.216.78.240]:38656)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mIvpD-0006je-2F
 for 9034 <at> debbugs.gnu.org; Wed, 25 Aug 2021 12:32:30 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=qqFxARSoy/1Q6Q4hHH8CDOy0rbPpTNzNlnFy9SppzO0=; b=Qh1CjosBiMa7BN+6gvN9AWvmQ6
 6l00YdVQylB/dMAJpJfCnwEvAOSmtqMpAyY4hoLyAFBPsn96uAVEIss99Sa/dp8pFAhIUmlux/Kws
 wPLBDsIVYD5zsk0mgf3DLe9AOa5BrWoqj3k1PThqhR4emZAlWP8x0jPQX3/5VXtqF19s=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mIvp2-0006YQ-HW; Wed, 25 Aug 2021 18:32:20 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Dmitry Kurochkin <dmitry.kurochkin@HIDDEN>
Subject: Re: bug#9034: point adjustment (with invisible text) moves to the
 next line
References: <87iprb38sa.fsf@HIDDEN>
Date: Wed, 25 Aug 2021 18:32:15 +0200
In-Reply-To: <87iprb38sa.fsf@HIDDEN> (Dmitry Kurochkin's message of "Sat,
 09 Jul 2011 17:04:05 +0400")
Message-ID: <87tujd32pc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Dmitry Kurochkin <dmitry.kurochkin@HIDDEN> writes: >
 (progn
 (switch-to-buffer "test") > (insert "aline1\nbline2\ncline3\n") >
 (put-text-property
 7 14 'invisible t) ; region [\nbline2] > (goto-char (point-min))) > > After
 that in the test buffer do M-: [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 9034
Cc: 9034 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Dmitry Kurochkin <dmitry.kurochkin@HIDDEN> writes:

>   (progn (switch-to-buffer "test")
>          (insert "aline1\nbline2\ncline3\n")
>          (put-text-property 7 14 'invisible t) ; region [\nbline2]
>          (goto-char (point-min)))
>
> After that in the test buffer do M-: (progn (end-of-visual-line)
> (point)).  `end-of-visual-line' moves point to position 14 as expected.
> But after that the point is adjusted to position 15, as can be checked
> by C-x =.

(I'm going through old bug reports that unfortunately got weren't
resolved at the time.)

This problem is still present in Emacs 28, and as previously noted, any
command you do (with `M-:') makes point advance to the next line.  (It's
not 100% reproducible -- sometimes nothing happens, and sometimes it
advances.)

So `C-e' and then, for instance `M-: 4 RET' will advance point here.

Also as previously noted, if Vglobal_disable_point_adjustment is on,
then this doesn't happen, so the problem almost has to be here:

command_loop_1
...
      if (current_buffer == prev_buffer
	  && XBUFFER (XWINDOW (selected_window)->contents) == current_buffer
	  && last_point_position != PT
	  && NILP (Vdisable_point_adjustment)
	  && NILP (Vglobal_disable_point_adjustment))
	{
	  if (last_point_position > BEGV
	      && last_point_position < ZV
	      && (composition_adjust_point (last_point_position,
					    last_point_position)
		  != last_point_position))
	    /* The last point was temporarily set within a grapheme
	       cluster to prevent automatic composition.  To recover
	       the automatic composition, we must update the
	       display.  */
	    windows_or_buffers_changed = 21;
	  if (!already_adjusted)
	    adjust_point_for_property (last_point_position,
				       MODIFF != prev_modiff);
	}

I haven't tried to debug any further -- is it obvious to anybody what's
failing here, by any chance?  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#9034; Package emacs. Full text available.
Changed bug title to 'point adjustment (with invisible text) moves to the next line' from 'point adjustment after `end-of-visual-line' moves to the next line' Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.
bug Marked as found in versions 25.2. Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.
Added tag(s) confirmed. Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.

Message received at 9034 <at> debbugs.gnu.org:


Received: (at 9034) by debbugs.gnu.org; 11 Jul 2011 08:27:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 11 04:27:34 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QgBq1-0005py-ST
	for submit <at> debbugs.gnu.org; Mon, 11 Jul 2011 04:27:34 -0400
Received: from mail-bw0-f44.google.com ([209.85.214.44])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <dmitry.kurochkin@HIDDEN>) id 1QgBpy-0005pm-P8
	for 9034 <at> debbugs.gnu.org; Mon, 11 Jul 2011 04:27:31 -0400
Received: by bwb17 with SMTP id 17so3059263bwb.3
	for <9034 <at> debbugs.gnu.org>; Mon, 11 Jul 2011 01:27:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=from:to:cc:subject:in-reply-to:references:user-agent:date
	:message-id:mime-version:content-type;
	bh=XIh+0wjpPP2iuQQBMUWabwulD0FdBv6fyYS5K9McV2w=;
	b=U1lVXTtsBqBJjPsugcDHkwPAcRlDcqIWItUxGzAP+vkCorw5FRuElMh5zOq86jCX0v
	wBDKHwETB8+CkM5KB9VsQq4U5e4FtatZjdZJatX0AB75cwEzYOw6ox9wVkrhZCqt/yy0
	oqfZl2sSaQTXfFZVBfUhVMNjcru06a19RGmyM=
Received: by 10.204.154.215 with SMTP id p23mr2521896bkw.113.1310372844809;
	Mon, 11 Jul 2011 01:27:24 -0700 (PDT)
Received: from localhost ([91.144.186.21])
	by mx.google.com with ESMTPS id k5sm9849638bka.5.2011.07.11.01.27.23
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 11 Jul 2011 01:27:23 -0700 (PDT)
From: Dmitry Kurochkin <dmitry.kurochkin@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#9034: point adjustment after `end-of-visual-line' moves to
	the next line
In-Reply-To: <jwvtyato3lq.fsf-monnier+emacs@HIDDEN>
References: <87iprb38sa.fsf@HIDDEN> <jwvtyato3lq.fsf-monnier+emacs@HIDDEN>
User-Agent: Notmuch/0.5-321-g41686e2 (http://notmuchmail.org) Emacs/23.3.1
	(x86_64-pc-linux-gnu)
Date: Mon, 11 Jul 2011 12:27:18 +0400
Message-ID: <87tyat1au1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Score: -3.6 (---)
X-Debbugs-Envelope-To: 9034
Cc: 9034 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.6 (---)

On Mon, 11 Jul 2011 00:16:31 -0400, Stefan Monnier <monnier@HIDDEN> wrote:
> > If a line ends with invisible text, point adjustment moves to the next
> > line after `end-of-visual-line'.  To reproduce run:
> 
> >   (progn (switch-to-buffer "test")
> >          (insert "aline1\nbline2\ncline3\n")
> >          (put-text-property 7 14 'invisible t) ; region [\nbline2]
> >          (goto-char (point-min)))
> 
> > After that in the test buffer do M-: (progn (end-of-visual-line)
> > (point)).  `end-of-visual-line' moves point to position 14 as expected.
> > But after that the point is adjusted to position 15, as can be checked
> > by C-x =.
> 
> > Sometimes the point is not adjusted to position 15 the first time you
> > run `end-of-visual-line'.  But it is if you run it more than once.
> > Perhaps it is related to the last point position.
> 
> I can reproduce it with M-: (progn (goto-char 14) > (point))
> 

indeed

> > Also, `move-end-of-line` always behaves correctly, so it it something
> > specific to `end-of-visual-line' or `vertical-motion'.
> 
> Apparently not since I can reproduce the problem with just goto-char.

If visual-line-mode is enabled (so that C-e is mapped to
`end-of-visual-line' instead of `move-end-of-line'),
`end-of-visual-line' works correctly when run with C-e.

> Maybe it has to do with the use of M-: instead.
> 

Seems plausible.

Regards,
  Dmitry

> 
>         Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#9034; Package emacs. Full text available.

Message received at 9034 <at> debbugs.gnu.org:


Received: (at 9034) by debbugs.gnu.org; 11 Jul 2011 04:16:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 11 00:16:41 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Qg7vF-0000FY-6H
	for submit <at> debbugs.gnu.org; Mon, 11 Jul 2011 00:16:41 -0400
Received: from fencepost.gnu.org ([140.186.70.10])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier@HIDDEN>) id 1Qg7vD-0000FM-DS
	for 9034 <at> debbugs.gnu.org; Mon, 11 Jul 2011 00:16:40 -0400
Received: from cpe-66-108-39-217.nyc.res.rr.com ([66.108.39.217]:44660
	helo=ceviche.home)
	by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <monnier@HIDDEN>)
	id 1Qg7v7-00012Y-NW; Mon, 11 Jul 2011 00:16:33 -0400
Received: by ceviche.home (Postfix, from userid 20848)
	id AC647660D5; Mon, 11 Jul 2011 00:16:31 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Dmitry Kurochkin <dmitry.kurochkin@HIDDEN>
Subject: Re: bug#9034: point adjustment after `end-of-visual-line' moves to
	the next line
Message-ID: <jwvtyato3lq.fsf-monnier+emacs@HIDDEN>
References: <87iprb38sa.fsf@HIDDEN>
Date: Mon, 11 Jul 2011 00:16:31 -0400
In-Reply-To: <87iprb38sa.fsf@HIDDEN> (Dmitry Kurochkin's message of "Sat,
	09 Jul 2011 17:04:05 +0400")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -6.0 (------)
X-Debbugs-Envelope-To: 9034
Cc: 9034 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.0 (------)

> If a line ends with invisible text, point adjustment moves to the next
> line after `end-of-visual-line'.  To reproduce run:

>   (progn (switch-to-buffer "test")
>          (insert "aline1\nbline2\ncline3\n")
>          (put-text-property 7 14 'invisible t) ; region [\nbline2]
>          (goto-char (point-min)))

> After that in the test buffer do M-: (progn (end-of-visual-line)
> (point)).  `end-of-visual-line' moves point to position 14 as expected.
> But after that the point is adjusted to position 15, as can be checked
> by C-x =.

> Sometimes the point is not adjusted to position 15 the first time you
> run `end-of-visual-line'.  But it is if you run it more than once.
> Perhaps it is related to the last point position.

I can reproduce it with M-: (progn (goto-char 14) > (point))

> Also, `move-end-of-line` always behaves correctly, so it it something
> specific to `end-of-visual-line' or `vertical-motion'.

Apparently not since I can reproduce the problem with just goto-char.
Maybe it has to do with the use of M-: instead.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#9034; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 9 Jul 2011 13:04:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 09 09:04:22 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QfXCn-00074m-Qh
	for submit <at> debbugs.gnu.org; Sat, 09 Jul 2011 09:04:22 -0400
Received: from mail-bw0-f44.google.com ([209.85.214.44])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <dmitry.kurochkin@HIDDEN>) id 1QfXCl-00074a-V4
	for submit <at> debbugs.gnu.org; Sat, 09 Jul 2011 09:04:21 -0400
Received: by bwb17 with SMTP id 17so2304225bwb.3
	for <submit <at> debbugs.gnu.org>; Sat, 09 Jul 2011 06:04:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=from:to:subject:user-agent:date:message-id:mime-version
	:content-type; bh=qiKDE8kVQu6di3MsN3/ee2uMfypHlMpbH3ANEi9vezs=;
	b=EATau4EpmngpMEKqF6lDO97a9dcuDFSNifHRN7mPxnSjYcJF4Xaz/DDL2K4GV69wV2
	T1Ws8xxNju28EvE4QNOQNoiHFj7/9SJtBO5Q4gw+ZusgE4P9JANfcbrjP3ZMZcYzldOY
	7Jz/gBPsldgUj/FD6V4poyyP8oewIi0kG6uxA=
Received: by 10.205.65.9 with SMTP id xk9mr761756bkb.388.1310216652258;
	Sat, 09 Jul 2011 06:04:12 -0700 (PDT)
Received: from localhost ([91.144.186.21])
	by mx.google.com with ESMTPS id c8sm522806bkc.15.2011.07.09.06.04.10
	(version=TLSv1/SSLv3 cipher=OTHER);
	Sat, 09 Jul 2011 06:04:11 -0700 (PDT)
From: Dmitry Kurochkin <dmitry.kurochkin@HIDDEN>
To: submit <at> debbugs.gnu.org
Subject: point adjustment after `end-of-visual-line' moves to the next line
User-Agent: Notmuch/0.5-321-g41686e2 (http://notmuchmail.org) Emacs/23.3.1
	(x86_64-pc-linux-gnu)
Date: Sat, 09 Jul 2011 17:04:05 +0400
Message-ID: <87iprb38sa.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Score: -3.6 (---)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.6 (---)

Package: emacs
Version: 24.0.50

If a line ends with invisible text, point adjustment moves to the next
line after `end-of-visual-line'.  To reproduce run:

  (progn (switch-to-buffer "test")
         (insert "aline1\nbline2\ncline3\n")
         (put-text-property 7 14 'invisible t) ; region [\nbline2]
         (goto-char (point-min)))

After that in the test buffer do M-: (progn (end-of-visual-line)
(point)).  `end-of-visual-line' moves point to position 14 as expected.
But after that the point is adjusted to position 15, as can be checked
by C-x =.

Sometimes the point is not adjusted to position 15 the first time you
run `end-of-visual-line'.  But it is if you run it more than once.
Perhaps it is related to the last point position.

It is definitely happens because of point adjustment, setting
global-disable-point-adjustment to non-nil fixes the problem.

Also, `move-end-of-line` always behaves correctly, so it it something
specific to `end-of-visual-line' or `vertical-motion'.

The issue was originally reported on the emacs-devel ML [1].

Regards,
  Dmitry

[1] http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00255.html




Acknowledgement sent to Dmitry Kurochkin <dmitry.kurochkin@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#9034; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 26 Aug 2021 16:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.