GNU logs - #79787, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#79787: 31.0.50; Unexpected point adjustment when passing over text that has 'invisible property and an overlay with 'display on top
Resent-From: Ihor Radchenko <yantar92@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 08 Nov 2025 10:44:01 +0000
Resent-Message-ID: <handler.79787.B.176259863629644 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 79787
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 79787 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.176259863629644
          (code B ref -1); Sat, 08 Nov 2025 10:44:01 +0000
Received: (at submit) by debbugs.gnu.org; 8 Nov 2025 10:43:56 +0000
Received: from localhost ([127.0.0.1]:50934 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vHgQF-0007i4-L1
	for submit <at> debbugs.gnu.org; Sat, 08 Nov 2025 05:43:56 -0500
Received: from lists.gnu.org ([2001:470:142::17]:50642)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1vHgQC-0007hs-D1
 for submit <at> debbugs.gnu.org; Sat, 08 Nov 2025 05:43:53 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>)
 id 1vHgQ3-0006U3-2F
 for bug-gnu-emacs@HIDDEN; Sat, 08 Nov 2025 05:43:43 -0500
Received: from mout02.posteo.de ([185.67.36.66])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>)
 id 1vHgQ0-0002ET-KB
 for bug-gnu-emacs@HIDDEN; Sat, 08 Nov 2025 05:43:42 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 1F63D240101
 for <bug-gnu-emacs@HIDDEN>; Sat,  8 Nov 2025 11:43:37 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017;
 t=1762598618; bh=jJXwqWMCv6r5B4uNtbLrMx+fKTQ7yNKlRNASvkP3xJQ=;
 h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From;
 b=U88YA+eI+HvxAqSprNtx89MEc2xLTNVj0D4OPq5o/FZukiw1rN1yo7KT+QD8epncc
 wa5K4EVuiRU/unK/Pz2xbZ51SsDzEWfczm1gm8fRzAbclojXPgJljXjl4OoJQ2NLqC
 ImtLROEdmtXBKfr9WKRmvaj6Dmuc5RRexx/hjAEMZ3hNbII8kh9/Y8nddLHzdyKEdV
 u13Ud3woh1v+hb7HPMndbWZUsSJ5nWJqmYgMcnc3PbPC9t0lQK9OlYTZ+dMp60vryI
 TXjOQbga+01u8Id79WtqodhUFWNRXFBgU0dTlsrz8BOLhz+fHs9N/qLIYgnP46eAen
 aeZ4q34tW2s7A==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4d3XbF4Dnmz9rxG
 for <bug-gnu-emacs@HIDDEN>; Sat,  8 Nov 2025 11:43:37 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
Date: Sat, 08 Nov 2025 10:43:37 +0000
Message-ID: <87wm40954s.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@HIDDEN;
 helo=mout02.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
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: -0.0 (/)

Hello,

Consider the following reproducer

 (let (ovs)
   (with-current-buffer (generate-new-buffer "*temp*")
     (display-buffer-below-selected (current-buffer) nil)
     (insert "\n\n12345789")
     (goto-char (point-min))
     (with-silent-modifications
       (search-forward "1")
       (backward-char)
       (put-text-property (+ (point) 2) (+ (point) 4) 'invisible t)
       (read-char "Press any key (part of 123456789 hidden)")
       (dolist (offset '(0 1 2 3 4 5 6 7 8))
	 (push (make-overlay (+ offset (point)) (+ offset (point) 1)) ovs)
	 (overlay-put (car ovs) 'display (copy-sequence "!")))
       (message "NOW, move cursor across 123456789 string, observe point jumping across some !"))))

When we put an overlay with 'display property on top of 'invisible text,
the overlay takes precedence and the text from 'display is visible on
place of the underlying text.

However, point adjustment does not seem to account for this scenario -
the point gets adjusted to bypass 'invisible text anyway, which is
unexpected as the point jumps over the visible overlay.

This issue has been originally reported in https://orgmode.org/list/87ms50z1bp.fsf@localhost


In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, cairo version
 1.18.4) of 2025-04-28 built on localhost
Repository revision: 509cbe1c35b3dd005a53ac041f9c87ee53b8e115
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101018
System Description: Gentoo Linux

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: bug#79787: Acknowledgement (31.0.50; Unexpected point adjustment
 when passing over text that has 'invisible property and an overlay with
 'display on top)
Message-ID: <handler.79787.B.176259863629644.ack <at> debbugs.gnu.org>
References: <87wm40954s.fsf@localhost>
X-Gnu-PR-Message: ack 79787
X-Gnu-PR-Package: emacs
Reply-To: 79787 <at> debbugs.gnu.org
Date: Sat, 08 Nov 2025 10:44:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 79787 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
79787: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D79787
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#79787: 31.0.50; Unexpected point adjustment when passing over text that has 'invisible property and an overlay with 'display on top
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 09 Nov 2025 10:19:01 +0000
Resent-Message-ID: <handler.79787.B79787.176268349511273 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 79787
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Ihor Radchenko <yantar92@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Cc: 79787 <at> debbugs.gnu.org
Received: via spool by 79787-submit <at> debbugs.gnu.org id=B79787.176268349511273
          (code B ref 79787); Sun, 09 Nov 2025 10:19:01 +0000
Received: (at 79787) by debbugs.gnu.org; 9 Nov 2025 10:18:15 +0000
Received: from localhost ([127.0.0.1]:58047 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vI2Uw-0002vl-Ke
	for submit <at> debbugs.gnu.org; Sun, 09 Nov 2025 05:18:15 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:58456)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vI2Ut-0002vW-Cp
 for 79787 <at> debbugs.gnu.org; Sun, 09 Nov 2025 05:18:12 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1vI2Un-0001kQ-8v; Sun, 09 Nov 2025 05:18:05 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=XZMe7/zzQML1BsEwllIG3uiqpAiUBPVBftQahDs7Rbo=; b=TXvw+Cmc6fLw
 jQa4Moxvcv1GZpndpW7EWr1lfFkYjvephMoCi1scY3pKClE/DZC6VLbWymxyD0yjUMd+Zk1F6Nkqp
 a6OfY0ljfzkPNSLuRV5k8qgEwpiIqx2h7WfTH7/hzTqD3gsRqSYSQ2T6BYj2oaEisVuYBl7GeTftr
 r6P9YOSQqOI5ydWpqP/F2HjWrqryaEDj+HpmDUPkkz1FX/UZ23lqqJK46jxoogEwkhPo+kP8HI/sA
 NUfCcGQRgzuvFOjQuBfhfhhb7OdKo5fPd7TpOtT4O5eFUM5euuv8KRMRvt6t4lb4YNL31s86nrsbY
 bM3DGCqaLn8JYyN9uV1FLw==;
Date: Sun, 09 Nov 2025 12:18:02 +0200
Message-Id: <86zf8v4ihx.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <87wm40954s.fsf@localhost> (message from Ihor Radchenko on Sat,
 08 Nov 2025 10:43:37 +0000)
References: <87wm40954s.fsf@localhost>
X-Spam-Score: -2.3 (--)
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: Ihor Radchenko <yantar92@HIDDEN>
> Date: Sat, 08 Nov 2025 10:43:37 +0000
> 
>  (let (ovs)
>    (with-current-buffer (generate-new-buffer "*temp*")
>      (display-buffer-below-selected (current-buffer) nil)
>      (insert "\n\n12345789")
>      (goto-char (point-min))
>      (with-silent-modifications
>        (search-forward "1")
>        (backward-char)
>        (put-text-property (+ (point) 2) (+ (point) 4) 'invisible t)
>        (read-char "Press any key (part of 123456789 hidden)")
>        (dolist (offset '(0 1 2 3 4 5 6 7 8))
> 	 (push (make-overlay (+ offset (point)) (+ offset (point) 1)) ovs)
> 	 (overlay-put (car ovs) 'display (copy-sequence "!")))
>        (message "NOW, move cursor across 123456789 string, observe point jumping across some !"))))
> 
> When we put an overlay with 'display property on top of 'invisible text,
> the overlay takes precedence and the text from 'display is visible on
> place of the underlying text.
> 
> However, point adjustment does not seem to account for this scenario -
> the point gets adjusted to bypass 'invisible text anyway, which is
> unexpected as the point jumps over the visible overlay.
> 
> This issue has been originally reported in https://orgmode.org/list/87ms50z1bp.fsf@localhost

Point adjustment is not the only (nor the main) player here.  The
other, more important player is the display-engine code which decides
where to show the cursor when the text at point is not on display.

The patch at the end of this message improves the situation, I hope
enough to close this issue.  It fixes the following simpler test case:

  ;; -*- lexical-binding: t -*-
  (switch-to-buffer (get-buffer-create "foo"))
  (erase-buffer)
  (insert "\n\n1234567890")
  (goto-char (point-min))
  (search-forward "1")
  (backward-char)
  (put-text-property (+ (point) 2) (+ (point) 4) 'invisible t)
  (overlay-put (make-overlay (+ (point) 2) (+ (point) 3)) 'display (copy-sequence "!!!"))

in that we now correctly jump the cursor when point moves across the
display string "!!!".  The patch also (AFAIU) solves the original
recipe from the bug reported to the Org list.  The test case that
started the bug report, which sets 9 different adjacent
display-property overlays, is improved, in that we only skip 1 "!",
not more, but doesn't solve it completely.  However, given that these
are display strings that we normally jump over anyway, I don't see the
result as a problem, unless a real-life case exists where it does
cause problems.

Please try the patch and tell if it causes any left-overs.

Stefan, any comments or better ideas?

diff --git a/src/keyboard.c b/src/keyboard.c
index a9cbd10..fe2484b 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1841,10 +1841,22 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified)
 	 point-motion hooks, intangibility, etc.  */
 	  eassert (PT == beg || PT == end);
 #endif
-
 	  /* Pretend the area doesn't exist if the buffer is not
-	     modified.  */
-	  if (!modified && !ellipsis && beg < end)
+	     modified, but only if the invisible text is not shown on
+	     display.  If it _is_ shown, we don't need to move point,
+	     since the normal display of the cursor will DTRT.
+	     Invisible text might be "shown on display" if there's an
+	     overlay with a replacing display property on the same text:
+	     then whatever is specified by the display property will be
+	     shown instead of the invisible text.  */
+	  bool shown =
+	    !NILP (val = get_char_property_and_overlay
+			   (make_fixnum (beg), Qdisplay, selected_window,
+			    &overlay))
+	    && display_prop_intangible_p (val, overlay, beg, CHAR_TO_BYTE (beg))
+	    && OVERLAYP (overlay);
+
+	  if (!modified && !shown && !ellipsis && beg < end)
 	    {
 	      if (last_pt == beg && PT == end && end < ZV)
 		(check_composition = check_display = true, SET_PT (end + 1));




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#79787: 31.0.50; Unexpected point adjustment when passing over text that has 'invisible property and an overlay with 'display on top
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 09 Nov 2025 13:33:02 +0000
Resent-Message-ID: <handler.79787.B79787.176269514230992 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 79787
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: yantar92@HIDDEN, monnier@HIDDEN
Cc: 79787 <at> debbugs.gnu.org
Received: via spool by 79787-submit <at> debbugs.gnu.org id=B79787.176269514230992
          (code B ref 79787); Sun, 09 Nov 2025 13:33:02 +0000
Received: (at 79787) by debbugs.gnu.org; 9 Nov 2025 13:32:22 +0000
Received: from localhost ([127.0.0.1]:58849 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vI5Wn-00083o-IH
	for submit <at> debbugs.gnu.org; Sun, 09 Nov 2025 08:32:22 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:36718)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vI5Wk-00083N-UM
 for 79787 <at> debbugs.gnu.org; Sun, 09 Nov 2025 08:32:20 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1vI5We-0007SM-LN; Sun, 09 Nov 2025 08:32:12 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=0Uv38dv25ilAKFQU9ZMDV0QEaiWS3+9R+iCi8lymWgk=; b=d1cYawWtJAC9
 dCHKfGk9hY5Y5kaCwaG3S+sowU9Rf83k6M83Khkx45W6+adH/6Wg9b6BTJIPTfOKRp/b1X3xu5pSU
 hTFUFPGfEduNkOp5Jr3+zFEU4sJu3BoTBH6Xy0Oi5u26spgwniaaGmi6BKWCcbKBxH02WbPBQzULB
 ltAdB7ArUmZYO0Gen5pVG99fa2Hd0DyoMv7n7CKLKPmpFehDPaUeEPftvjhK6R2cbl78tN5KY+6gt
 oRzPbNBHCrb7KcKhBCbKEsG37V8yE24P1GfoFsx2qaJ+sF8znlyx7DCQ8CX5H/nrBerILsQBWHf+L
 pm/fOxhNesZoMEsndNck8w==;
Date: Sun, 09 Nov 2025 15:32:07 +0200
Message-Id: <86wm3z49ig.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <86zf8v4ihx.fsf@HIDDEN> (message from Eli Zaretskii on Sun, 09
 Nov 2025 12:18:02 +0200)
References: <87wm40954s.fsf@localhost> <86zf8v4ihx.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
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 (---)

> Cc: 79787 <at> debbugs.gnu.org
> Date: Sun, 09 Nov 2025 12:18:02 +0200
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> > From: Ihor Radchenko <yantar92@HIDDEN>
> > Date: Sat, 08 Nov 2025 10:43:37 +0000
> > 
> >  (let (ovs)
> >    (with-current-buffer (generate-new-buffer "*temp*")
> >      (display-buffer-below-selected (current-buffer) nil)
> >      (insert "\n\n12345789")
> >      (goto-char (point-min))
> >      (with-silent-modifications
> >        (search-forward "1")
> >        (backward-char)
> >        (put-text-property (+ (point) 2) (+ (point) 4) 'invisible t)
> >        (read-char "Press any key (part of 123456789 hidden)")
> >        (dolist (offset '(0 1 2 3 4 5 6 7 8))
> > 	 (push (make-overlay (+ offset (point)) (+ offset (point) 1)) ovs)
> > 	 (overlay-put (car ovs) 'display (copy-sequence "!")))
> >        (message "NOW, move cursor across 123456789 string, observe point jumping across some !"))))
> > 
> > When we put an overlay with 'display property on top of 'invisible text,
> > the overlay takes precedence and the text from 'display is visible on
> > place of the underlying text.
> > 
> > However, point adjustment does not seem to account for this scenario -
> > the point gets adjusted to bypass 'invisible text anyway, which is
> > unexpected as the point jumps over the visible overlay.
> > 
> > This issue has been originally reported in https://orgmode.org/list/87ms50z1bp.fsf@localhost
> 
> Point adjustment is not the only (nor the main) player here.  The
> other, more important player is the display-engine code which decides
> where to show the cursor when the text at point is not on display.
> 
> The patch at the end of this message improves the situation, I hope
> enough to close this issue.  It fixes the following simpler test case:
> 
>   ;; -*- lexical-binding: t -*-
>   (switch-to-buffer (get-buffer-create "foo"))
>   (erase-buffer)
>   (insert "\n\n1234567890")
>   (goto-char (point-min))
>   (search-forward "1")
>   (backward-char)
>   (put-text-property (+ (point) 2) (+ (point) 4) 'invisible t)
>   (overlay-put (make-overlay (+ (point) 2) (+ (point) 3)) 'display (copy-sequence "!!!"))
> 
> in that we now correctly jump the cursor when point moves across the
> display string "!!!".  The patch also (AFAIU) solves the original
> recipe from the bug reported to the Org list.  The test case that
> started the bug report, which sets 9 different adjacent
> display-property overlays, is improved, in that we only skip 1 "!",
> not more, but doesn't solve it completely.  However, given that these
> are display strings that we normally jump over anyway, I don't see the
> result as a problem, unless a real-life case exists where it does
> cause problems.

Scratch that and use the improved patch below, which also fix3es the
original recipe.

diff --git a/src/keyboard.c b/src/keyboard.c
index a9cbd10..ac69d8f 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1726,7 +1726,7 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified)
      deleting characters around point.  */
   bool check_composition = ! modified;
   bool check_display = true, check_invisible = true;
-  ptrdiff_t orig_pt = PT;
+  ptrdiff_t orig_pt = PT, pt_before_invis = PT;
 
   eassert (XBUFFER (XWINDOW (selected_window)->contents) == current_buffer);
 
@@ -1765,6 +1765,7 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified)
 	  check_composition = check_invisible = true;
 	}
       check_display = false;
+      pt_before_invis = PT;
       if (check_invisible && PT > BEGV && PT < ZV)
 	{
 	  int inv;
@@ -1841,10 +1842,28 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified)
 	 point-motion hooks, intangibility, etc.  */
 	  eassert (PT == beg || PT == end);
 #endif
-
 	  /* Pretend the area doesn't exist if the buffer is not
-	     modified.  */
-	  if (!modified && !ellipsis && beg < end)
+	     modified, but only if the invisible text is not shown on
+	     display.  If it _is_ shown, we don't need to move point,
+	     since the normal display of the cursor will DTRT.
+	     Invisible text might be "shown on display" if there's an
+	     overlay with a replacing display property on the same text:
+	     then whatever is specified by the display property will be
+	     shown instead of the invisible text.  */
+	  bool shown =
+	    !NILP (val = get_char_property_and_overlay
+			   (make_fixnum (beg), Qdisplay, selected_window,
+			    &overlay))
+	    && display_prop_intangible_p (val, overlay, beg, CHAR_TO_BYTE (beg))
+	    && OVERLAYP (overlay);
+
+	  /* If the "invisible" text is shown, undo any point
+             adjustments due to invisible property, as cursor
+             positioning will do the job better.  */
+	  if (shown)
+	    SET_PT (pt_before_invis);
+
+	  if (!modified && !shown && !ellipsis && beg < end)
 	    {
 	      if (last_pt == beg && PT == end && end < ZV)
 		(check_composition = check_display = true, SET_PT (end + 1));




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#79787: 31.0.50; Unexpected point adjustment when passing over text that has 'invisible property and an overlay with 'display on top
Resent-From: Ihor Radchenko <yantar92@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 16 Nov 2025 11:28:02 +0000
Resent-Message-ID: <handler.79787.B79787.17632924263805 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 79787
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 79787 <at> debbugs.gnu.org, monnier@HIDDEN
Received: via spool by 79787-submit <at> debbugs.gnu.org id=B79787.17632924263805
          (code B ref 79787); Sun, 16 Nov 2025 11:28:02 +0000
Received: (at 79787) by debbugs.gnu.org; 16 Nov 2025 11:27:06 +0000
Received: from localhost ([127.0.0.1]:43730 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKauP-0000zI-PG
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 06:27:06 -0500
Received: from mout01.posteo.de ([185.67.36.65]:46045)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1vKauO-0000yS-9V
 for 79787 <at> debbugs.gnu.org; Sun, 16 Nov 2025 06:27:04 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 25C6A240027
 for <79787 <at> debbugs.gnu.org>; Sun, 16 Nov 2025 12:26:56 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017;
 t=1763292417; bh=f2agJHli3relAm2RFqoVGqmCrhvKvBk2vmd0s7VM+vo=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=VHG7S7A/ac+O6PJEC+yChCm8gp9cCxNqHMxQhNpFT+DHOixoSDZrslEct4roFwZDm
 rWBgt9uRQ/Es6OehoiIdKKicbODjNowVDaRbhuUm6pRtBfmNRxV3inAf/tFwERqnt5
 2q7KHsfN0aDlaGoklDzAQWTeaNtBsEevksh9S/UbaXEl9MGko1mMmyjM45+/1o0Jcf
 MEVFoi4BI7c+Sf4SPS7p8pdejjGT6MHo/sSC4Ya8klgFG8pWEFAwsZOMdJO8Rp+6Kb
 MCPH2IdrWsHUWt2t9hdTJVjqGwW5/oX5elO7BtSw9B2BM9FVFhkVg/q16z+4MOUkC2
 2GxccXf7i+s9g==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4d8T9X0dJgz9rxD;
 Sun, 16 Nov 2025 12:26:55 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <86wm3z49ig.fsf@HIDDEN>
References: <87wm40954s.fsf@localhost> <86zf8v4ihx.fsf@HIDDEN>
 <86wm3z49ig.fsf@HIDDEN>
Date: Sun, 16 Nov 2025 11:26:56 +0000
Message-ID: <87tsyui5g7.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
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:

> Scratch that and use the improved patch below, which also fix3es the
> original recipe.
>
> diff --git a/src/keyboard.c b/src/keyboard.c

Works for me. Both with my recipe and with the original bug report for
Org mode.

>  +	    !NILP (val = get_char_property_and_overlay
>  +			   (make_fixnum (beg), Qdisplay, selected_window,
>  +			    &overlay))
>  +	    && display_prop_intangible_p (val, overlay, beg, CHAR_TO_BYTE (beg))
>  +	    && OVERLAYP (overlay); # <<<<<<<<<<-------------

What if there is a display *text* property?

(let (ovs)
   (with-current-buffer (generate-new-buffer "*temp*")
     (display-buffer-below-selected (current-buffer) nil)
     (insert "\n\n12345789")
     (goto-char (point-min))
     (with-silent-modifications
       (search-forward "1")
       (backward-char)
       (put-text-property (+ (point) 2) (+ (point) 4) 'invisible t)
       (read-char "Press any key (part of 123456789 hidden)")
       (dolist (offset '(0 1 2 3 4 5 6 7))
	 (put-text-property (+ offset (point)) (+ offset (point) 1) 'display (copy-sequence "!")))
       (message "NOW, move cursor across 123456789 string, observe point jumping across some !"))))

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#79787: 31.0.50; Unexpected point adjustment when passing over text that has 'invisible property and an overlay with 'display on top
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 16 Nov 2025 14:25:02 +0000
Resent-Message-ID: <handler.79787.B79787.17633030438964 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 79787
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Ihor Radchenko <yantar92@HIDDEN>
Cc: 79787 <at> debbugs.gnu.org, monnier@HIDDEN
Received: via spool by 79787-submit <at> debbugs.gnu.org id=B79787.17633030438964
          (code B ref 79787); Sun, 16 Nov 2025 14:25:02 +0000
Received: (at 79787) by debbugs.gnu.org; 16 Nov 2025 14:24:03 +0000
Received: from localhost ([127.0.0.1]:45120 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKdfe-0002KW-TX
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 09:24:03 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:57382)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vKdfd-0002K0-Aj
 for 79787 <at> debbugs.gnu.org; Sun, 16 Nov 2025 09:24:02 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1vKdfW-0007MX-Fy; Sun, 16 Nov 2025 09:23:54 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=pqsI10jpmWNb+Fyw1Y8j+sHD3Li7RrFFNnzK+mmJfe4=; b=oLrR+TXzD38h
 9fE+97eBUyT3fq6qC0m2l7nVrSnkMlOGJl6FdoPs0NNNd6/yXFRXb4I3mfVddW97QHYnBvl/KLixc
 E8k4xOOOn6PYamBp0+WlssaUQ8vyZlMbn20nZ6stNH5/q85lZhjSCn59l6CK6QFbzhAebGbRLt7iS
 jIYAd3QuR470fyVw1YZ2tKvozrXnDyI1EUhoECY5iRXOJiVeakQ9muXzcI/MnIr0UXTr0193lEKKv
 sKGQk7jX6owzyez2DBJDbmjP96++AJswnRcew0VGgULcaDcydt7LRUmzVc30qhAGw1bdSIVW071WR
 Nca2htYUkfHJnlNTeBb7UQ==;
Date: Sun, 16 Nov 2025 16:23:50 +0200
Message-Id: <86a50mm4y1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <87tsyui5g7.fsf@localhost> (message from Ihor Radchenko on Sun,
 16 Nov 2025 11:26:56 +0000)
References: <87wm40954s.fsf@localhost> <86zf8v4ihx.fsf@HIDDEN>
 <86wm3z49ig.fsf@HIDDEN> <87tsyui5g7.fsf@localhost>
X-Spam-Score: -2.3 (--)
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: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 79787 <at> debbugs.gnu.org
> Date: Sun, 16 Nov 2025 11:26:56 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > Scratch that and use the improved patch below, which also fix3es the
> > original recipe.
> >
> > diff --git a/src/keyboard.c b/src/keyboard.c
> 
> Works for me. Both with my recipe and with the original bug report for
> Org mode.

Thanks, will install shortly.

> >  +	    !NILP (val = get_char_property_and_overlay
> >  +			   (make_fixnum (beg), Qdisplay, selected_window,
> >  +			    &overlay))
> >  +	    && display_prop_intangible_p (val, overlay, beg, CHAR_TO_BYTE (beg))
> >  +	    && OVERLAYP (overlay); # <<<<<<<<<<-------------
> 
> What if there is a display *text* property?

A display text property cannot "reveal" the invisible text as overlays
do.  The display engine examines the 'display' properties before
'invisible', and if it sees a 'display' property, 'invisible' on the
same or "enclosed" text is effectively ignored (not examined at all).
And if the invisible text encloses the one with 'display' property,
then the 'display' property is ignored.  So in this case, we will show
either the value of the 'display' property, and nothing for the
invisible text, or nothing at all.  This is unlike what happens with
overlays.

So I don't think that case is relevant, but if you can come up with an
example of any problems in the case of text properties, please show
it.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#79787: 31.0.50; Unexpected point adjustment when passing over text that has 'invisible property and an overlay with 'display on top
Resent-From: Ihor Radchenko <yantar92@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 16 Nov 2025 14:33:02 +0000
Resent-Message-ID: <handler.79787.B79787.176330354311326 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 79787
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 79787 <at> debbugs.gnu.org, monnier@HIDDEN
Received: via spool by 79787-submit <at> debbugs.gnu.org id=B79787.176330354311326
          (code B ref 79787); Sun, 16 Nov 2025 14:33:02 +0000
Received: (at 79787) by debbugs.gnu.org; 16 Nov 2025 14:32:23 +0000
Received: from localhost ([127.0.0.1]:45198 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKdni-0002wc-QI
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 09:32:23 -0500
Received: from mout01.posteo.de ([185.67.36.65]:57333)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1vKdng-0002wP-G6
 for 79787 <at> debbugs.gnu.org; Sun, 16 Nov 2025 09:32:21 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id C52F6240028
 for <79787 <at> debbugs.gnu.org>; Sun, 16 Nov 2025 15:32:13 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017;
 t=1763303533; bh=A7SoFSI1Th3nhlkgDnUeLfaMqyxXQzbJJ7s3bbT7Hvg=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=o/gAZZjg+j8O0GKmoU7BiBmls+RVtGx39/LxFs8pEekFui7XnG+jUD94m6wH0qhZl
 5udJiDCjLx1W1IZIqWGavVWQYBIZBq/vKE9Tvbudbu+DkgwlGZCvoAXGPnO84SszIW
 Zc3jI8Qf9E4vfKLFPoZslRtYiSscH9XRhEpS0aHYgxFgSehYHjmHiqJ7BV3+AVMjh8
 9eLX5EoxiFaYt2u9E3XrasiWEEOQrAjc0oITIBm1mMWV0RH5n7lfAeiLyYJtjP5bLJ
 XwchjxKL9sxty3ZxHLWry0K2JhjucUijaoMR0wMYoDXBR3LdoIEv687zfCx+WrHl17
 DKTXHRdmNacbQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4d8YHJ6M7Qz6tw2;
 Sun, 16 Nov 2025 15:32:12 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <86a50mm4y1.fsf@HIDDEN>
References: <87wm40954s.fsf@localhost> <86zf8v4ihx.fsf@HIDDEN>
 <86wm3z49ig.fsf@HIDDEN> <87tsyui5g7.fsf@localhost>
 <86a50mm4y1.fsf@HIDDEN>
Date: Sun, 16 Nov 2025 14:32:13 +0000
Message-ID: <87346ehwve.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
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:

> So I don't think that case is relevant, but if you can come up with an
> example of any problems in the case of text properties, please show
> it.

What about the modified reproducer I provided?
You will still get the "jumpy" cursor behavior over the visible "!".

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Message sent:


MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Eli Zaretskii <eliz@HIDDEN>
Subject: bug#79787: closed (31.0.50; Unexpected point adjustment when
 passing over text that has 'invisible property and an overlay with
 'display on top)
CC: tracker <at> debbugs.gnu.org
Message-ID: <handler.79787.D79787.176330402912646.ackdone <at> debbugs.gnu.org>
References: <864iqum46l.fsf@HIDDEN> <87wm40954s.fsf@localhost>
X-Gnu-PR-Message: closed 79787
X-Gnu-PR-Package: emacs
Date: Sun, 16 Nov 2025 14:41:01 +0000
Content-Type: multipart/mixed; boundary="----------=_1763304061-12682-0"

This is a multi-part message in MIME format...

------------=_1763304061-12682-0
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8

Your message dated Sun, 16 Nov 2025 16:40:18 +0200
with message-id <864iqum46l.fsf@HIDDEN>
and subject line Re: bug#79787: 31.0.50; Unexpected point adjustment when p=
assing over text that has 'invisible property and an overlay with 'display =
on top
has caused the debbugs.gnu.org bug report #79787,
regarding 31.0.50; Unexpected point adjustment when passing over text that =
has 'invisible property and an overlay with 'display on top
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@HIDDEN)


--=20
79787: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D79787
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems

------------=_1763304061-12682-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at submit) by debbugs.gnu.org; 8 Nov 2025 10:43:56 +0000
Received: from localhost ([127.0.0.1]:50934 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vHgQF-0007i4-L1
	for submit <at> debbugs.gnu.org; Sat, 08 Nov 2025 05:43:56 -0500
Received: from lists.gnu.org ([2001:470:142::17]:50642)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1vHgQC-0007hs-D1
 for submit <at> debbugs.gnu.org; Sat, 08 Nov 2025 05:43:53 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>)
 id 1vHgQ3-0006U3-2F
 for bug-gnu-emacs@HIDDEN; Sat, 08 Nov 2025 05:43:43 -0500
Received: from mout02.posteo.de ([185.67.36.66])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>)
 id 1vHgQ0-0002ET-KB
 for bug-gnu-emacs@HIDDEN; Sat, 08 Nov 2025 05:43:42 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 1F63D240101
 for <bug-gnu-emacs@HIDDEN>; Sat,  8 Nov 2025 11:43:37 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017;
 t=1762598618; bh=jJXwqWMCv6r5B4uNtbLrMx+fKTQ7yNKlRNASvkP3xJQ=;
 h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From;
 b=U88YA+eI+HvxAqSprNtx89MEc2xLTNVj0D4OPq5o/FZukiw1rN1yo7KT+QD8epncc
 wa5K4EVuiRU/unK/Pz2xbZ51SsDzEWfczm1gm8fRzAbclojXPgJljXjl4OoJQ2NLqC
 ImtLROEdmtXBKfr9WKRmvaj6Dmuc5RRexx/hjAEMZ3hNbII8kh9/Y8nddLHzdyKEdV
 u13Ud3woh1v+hb7HPMndbWZUsSJ5nWJqmYgMcnc3PbPC9t0lQK9OlYTZ+dMp60vryI
 TXjOQbga+01u8Id79WtqodhUFWNRXFBgU0dTlsrz8BOLhz+fHs9N/qLIYgnP46eAen
 aeZ4q34tW2s7A==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4d3XbF4Dnmz9rxG
 for <bug-gnu-emacs@HIDDEN>; Sat,  8 Nov 2025 11:43:37 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.50; Unexpected point adjustment when passing over text that
 has 'invisible property and an overlay with 'display on top
X-Debbugs-Cc: 
Date: Sat, 08 Nov 2025 10:43:37 +0000
Message-ID: <87wm40954s.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@HIDDEN;
 helo=mout02.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
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: -0.0 (/)

Hello,

Consider the following reproducer

 (let (ovs)
   (with-current-buffer (generate-new-buffer "*temp*")
     (display-buffer-below-selected (current-buffer) nil)
     (insert "\n\n12345789")
     (goto-char (point-min))
     (with-silent-modifications
       (search-forward "1")
       (backward-char)
       (put-text-property (+ (point) 2) (+ (point) 4) 'invisible t)
       (read-char "Press any key (part of 123456789 hidden)")
       (dolist (offset '(0 1 2 3 4 5 6 7 8))
	 (push (make-overlay (+ offset (point)) (+ offset (point) 1)) ovs)
	 (overlay-put (car ovs) 'display (copy-sequence "!")))
       (message "NOW, move cursor across 123456789 string, observe point jumping across some !"))))

When we put an overlay with 'display property on top of 'invisible text,
the overlay takes precedence and the text from 'display is visible on
place of the underlying text.

However, point adjustment does not seem to account for this scenario -
the point gets adjusted to bypass 'invisible text anyway, which is
unexpected as the point jumps over the visible overlay.

This issue has been originally reported in https://orgmode.org/list/87ms50z1bp.fsf@localhost


In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, cairo version
 1.18.4) of 2025-04-28 built on localhost
Repository revision: 509cbe1c35b3dd005a53ac041f9c87ee53b8e115
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101018
System Description: Gentoo Linux

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



------------=_1763304061-12682-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at 79787-done) by debbugs.gnu.org; 16 Nov 2025 14:40:29 +0000
Received: from localhost ([127.0.0.1]:45266 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKdvZ-0003Hu-Cx
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 09:40:29 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:40186)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vKdvW-0003Ho-Ss
 for 79787-done <at> debbugs.gnu.org; Sun, 16 Nov 2025 09:40:27 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1vKdvR-0004SH-9I; Sun, 16 Nov 2025 09:40:21 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=A4M3SMs7qnaVN27qbR8YbPW7uah/dF+fgL2hmhO0hDc=; b=Jb1RXs02sbKH
 dru5fUuwzm6+m9bs0PJgNnj6PJebFjAUW5EST+EUGJbenut9cWbADlYRDkvlNQJKu8T+NLg3pOhy4
 fV4vXQHuIhl9GixyOVCr2Lg0jsv4OrEliFzzAvdvh0bBcJU5ooywduk4sZEBaqCJdTjM+iROyBtTh
 ModUuEQCjhqHaDvgsHkAlzAuNEEEeQzNDD6WowqyhmTBtYKEFZuj2QShPrw+oUQbVNA5TzAJR7kJR
 7j5FMOMiQckoZ34tD0xD3nng5WzxBOvmSXpmRu2Fp5vtox2VZ0+QtcPE6CA+6YZAW8xB4rg2YIEjN
 752sAXx38Pu4HR9oRRRVSw==;
Date: Sun, 16 Nov 2025 16:40:18 +0200
Message-Id: <864iqum46l.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yantar92@HIDDEN
In-Reply-To: <86a50mm4y1.fsf@HIDDEN> (message from Eli Zaretskii on Sun, 16
 Nov 2025 16:23:50 +0200)
Subject: Re: bug#79787: 31.0.50;
 Unexpected point adjustment when passing over text that has
 'invisible property and an overlay with 'display on top
References: <87wm40954s.fsf@localhost> <86zf8v4ihx.fsf@HIDDEN>
 <86wm3z49ig.fsf@HIDDEN> <87tsyui5g7.fsf@localhost> <86a50mm4y1.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79787-done
Cc: 79787-done <at> debbugs.gnu.org, monnier@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 (---)

> Cc: 79787 <at> debbugs.gnu.org, monnier@HIDDEN
> Date: Sun, 16 Nov 2025 16:23:50 +0200
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> > From: Ihor Radchenko <yantar92@HIDDEN>
> > Cc: monnier@HIDDEN, 79787 <at> debbugs.gnu.org
> > Date: Sun, 16 Nov 2025 11:26:56 +0000
> > 
> > Eli Zaretskii <eliz@HIDDEN> writes:
> > 
> > > Scratch that and use the improved patch below, which also fix3es the
> > > original recipe.
> > >
> > > diff --git a/src/keyboard.c b/src/keyboard.c
> > 
> > Works for me. Both with my recipe and with the original bug report for
> > Org mode.
> 
> Thanks, will install shortly.

Now installed on the master branch, and closing the bug.


------------=_1763304061-12682-0--


Message sent:


MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: bug#79787: closed (Re: bug#79787: 31.0.50; Unexpected point
 adjustment when passing over text that has 'invisible property and an
 overlay with 'display on top)
Message-ID: <handler.79787.D79787.176330402912646.notifdone <at> debbugs.gnu.org>
References: <864iqum46l.fsf@HIDDEN> <87wm40954s.fsf@localhost>
X-Gnu-PR-Message: they-closed 79787
X-Gnu-PR-Package: emacs
Reply-To: 79787 <at> debbugs.gnu.org
Date: Sun, 16 Nov 2025 14:41:02 +0000
Content-Type: multipart/mixed; boundary="----------=_1763304062-12682-1"

This is a multi-part message in MIME format...

------------=_1763304062-12682-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"

Your bug report

#79787: 31.0.50; Unexpected point adjustment when passing over text that ha=
s 'invisible property and an overlay with 'display on top

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 79787 <at> debbugs.gnu.org.

--=20
79787: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D79787
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems

------------=_1763304062-12682-1
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at 79787-done) by debbugs.gnu.org; 16 Nov 2025 14:40:29 +0000
Received: from localhost ([127.0.0.1]:45266 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKdvZ-0003Hu-Cx
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 09:40:29 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:40186)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vKdvW-0003Ho-Ss
 for 79787-done <at> debbugs.gnu.org; Sun, 16 Nov 2025 09:40:27 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1vKdvR-0004SH-9I; Sun, 16 Nov 2025 09:40:21 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=A4M3SMs7qnaVN27qbR8YbPW7uah/dF+fgL2hmhO0hDc=; b=Jb1RXs02sbKH
 dru5fUuwzm6+m9bs0PJgNnj6PJebFjAUW5EST+EUGJbenut9cWbADlYRDkvlNQJKu8T+NLg3pOhy4
 fV4vXQHuIhl9GixyOVCr2Lg0jsv4OrEliFzzAvdvh0bBcJU5ooywduk4sZEBaqCJdTjM+iROyBtTh
 ModUuEQCjhqHaDvgsHkAlzAuNEEEeQzNDD6WowqyhmTBtYKEFZuj2QShPrw+oUQbVNA5TzAJR7kJR
 7j5FMOMiQckoZ34tD0xD3nng5WzxBOvmSXpmRu2Fp5vtox2VZ0+QtcPE6CA+6YZAW8xB4rg2YIEjN
 752sAXx38Pu4HR9oRRRVSw==;
Date: Sun, 16 Nov 2025 16:40:18 +0200
Message-Id: <864iqum46l.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: yantar92@HIDDEN
In-Reply-To: <86a50mm4y1.fsf@HIDDEN> (message from Eli Zaretskii on Sun, 16
 Nov 2025 16:23:50 +0200)
Subject: Re: bug#79787: 31.0.50;
 Unexpected point adjustment when passing over text that has
 'invisible property and an overlay with 'display on top
References: <87wm40954s.fsf@localhost> <86zf8v4ihx.fsf@HIDDEN>
 <86wm3z49ig.fsf@HIDDEN> <87tsyui5g7.fsf@localhost> <86a50mm4y1.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79787-done
Cc: 79787-done <at> debbugs.gnu.org, monnier@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 (---)

> Cc: 79787 <at> debbugs.gnu.org, monnier@HIDDEN
> Date: Sun, 16 Nov 2025 16:23:50 +0200
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> > From: Ihor Radchenko <yantar92@HIDDEN>
> > Cc: monnier@HIDDEN, 79787 <at> debbugs.gnu.org
> > Date: Sun, 16 Nov 2025 11:26:56 +0000
> > 
> > Eli Zaretskii <eliz@HIDDEN> writes:
> > 
> > > Scratch that and use the improved patch below, which also fix3es the
> > > original recipe.
> > >
> > > diff --git a/src/keyboard.c b/src/keyboard.c
> > 
> > Works for me. Both with my recipe and with the original bug report for
> > Org mode.
> 
> Thanks, will install shortly.

Now installed on the master branch, and closing the bug.


------------=_1763304062-12682-1
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at submit) by debbugs.gnu.org; 8 Nov 2025 10:43:56 +0000
Received: from localhost ([127.0.0.1]:50934 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vHgQF-0007i4-L1
	for submit <at> debbugs.gnu.org; Sat, 08 Nov 2025 05:43:56 -0500
Received: from lists.gnu.org ([2001:470:142::17]:50642)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1vHgQC-0007hs-D1
 for submit <at> debbugs.gnu.org; Sat, 08 Nov 2025 05:43:53 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>)
 id 1vHgQ3-0006U3-2F
 for bug-gnu-emacs@HIDDEN; Sat, 08 Nov 2025 05:43:43 -0500
Received: from mout02.posteo.de ([185.67.36.66])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>)
 id 1vHgQ0-0002ET-KB
 for bug-gnu-emacs@HIDDEN; Sat, 08 Nov 2025 05:43:42 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 1F63D240101
 for <bug-gnu-emacs@HIDDEN>; Sat,  8 Nov 2025 11:43:37 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017;
 t=1762598618; bh=jJXwqWMCv6r5B4uNtbLrMx+fKTQ7yNKlRNASvkP3xJQ=;
 h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From;
 b=U88YA+eI+HvxAqSprNtx89MEc2xLTNVj0D4OPq5o/FZukiw1rN1yo7KT+QD8epncc
 wa5K4EVuiRU/unK/Pz2xbZ51SsDzEWfczm1gm8fRzAbclojXPgJljXjl4OoJQ2NLqC
 ImtLROEdmtXBKfr9WKRmvaj6Dmuc5RRexx/hjAEMZ3hNbII8kh9/Y8nddLHzdyKEdV
 u13Ud3woh1v+hb7HPMndbWZUsSJ5nWJqmYgMcnc3PbPC9t0lQK9OlYTZ+dMp60vryI
 TXjOQbga+01u8Id79WtqodhUFWNRXFBgU0dTlsrz8BOLhz+fHs9N/qLIYgnP46eAen
 aeZ4q34tW2s7A==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4d3XbF4Dnmz9rxG
 for <bug-gnu-emacs@HIDDEN>; Sat,  8 Nov 2025 11:43:37 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.50; Unexpected point adjustment when passing over text that
 has 'invisible property and an overlay with 'display on top
X-Debbugs-Cc: 
Date: Sat, 08 Nov 2025 10:43:37 +0000
Message-ID: <87wm40954s.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@HIDDEN;
 helo=mout02.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
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: -0.0 (/)

Hello,

Consider the following reproducer

 (let (ovs)
   (with-current-buffer (generate-new-buffer "*temp*")
     (display-buffer-below-selected (current-buffer) nil)
     (insert "\n\n12345789")
     (goto-char (point-min))
     (with-silent-modifications
       (search-forward "1")
       (backward-char)
       (put-text-property (+ (point) 2) (+ (point) 4) 'invisible t)
       (read-char "Press any key (part of 123456789 hidden)")
       (dolist (offset '(0 1 2 3 4 5 6 7 8))
	 (push (make-overlay (+ offset (point)) (+ offset (point) 1)) ovs)
	 (overlay-put (car ovs) 'display (copy-sequence "!")))
       (message "NOW, move cursor across 123456789 string, observe point jumping across some !"))))

When we put an overlay with 'display property on top of 'invisible text,
the overlay takes precedence and the text from 'display is visible on
place of the underlying text.

However, point adjustment does not seem to account for this scenario -
the point gets adjusted to bypass 'invisible text anyway, which is
unexpected as the point jumps over the visible overlay.

This issue has been originally reported in https://orgmode.org/list/87ms50z1bp.fsf@localhost


In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, cairo version
 1.18.4) of 2025-04-28 built on localhost
Repository revision: 509cbe1c35b3dd005a53ac041f9c87ee53b8e115
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101018
System Description: Gentoo Linux

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



------------=_1763304062-12682-1--


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#79787: 31.0.50; Unexpected point adjustment when passing over text that has 'invisible property and an overlay with 'display on top
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 16 Nov 2025 15:03:02 +0000
Resent-Message-ID: <handler.79787.B79787.176330535816550 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 79787
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Ihor Radchenko <yantar92@HIDDEN>
Cc: 79787 <at> debbugs.gnu.org, monnier@HIDDEN
Received: via spool by 79787-submit <at> debbugs.gnu.org id=B79787.176330535816550
          (code B ref 79787); Sun, 16 Nov 2025 15:03:02 +0000
Received: (at 79787) by debbugs.gnu.org; 16 Nov 2025 15:02:38 +0000
Received: from localhost ([127.0.0.1]:45587 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKeGz-0004Is-PF
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 10:02:38 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:60304)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vKeGx-0004IY-7s
 for 79787 <at> debbugs.gnu.org; Sun, 16 Nov 2025 10:02:35 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1vKeGr-0001CU-RX; Sun, 16 Nov 2025 10:02:29 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=HlyQeIevRCCwoiOl1nZbybjZ0BdEy+UEodkMSl3kYuU=; b=PDk+fVpW6796
 wYvSzxGUiBzF5lm2VplXA/SooSvTnn3GtniEgm/4gvafKUpsPb1omRiFXJDJytnqdTKXNJKeyduiP
 5/boBzClRzLkZPhG2Lq3VzooReNLfVGxNWGkNkNJvilzjCwVPKrX61n3cX8SZ5ujiJZvP0hrgA58X
 b0ZBeTec2pg8YcKls8VCBbmJ3QjWyggv+nsZEdAi0OHAINASChFRlDDTRl+xgDcUxU4kCrBku/Hyf
 V1fVr8YskOdmx7uWgVtdsIHLmV33bjS0ltrJb05TRsapJgvX2euA/DsR92TtGls9cI6tWBIzhxH65
 +AD6cqQ7qgXQCdskXQw6cQ==;
Date: Sun, 16 Nov 2025 17:02:26 +0200
Message-Id: <86346em35p.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <87346ehwve.fsf@localhost> (message from Ihor Radchenko on Sun,
 16 Nov 2025 14:32:13 +0000)
References: <87wm40954s.fsf@localhost> <86zf8v4ihx.fsf@HIDDEN>
 <86wm3z49ig.fsf@HIDDEN> <87tsyui5g7.fsf@localhost>
 <86a50mm4y1.fsf@HIDDEN> <87346ehwve.fsf@localhost>
X-Spam-Score: -2.3 (--)
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: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 79787 <at> debbugs.gnu.org
> Date: Sun, 16 Nov 2025 14:32:13 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > So I don't think that case is relevant, but if you can come up with an
> > example of any problems in the case of text properties, please show
> > it.
> 
> What about the modified reproducer I provided?
> You will still get the "jumpy" cursor behavior over the visible "!".

Why do you think that's a problem?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#79787: 31.0.50; Unexpected point adjustment when passing over text that has 'invisible property and an overlay with 'display on top
Resent-From: Ihor Radchenko <yantar92@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 16 Nov 2025 15:06:01 +0000
Resent-Message-ID: <handler.79787.B79787.176330553717259 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 79787
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 79787 <at> debbugs.gnu.org, monnier@HIDDEN
Received: via spool by 79787-submit <at> debbugs.gnu.org id=B79787.176330553717259
          (code B ref 79787); Sun, 16 Nov 2025 15:06:01 +0000
Received: (at 79787) by debbugs.gnu.org; 16 Nov 2025 15:05:37 +0000
Received: from localhost ([127.0.0.1]:45601 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKeJt-0004UI-GU
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 10:05:37 -0500
Received: from mout01.posteo.de ([185.67.36.65]:33361)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1vKeJr-0004Tz-Qi
 for 79787 <at> debbugs.gnu.org; Sun, 16 Nov 2025 10:05:36 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id A25B0240027
 for <79787 <at> debbugs.gnu.org>; Sun, 16 Nov 2025 16:05:29 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net; s=2017;
 t=1763305529; bh=sHaDMpZN5VzonI1eYTETIvZPDgkBei4Bzk2r0bfNsog=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=pCP87EXW7CoX82/FuHK4Iv9uTBCH2f67U9F050kutUerzSn2S3IJCKLHMxwqLYECY
 2wpwf4W5/CZI8yTACuuiik4QVdfMEWijDKefd3W73uNSXsSxwEXN1G6N5UolgNgbA4
 SQf7JH1Z4S7bOOA4eAtBCNMLI0dh0rx4RZU4C7ylmCaz1bYvgyA44mMusLrKsjuJRW
 0oJTDbVflYFoATRjq+EK3waQiX0iNSuR4x/RGqTtOrSp4S7YsWzhc5XdBVOHs/uby2
 0DrLxlE1rn7sCil/u8XiWAlPHIcr8sCn5urVSWO/3pshaCNj9xTxv/WUaJjINTt9Yu
 J9v/l36HYT7og==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4d8Z1h3kvrz9rwn;
 Sun, 16 Nov 2025 16:05:28 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <86346em35p.fsf@HIDDEN>
References: <87wm40954s.fsf@localhost> <86zf8v4ihx.fsf@HIDDEN>
 <86wm3z49ig.fsf@HIDDEN> <87tsyui5g7.fsf@localhost>
 <86a50mm4y1.fsf@HIDDEN> <87346ehwve.fsf@localhost>
 <86346em35p.fsf@HIDDEN>
Date: Sun, 16 Nov 2025 15:05:29 +0000
Message-ID: <87qztyggrj.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
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:
>> What about the modified reproducer I provided?
>> You will still get the "jumpy" cursor behavior over the visible "!".
>
> Why do you think that's a problem?

Because the cursor behavior is unexpected. From the point of view of
users, it should not matter whether display/invisible combination is
caused by overlays or just by text properties.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#79787: 31.0.50; Unexpected point adjustment when passing over text that has 'invisible property and an overlay with 'display on top
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 16 Nov 2025 15:13:01 +0000
Resent-Message-ID: <handler.79787.B79787.176330593318605 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 79787
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Ihor Radchenko <yantar92@HIDDEN>
Cc: 79787 <at> debbugs.gnu.org, monnier@HIDDEN
Received: via spool by 79787-submit <at> debbugs.gnu.org id=B79787.176330593318605
          (code B ref 79787); Sun, 16 Nov 2025 15:13:01 +0000
Received: (at 79787) by debbugs.gnu.org; 16 Nov 2025 15:12:13 +0000
Received: from localhost ([127.0.0.1]:45659 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vKeQG-0004py-TH
	for submit <at> debbugs.gnu.org; Sun, 16 Nov 2025 10:12:13 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:49814)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1vKeQE-0004pf-DS
 for 79787 <at> debbugs.gnu.org; Sun, 16 Nov 2025 10:12:11 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1vKeQ8-0003Dq-Hb; Sun, 16 Nov 2025 10:12:04 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=ep3I+1Tb/3864liV9y8iwzmHmnzUGwywfBISJ+4M+Sw=; b=JGqXfEgSzdI2
 tvl/y9THuWl9iot2A/XwWb/wJJsHBiRY3N9rNWN8OGtk5CVOeULaJwGOMxSd86zZGRHEsJhbxVwkn
 dF6/iGbdled/WEGIxKfBHOsdKBEy6ybwwhvQ0RjWa+Lcl1lY3LTXYeNVIXj6dVzaUDUyZLrLRvs9F
 yhzSXOYg0Pztb+qBPLs9lD50KCH4iDtgb8X92lAyLxm7UrxEhICymIozlMMDEQ7ME2ZkmSOZpQWez
 Abvy3w9FVa6xJdE5I2hwY/agkWfpuCOIROwlLH6+vWshggWDA0oGlLokz4hn50lUjXedu8301u28o
 F9V3lEfdGxfoRmaiutmKsQ==;
Date: Sun, 16 Nov 2025 17:12:01 +0200
Message-Id: <86y0o6ko5a.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <87qztyggrj.fsf@localhost> (message from Ihor Radchenko on Sun,
 16 Nov 2025 15:05:29 +0000)
References: <87wm40954s.fsf@localhost> <86zf8v4ihx.fsf@HIDDEN>
 <86wm3z49ig.fsf@HIDDEN> <87tsyui5g7.fsf@localhost>
 <86a50mm4y1.fsf@HIDDEN> <87346ehwve.fsf@localhost>
 <86346em35p.fsf@HIDDEN> <87qztyggrj.fsf@localhost>
X-Spam-Score: -2.3 (--)
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: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 79787 <at> debbugs.gnu.org
> Date: Sun, 16 Nov 2025 15:05:29 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> >> What about the modified reproducer I provided?
> >> You will still get the "jumpy" cursor behavior over the visible "!".
> >
> > Why do you think that's a problem?
> 
> Because the cursor behavior is unexpected. From the point of view of
> users, it should not matter whether display/invisible combination is
> caused by overlays or just by text properties.

How it is more unexpected than the jump across invisible text, or
across a display string?





Last modified: Sun, 16 Nov 2025 15:15:02 UTC

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