GNU bug report logs - #64696
30.0.50; indent-to inherits preceding text properties, including 'invisible

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: Ihor Radchenko <yantar92@HIDDEN>; dated Tue, 18 Jul 2023 07:59:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 64696) by debbugs.gnu.org; 28 Jul 2023 14:17:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 28 10:17:13 2023
Received: from localhost ([127.0.0.1]:45836 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qPOHJ-0002Ub-6s
	for submit <at> debbugs.gnu.org; Fri, 28 Jul 2023 10:17:13 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:50280)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qPOHH-0002UO-1c
 for 64696 <at> debbugs.gnu.org; Fri, 28 Jul 2023 10:17:12 -0400
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 1qPOHA-0001xv-Mz; Fri, 28 Jul 2023 10:17:04 -0400
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=YC//7uW3FRhlYkYG7a21WAnOG/bAf3TAgVvNW7NtKpQ=; b=JZWyyq4JYCjO
 NFwsKb7b6fDQ2bprXOjggjYScof9G/pPvJQcetmXgiD5uBk5qsQ75apZ7HgGGQ0BfV4gEpAx8gqNm
 LWQH+g5rnxC8wBIDM1q7AS7/i4FsS+8IUtGriv2V5/qOO2YSsbalJ7ojkdaqTXTSPLaQzGje89KYK
 km83VXfQGllEibZwZhv9EujsVFlLu3OT5S4zTS/cT7+Ik4kZ6gn5oo3XiV9FoNsB46x7HrnW3kwKB
 crEo/8sU/WLgni2vQ56PhIMprfax77Rdoo7XZzYEp4Zweu6QCq8L+yVhgb7qKEXnuYQOFYWg8xhdH
 bNrR9WJzqsp7N89vYiKnNg==;
Received: from [87.69.77.57] (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 1qPOHA-0005Rt-69; Fri, 28 Jul 2023 10:17:04 -0400
Date: Fri, 28 Jul 2023 17:17:56 +0300
Message-Id: <833518jf1n.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87zg3gp4tl.fsf@localhost> (message from Ihor Radchenko on Fri,
 28 Jul 2023 13:02:14 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <87a5vt2vx8.fsf@localhost>
 <831qh56vvz.fsf@HIDDEN> <871qh52nlw.fsf@localhost>
 <83pm4p5er8.fsf@HIDDEN> <874jm0mhgb.fsf@localhost>
 <831qh459sy.fsf@HIDDEN> <87jzuvq785.fsf@localhost>
 <835y6ca1ah.fsf@HIDDEN> <87zg3o8m2a.fsf@localhost>
 <83wmys8a2g.fsf@HIDDEN> <87v8ecrqib.fsf@localhost>
 <83bkg481g5.fsf@HIDDEN> <87bkg3rso5.fsf@localhost>
 <83wmyrt02d.fsf@HIDDEN> <87edkx3eoh.fsf@localhost>
 <jwvh6pog3y1.fsf-monnier+emacs@HIDDEN> <87zg3ge8ug.fsf@localhost>
 <83h6pojl48.fsf@HIDDEN> <878rb0ql0w.fsf@localhost>
 <834jlojj6o.fsf@HIDDEN> <87zg3gp4tl.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Fri, 28 Jul 2023 13:02:14 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > So you are saying that indent-to should take care of not inheriting
> > text properties from preceding text?  Or are there any other problems?
> 
> AFAIU, we concluded previously that non-inheriting text properties is a
> no-go because it will likely break things.

I'm not talking about all the properties, I'm talking only about
those that affect the visible width of whitespace.  Basically, only
'display' properties, I think.

> So, I think that `indent-to' should take care calculating space width
> accurately in the presence of :width and similar specs.
> 
> Not sure what to do with :align-to.

These could be accounted for, but some 'display' properties cannot.
For example, if the property value is a string, we will be unable to
indent at all.

> ... well, except the generic problem that `indent-to' may inherit
> 'display or 'invisible property that completely modifies how the
> inserted spaces/tabs are displayed.

Which is why 'invisible' should not be inherited by indent-to, if we
want it to do a better job.




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

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


Received: (at 64696) by debbugs.gnu.org; 28 Jul 2023 13:02:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 28 09:02:12 2023
Received: from localhost ([127.0.0.1]:44114 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qPN6i-0008V6-D1
	for submit <at> debbugs.gnu.org; Fri, 28 Jul 2023 09:02:12 -0400
Received: from mout01.posteo.de ([185.67.36.65]:39189)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qPN6g-0008Us-4f
 for 64696 <at> debbugs.gnu.org; Fri, 28 Jul 2023 09:02:11 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 315DA240029
 for <64696 <at> debbugs.gnu.org>; Fri, 28 Jul 2023 15:02:04 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1690549324; bh=yoFcotZqXJ7yriwKyx8TOHWQgO67HB0YBGdKfLffyTY=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=D1dl00zyv2AKQFxkg8gHPQbsVxMlr4KnlYOeENKptL0teNBIU1J4wiBq1lv+ThX6o
 M52SqicjcmyST1haXYj4fQhM8T5WVm93Tnsyc+/YcBrzU+Cwu5McGmxjAJfMTXXn8a
 TzADPgjn7mWb75T5aeyKHIGNPG97fTytm8/Wau6mIx/oMEcy/Vp0FQMfexm7FwBiPa
 xFc6QT6ydHYK8wGENznzpa7GdynpYAx1tcNIQ/BEwooQiqMTchz1h/QpCd2cFSaUlL
 fKqNCoOC8nbK3qZ1bZ3SDqYWAaGpNn//hLHGHhjG7klvBEN6bGZ0fU0CSAo2Aewk5D
 gPbB+b9t9BrlA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4RC77v0bW7z9rxK;
 Fri, 28 Jul 2023 15:02:02 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <834jlojj6o.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <87a5vt2vx8.fsf@localhost>
 <831qh56vvz.fsf@HIDDEN> <871qh52nlw.fsf@localhost>
 <83pm4p5er8.fsf@HIDDEN> <874jm0mhgb.fsf@localhost>
 <831qh459sy.fsf@HIDDEN> <87jzuvq785.fsf@localhost>
 <835y6ca1ah.fsf@HIDDEN> <87zg3o8m2a.fsf@localhost>
 <83wmys8a2g.fsf@HIDDEN> <87v8ecrqib.fsf@localhost>
 <83bkg481g5.fsf@HIDDEN> <87bkg3rso5.fsf@localhost>
 <83wmyrt02d.fsf@HIDDEN> <87edkx3eoh.fsf@localhost>
 <jwvh6pog3y1.fsf-monnier+emacs@HIDDEN> <87zg3ge8ug.fsf@localhost>
 <83h6pojl48.fsf@HIDDEN> <878rb0ql0w.fsf@localhost>
 <834jlojj6o.fsf@HIDDEN>
Date: Fri, 28 Jul 2023 13:02:14 +0000
Message-ID: <87zg3gp4tl.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> Width of spaces in particular can vary depending on the text properties.
>> (:width and :relative-width in 41.16.2 Specified Spaces section of Elisp manual)
>> Width of tabs can be controlled by tabs stops (AFAIU, I am not familiar
>> with this feature).
>
> So you are saying that indent-to should take care of not inheriting
> text properties from preceding text?  Or are there any other problems?

AFAIU, we concluded previously that non-inheriting text properties is a
no-go because it will likely break things.
So, I think that `indent-to' should take care calculating space width
accurately in the presence of :width and similar specs.

Not sure what to do with :align-to.

> As for tabs, the width is controlled by tab-width, but indent-to
> already takes that into consideration.  Am I missing something?  (If
> you are thinking about tab-stop-list, that is only used by commands
> that move or indent to tab stops, AFAIK.)

I was thinking about tab-stop-list, but, as I said, I am not familiar
with it. If you say that tab-width is the only single thing influencing
the display, then I do not see any problem.

... well, except the generic problem that `indent-to' may inherit
'display or 'invisible property that completely modifies how the
inserted spaces/tabs are displayed. But I do not see any useful way to
account for 'display/'invisible other than by ignoring it. Changing
number of spaces/tabs will not affect the resulting display in such
scenarios.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 28 Jul 2023 12:47:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 28 08:47:49 2023
Received: from localhost ([127.0.0.1]:44079 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qPMsn-00080c-2R
	for submit <at> debbugs.gnu.org; Fri, 28 Jul 2023 08:47:49 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:52262)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qPMsk-0007zn-6v
 for 64696 <at> debbugs.gnu.org; Fri, 28 Jul 2023 08:47:47 -0400
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 1qPMsd-000333-Af; Fri, 28 Jul 2023 08:47:40 -0400
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=qxdW8WfKvSN/FPQtD3BidAPCGhpEIQNbyfuE6hrsGBY=; b=O+TP1EuaRADW
 p2LS/upHCZIFORKZx+X7LBzDiHDp5SNYEmqL1bfikpKVpy67XwUP+j8pE38Tj9YfNSVCUgG2mA7YA
 pkM5SQG4h2Hd2FRlyDUrOqDi6yZzTkNCP+5aWNiyIIq2T2wEHuHoFpTwY+UX7zKDxhfw8S9ZH6hSe
 ft8oAfhYzRPrFb1nyYsn3wjcXxT0vZjA0FCaqKpYpvU2zk7sd3tWOuZQ8Rde5NDSd8TYGQd9FPUw6
 0EsySsIgQ9qVJhJsbeQkuFo4qo+JJk+K9OxVc2IugJiPluZUpHrlpyqhQBlmVLByc8VKeTCJ1+r9i
 N+XIM0hgV0xGW3rPKKypRg==;
Received: from [87.69.77.57] (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 1qPMsc-0003Zz-Kz; Fri, 28 Jul 2023 08:47:38 -0400
Date: Fri, 28 Jul 2023 15:48:31 +0300
Message-Id: <834jlojj6o.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <878rb0ql0w.fsf@localhost> (message from Ihor Radchenko on Fri,
 28 Jul 2023 12:26:55 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <87jzux2zg8.fsf@localhost>
 <83351l74ci.fsf@HIDDEN> <87a5vt2vx8.fsf@localhost>
 <831qh56vvz.fsf@HIDDEN> <871qh52nlw.fsf@localhost>
 <83pm4p5er8.fsf@HIDDEN> <874jm0mhgb.fsf@localhost>
 <831qh459sy.fsf@HIDDEN> <87jzuvq785.fsf@localhost>
 <835y6ca1ah.fsf@HIDDEN> <87zg3o8m2a.fsf@localhost>
 <83wmys8a2g.fsf@HIDDEN> <87v8ecrqib.fsf@localhost>
 <83bkg481g5.fsf@HIDDEN> <87bkg3rso5.fsf@localhost>
 <83wmyrt02d.fsf@HIDDEN> <87edkx3eoh.fsf@localhost>
 <jwvh6pog3y1.fsf-monnier+emacs@HIDDEN> <87zg3ge8ug.fsf@localhost>
 <83h6pojl48.fsf@HIDDEN> <878rb0ql0w.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Fri, 28 Jul 2023 12:26:55 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> Now, when we established that Emacs indentation is visual, it is clear
> >> that the assumption in `indent-to' is not accurate.
> >
> > Since indent-to inserts only tabs and spaces, how is that assumption
> > inaccurate?
> 
> Width of spaces in particular can vary depending on the text properties.
> (:width and :relative-width in 41.16.2 Specified Spaces section of Elisp manual)
> Width of tabs can be controlled by tabs stops (AFAIU, I am not familiar
> with this feature).

So you are saying that indent-to should take care of not inheriting
text properties from preceding text?  Or are there any other problems?

As for tabs, the width is controlled by tab-width, but indent-to
already takes that into consideration.  Am I missing something?  (If
you are thinking about tab-stop-list, that is only used by commands
that move or indent to tab stops, AFAIK.)




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

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


Received: (at 64696) by debbugs.gnu.org; 28 Jul 2023 12:26:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 28 08:26:51 2023
Received: from localhost ([127.0.0.1]:44048 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qPMYU-0007P3-NR
	for submit <at> debbugs.gnu.org; Fri, 28 Jul 2023 08:26:51 -0400
Received: from mout01.posteo.de ([185.67.36.65]:55181)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qPMYT-0007On-6f
 for 64696 <at> debbugs.gnu.org; Fri, 28 Jul 2023 08:26:49 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id A4FBE240027
 for <64696 <at> debbugs.gnu.org>; Fri, 28 Jul 2023 14:26:43 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1690547203; bh=mlXuQCUFdhzSpbyVe/4FePhotPSyCW5ro1BqA3FZ+B4=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=ixT4LUTRKUX+6IxdOKryLdrsNGtP/KtZPtfuQUSHq1PeAdzNiZRK0uB7Ie6a4VJeH
 yhQjs9d3c/IHDSlAlpElWarQOlC7PrQ5Uj7XTHtKftpD0hUAvMLy5lHww7r09JoirO
 X1gFAOMzTT4an1pVLYQbtsbHGZhdqX1iCV+zDqhsSfAP9YG7Vtr1I9ZZJQbgo+YFV7
 3f+tCAmts1267lcvyzFYQSgnqp2Y5b7sqtPdMXDT6yxvMMq1jhqd6Y7KM+0a9c1AC2
 kGOFt63+0Q+nKy7JwLhv6ySI4UpJf7pW3ALrPgIWnB3Eo7LJQQ/6kbc/GhRXHzrUep
 3Be3Ma4EnndvA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4RC6M35zzYz6v0H;
 Fri, 28 Jul 2023 14:26:39 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <83h6pojl48.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <87jzux2zg8.fsf@localhost>
 <83351l74ci.fsf@HIDDEN> <87a5vt2vx8.fsf@localhost>
 <831qh56vvz.fsf@HIDDEN> <871qh52nlw.fsf@localhost>
 <83pm4p5er8.fsf@HIDDEN> <874jm0mhgb.fsf@localhost>
 <831qh459sy.fsf@HIDDEN> <87jzuvq785.fsf@localhost>
 <835y6ca1ah.fsf@HIDDEN> <87zg3o8m2a.fsf@localhost>
 <83wmys8a2g.fsf@HIDDEN> <87v8ecrqib.fsf@localhost>
 <83bkg481g5.fsf@HIDDEN> <87bkg3rso5.fsf@localhost>
 <83wmyrt02d.fsf@HIDDEN> <87edkx3eoh.fsf@localhost>
 <jwvh6pog3y1.fsf-monnier+emacs@HIDDEN> <87zg3ge8ug.fsf@localhost>
 <83h6pojl48.fsf@HIDDEN>
Date: Fri, 28 Jul 2023 12:26:55 +0000
Message-ID: <878rb0ql0w.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> Now, when we established that Emacs indentation is visual, it is clear
>> that the assumption in `indent-to' is not accurate.
>
> Since indent-to inserts only tabs and spaces, how is that assumption
> inaccurate?

Width of spaces in particular can vary depending on the text properties.
(:width and :relative-width in 41.16.2 Specified Spaces section of Elisp manual)
Width of tabs can be controlled by tabs stops (AFAIU, I am not familiar
with this feature).

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 28 Jul 2023 12:06:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 28 08:06:24 2023
Received: from localhost ([127.0.0.1]:43955 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qPMEh-0004G0-VG
	for submit <at> debbugs.gnu.org; Fri, 28 Jul 2023 08:06:24 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:57556)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qPMEg-0004EE-1b
 for 64696 <at> debbugs.gnu.org; Fri, 28 Jul 2023 08:06:22 -0400
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 1qPMEY-0003od-EJ; Fri, 28 Jul 2023 08:06:14 -0400
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=vdrM7SvjmbwnLBxtwtXoIbhN7z9IJN4XLnSRuSRodEE=; b=GyjW4d6LstH6
 l4ZP0Sxry7CrDwYsLR4GX5t8dblvYTPiWhX4MzxQZdQfiHp5DXjqzRTYRngSJ8/tRWxaaA8Z5Fv/x
 8lssEoVELcbojeUQdKi/FHdOh0p6aoa0pQy225dqPo/otzF7Vampig09EQULc14pDHnvjuv8lR7+0
 2EvVz7Aaz7DW1M7kH3jd4rOTPZZQrsXSeahEbOf1RAymiLrMyMfoB1w3fNRy7UqmkVUMzkydKff9O
 V/qAV1y1NBdLhy9NWIf5Clrsm0kdY43Rk5McdSIVElJ+D5uj7oL+6cd8efc+bxeRv9Hn0IjlxlZcU
 F+rIheOJf9rFFbb0O3b/ww==;
Received: from [87.69.77.57] (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 1qPMED-0004eY-NK; Fri, 28 Jul 2023 08:06:02 -0400
Date: Fri, 28 Jul 2023 15:06:47 +0300
Message-Id: <83h6pojl48.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87zg3ge8ug.fsf@localhost> (message from Ihor Radchenko on Fri,
 28 Jul 2023 08:30:47 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@HIDDEN>
 <87zg3o8m2a.fsf@localhost> <83wmys8a2g.fsf@HIDDEN>
 <87v8ecrqib.fsf@localhost> <83bkg481g5.fsf@HIDDEN>
 <87bkg3rso5.fsf@localhost> <83wmyrt02d.fsf@HIDDEN>
 <87edkx3eoh.fsf@localhost> <jwvh6pog3y1.fsf-monnier+emacs@HIDDEN>
 <87zg3ge8ug.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>, 64696 <at> debbugs.gnu.org
> Date: Fri, 28 Jul 2023 08:30:47 +0000
> 
> However, remember that this thread started with `indent-to' calculating
> target column without taking into account the display staff. While the
> initial column is using `current-column' and considers
> composition/faces/[partially] invisibility, the number of tabs/spaces to
> be inserted to reach target column are calculated assuming that each
> space occupies 1 column and each tab occupies tab-width columns.
> 
> Now, when we established that Emacs indentation is visual, it is clear
> that the assumption in `indent-to' is not accurate.

Since indent-to inserts only tabs and spaces, how is that assumption
inaccurate?




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

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


Received: (at 64696) by debbugs.gnu.org; 28 Jul 2023 11:51:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 28 07:51:45 2023
Received: from localhost ([127.0.0.1]:43918 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qPM0X-0003oI-0z
	for submit <at> debbugs.gnu.org; Fri, 28 Jul 2023 07:51:45 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:55574)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qPM0U-0003o4-HQ
 for 64696 <at> debbugs.gnu.org; Fri, 28 Jul 2023 07:51:43 -0400
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 1qPM0O-0004o8-8o; Fri, 28 Jul 2023 07:51:36 -0400
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=8NsXPv6jl+mw4D1bNPFbicfm3SmA+IqcezoGqEaOLAg=; b=C6cDnXAxmXsm
 hpwq5WnNIfcalx3PMEww7tuDkTvYB9UBhlNP067YX+EkI763F0QoZkXEit64YLNKmrvWerRqc5Z2P
 xxSPBTn2NkdZ4o4u2ZgoyMKVdW4jNhc0bhOpJX8CDQqQ4WWe8S0yXCNHMo5l7TYuJK4/9vaMYoQiu
 AC0hBTG5mHG24zRL8UCwp6xxfWoBeOlGJJN8VBfPlsFrqfU1gATaYskfsQtIKi3LFeWLvb4i7Nk11
 V49Qa070xT6HHJnIoK4cqtDDx+0XO3vbA6uP5VIgTfmZhVHbSOL15Vd437RywsFjjb+5hRzF5SqNq
 uU7D72Fcmel/COiAOlkgAA==;
Received: from [87.69.77.57] (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 1qPM0C-0002Dx-PD; Fri, 28 Jul 2023 07:51:35 -0400
Date: Fri, 28 Jul 2023 14:52:17 +0300
Message-Id: <83jzukjlse.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <877cqkfoip.fsf@localhost> (message from Ihor Radchenko on Fri,
 28 Jul 2023 08:06:54 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <87a5vt2vx8.fsf@localhost>
 <831qh56vvz.fsf@HIDDEN> <871qh52nlw.fsf@localhost>
 <83pm4p5er8.fsf@HIDDEN> <874jm0mhgb.fsf@localhost>
 <831qh459sy.fsf@HIDDEN> <87jzuvq785.fsf@localhost>
 <835y6ca1ah.fsf@HIDDEN> <87zg3o8m2a.fsf@localhost>
 <83wmys8a2g.fsf@HIDDEN> <87v8ecrqib.fsf@localhost>
 <83bkg481g5.fsf@HIDDEN> <87bkg3rso5.fsf@localhost>
 <83wmyrt02d.fsf@HIDDEN> <87edkx3eoh.fsf@localhost>
 <83bkg1sbg7.fsf@HIDDEN> <87zg3kqtbl.fsf@localhost>
 <83zg3kp3of.fsf@HIDDEN> <87fs597msx.fsf@localhost>
 <83a5vhn2ak.fsf@HIDDEN> <877cqkfoip.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Fri, 28 Jul 2023 08:06:54 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> Using :align-to space spec and font-lock-keywords.
> >> This can work, although it is unfortunate that there is no "stretch"
> >> space that will automatically occupy as much space as possible without
> >> pushing the line across right fringe.
> >
> > Of course, there is: use the 'right' position with a negative offset.
> 
> This indeed works, but the annoying part is calculating the offset.

What offset?  You said "occupy as much space as possible", which means
the offset from the right edge is zero, right?

> The most robust way would be delegating offset calculation to the
> redisplay of the actual line being displayed.

That would require that the display engine scans the screen line
twice.  That's unacceptable, both for performance reasons and because
it violates the basic design of how the Emacs display iteration works.
Sorry, that won't fly.

Why does Org need to take up all the available space of a window to
begin with, btw?

> One needs to use `string-pixel-width', which is not always reliable.

string-pixel-width uses the display code, so if it is unreliable, so
will be any other implementation in the display engine (barring any
bugs).  (Of course, you didn't reveal any details of this lack of
reliability, so I don't really know what are we talking about here.)

> >> I think that the main source of the confusion is the first line "Return
> >> width of STRING when displayed in the current buffer", which sounds like
> >> certain buffer-specific display things are affecting the result.
> >
> > Feel free to suggest a single short enough sentence which doesn't have
> > this issue, and yet does explain that the value is not just the count
> > of characters in the string.
> 
> Return width of STRING when displayed using fixed width font.

That loses information (the "current buffer" part: it's important).

Can you explain why "fixed width font" is important enough for you to
want to see it there?  After all, the function counts columns, so
whether the font is fixed-pitch or variable-pitch shouldn't matter.

> However, if I look into the code, it looks like buffer-display-table is
> also taking into account.

Yes.  Also character compositions.

> And string_char_and_length, which I do not fully understand.

That's unrelated.  string_char_and_length is just a convenient way of
walking multibyte text one character at a time.  It returns the
codepoint of the current character, and also returns the length of its
multibyte sequence, so it is easy to get to the next character in one
jump.  (Keep in mind that the basic movement across buffer text is
always by bytes, and a character can be represented by 1 to 5 bytes.)

> And glyphs appear to honor variable pitch font, if it is default.

No, they don't.  When the function finds characters that will be
composed on display, it computes the pixel-width of the result of the
composition, and then converts that into the units of the frame's
default face's font.  For that conversion, and for that conversion
only, the function needs the parameter of the default face's font that
tells us the width of its characters; if that font is variable-pitch
(unlikely), then these parameters give only some kind of average
width.

But again, all this access to the font parameters is only done for
composed characters, because character composition rules can produce
glyphs that have no corresponding codepoints, and therefore we cannot
look them up in char-width-table.




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

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


Received: (at 64696) by debbugs.gnu.org; 28 Jul 2023 08:30:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 28 04:30:44 2023
Received: from localhost ([127.0.0.1]:43591 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qPIs0-0004By-Gn
	for submit <at> debbugs.gnu.org; Fri, 28 Jul 2023 04:30:44 -0400
Received: from mout02.posteo.de ([185.67.36.66]:46853)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qPIrw-0004Bg-1N
 for 64696 <at> debbugs.gnu.org; Fri, 28 Jul 2023 04:30:42 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id E5289240104
 for <64696 <at> debbugs.gnu.org>; Fri, 28 Jul 2023 10:30:33 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1690533033; bh=/EteZqrROD/v9SzRSUoEh4vRm9EUI6qrMtsA0p/HA/o=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=nGJ3ApIfnnw4SdsZBlBA0joL3mA15g9K6BxPRQ57zlxVsgLQpg9zo71A3tbowecl1
 nSv6To59DKt3wr4VxT5TbwsTRLKt2dubgNiJoVwKip4WT8KjytSMUoavMguAoXPW/K
 cbnQ+PP/EjFr5zJ9maIhfnXEv+TMXd+hFB2iowjp0CagrfSSwokFrT5M4NFvGwDBkI
 momK/gmY/SudrpXjowTrw2lvA5rohyKUd3j9c+kYbMMwEm1vC8Oc9jCvvXoadRtqov
 LVAthRFlFlNp+1tKCh0J/LRN23sCoVNePSbsFTPXjpK8e1MndPRhmUTiIO59paZMa9
 m+xJmw0kjqb4Q==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4RC16d26Vyz6v18;
 Fri, 28 Jul 2023 10:30:32 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <jwvh6pog3y1.fsf-monnier+emacs@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@HIDDEN>
 <87zg3o8m2a.fsf@localhost> <83wmys8a2g.fsf@HIDDEN>
 <87v8ecrqib.fsf@localhost> <83bkg481g5.fsf@HIDDEN>
 <87bkg3rso5.fsf@localhost> <83wmyrt02d.fsf@HIDDEN>
 <87edkx3eoh.fsf@localhost> <jwvh6pog3y1.fsf-monnier+emacs@HIDDEN>
Date: Fri, 28 Jul 2023 08:30:47 +0000
Message-ID: <87zg3ge8ug.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: Eli Zaretskii <eliz@HIDDEN>, 64696 <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 (---)

Stefan Monnier <monnier@HIDDEN> writes:

> Presumably you'll also want to keep columns aligned dynamically as text
> is inserted/deleted.  I suspect that once you try to do that, it's
> fairly easy to temporarily let-bind `buffer-invisibility-spec` around
> the code that inserts SPCs&TABs to enforce the "vanilla" alignment.

Sure. Org is slowly moving in that direction - separating text alignment
and visual alignment. We have a persistent stream of related feature
requests.

However, remember that this thread started with `indent-to' calculating
target column without taking into account the display staff. While the
initial column is using `current-column' and considers
composition/faces/[partially] invisibility, the number of tabs/spaces to
be inserted to reach target column are calculated assuming that each
space occupies 1 column and each tab occupies tab-width columns.

Now, when we established that Emacs indentation is visual, it is clear
that the assumption in `indent-to' is not accurate.

>> Sure, but how can an application, say, disable all the effects of visual
>> representation without (1) searching and let-binding each specific
>
> Define "disable all the effects of visual representation".  I think what
> you mean is something like "pretend the text is displayed by sending it
> to an text terminal", but the width can depend on the specific text
> terminal (especially for non-ASCII Unicode chars, but also for chars <
> 32).  So it's a non-trivial problem, in reality.

You are right. Probably, a good goal would be "looks aligned in
fundamental-mode".

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 28 Jul 2023 08:06:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 28 04:06:50 2023
Received: from localhost ([127.0.0.1]:43578 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qPIUs-0000nq-Fc
	for submit <at> debbugs.gnu.org; Fri, 28 Jul 2023 04:06:50 -0400
Received: from mout02.posteo.de ([185.67.36.66]:40425)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qPIUp-0000nW-Jl
 for 64696 <at> debbugs.gnu.org; Fri, 28 Jul 2023 04:06:49 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id DEAB5240103
 for <64696 <at> debbugs.gnu.org>; Fri, 28 Jul 2023 10:06:41 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1690531601; bh=hhNJv33tQy8cIlxOng9XyqeAJXieGPNe+MZFTUHIlUE=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=QywuGf2AJjcx5Cnv4s3WEMFlOPnJZ4dve/dmNw7WCk9owY5+L29pHBBi9xhDQDt59
 70ueG3RizYSUW2r+sWPpzcOfgnLzKZV4F+UV1x2ZBP54fE6EqJI6UcMe6Kp/Z73EES
 L6UQSDVeWpa0r1lXkq8rw66pMi6u46TKmiE+WlRdObgRnLW1iF6d/OGqsNQv4nscYj
 y55lg0fz4tNx1ZlpS0gG1KGGRAAhVlMmgqwm8n5mgtG1EpUW1W0oFVS0z+CN0qTJQ5
 Z50iUiNBmTmZune0LSYRdKcmkcVDRmcIn0cNRxTTo8G8lXneCDCxYRkMTIIdHE3jae
 XhIBn0uOTK6Xg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4RC0b46d5Tz9s1d;
 Fri, 28 Jul 2023 10:06:40 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <83a5vhn2ak.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <87a5vt2vx8.fsf@localhost>
 <831qh56vvz.fsf@HIDDEN> <871qh52nlw.fsf@localhost>
 <83pm4p5er8.fsf@HIDDEN> <874jm0mhgb.fsf@localhost>
 <831qh459sy.fsf@HIDDEN> <87jzuvq785.fsf@localhost>
 <835y6ca1ah.fsf@HIDDEN> <87zg3o8m2a.fsf@localhost>
 <83wmys8a2g.fsf@HIDDEN> <87v8ecrqib.fsf@localhost>
 <83bkg481g5.fsf@HIDDEN> <87bkg3rso5.fsf@localhost>
 <83wmyrt02d.fsf@HIDDEN> <87edkx3eoh.fsf@localhost>
 <83bkg1sbg7.fsf@HIDDEN> <87zg3kqtbl.fsf@localhost>
 <83zg3kp3of.fsf@HIDDEN> <87fs597msx.fsf@localhost>
 <83a5vhn2ak.fsf@HIDDEN>
Date: Fri, 28 Jul 2023 08:06:54 +0000
Message-ID: <877cqkfoip.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> Using :align-to space spec and font-lock-keywords.
>> This can work, although it is unfortunate that there is no "stretch"
>> space that will automatically occupy as much space as possible without
>> pushing the line across right fringe.
>
> Of course, there is: use the 'right' position with a negative offset.

This indeed works, but the annoying part is calculating the offset. One
needs to use `string-pixel-width', which is not always reliable.(Org has
its own `org-string-width', but it is still not good enough and
sometimes creates a few pixel overflows leading to line wraps).

The most robust way would be delegating offset calculation to the
redisplay of the actual line being displayed. That will guarantee
absence of inconsistencies. That's why I asked for "stretch" space
feature.

>> I think that the main source of the confusion is the first line "Return
>> width of STRING when displayed in the current buffer", which sounds like
>> certain buffer-specific display things are affecting the result.
>
> Feel free to suggest a single short enough sentence which doesn't have
> this issue, and yet does explain that the value is not just the count
> of characters in the string.

Return width of STRING when displayed using fixed width font.


However, if I look into the code, it looks like buffer-display-table is
also taking into account. And string_char_and_length, which I do not
fully understand. And glyphs appear to honor variable pitch font, if it
is default.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 28 Jul 2023 02:54:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 27 22:54:12 2023
Received: from localhost ([127.0.0.1]:43341 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qPDcH-0000cG-3y
	for submit <at> debbugs.gnu.org; Thu, 27 Jul 2023 22:54:12 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:18920)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1qPDcB-0000be-Dn
 for 64696 <at> debbugs.gnu.org; Thu, 27 Jul 2023 22:54:07 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DE9E98005E;
 Thu, 27 Jul 2023 22:53:57 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1690512837;
 bh=eLbQfkACSDzLchNEmFhYm6MtdscD63Pl7k5tLCh481g=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=dGV4N9FHUKtemUgMNBuppvagrYtWAKWU+hOnmVBXZ4YrXNRW5dw9+rg5JlNZM4bLO
 CbySkWqkX6q3tU5kjIWRGKzglfKRYfhXD8IJfcQNwPloaIL06SUEF6lHHopOCWxcsZ
 VoeNmO8tuPPOaHPoeyVFUkpALQ36ph7wnvF6n7TdtYCTA53bcmLT1BJx+l/LOxJ6MQ
 MW4t1mocC7vF0ezavloMgtSyM+DDlsWC0dxuelmKU2EAFgP0AFEGYEwJvr3j7Uo34k
 2ZPd5Gt7ph6ll2aPlAdwR6ks8Txs0ION9EjpDW+iM6VWg3GtrwI4PxE4lQWAwLhUuM
 9MErN2TlFLz6g==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2FB3B801B2;
 Thu, 27 Jul 2023 22:53:57 -0400 (EDT)
Received: from alfajor (unknown [181.44.118.150])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 218B9120321;
 Thu, 27 Jul 2023 22:53:55 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <87edkx3eoh.fsf@localhost> (Ihor Radchenko's message of "Mon, 24
 Jul 2023 08:18:54 +0000")
Message-ID: <jwvh6pog3y1.fsf-monnier+emacs@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@HIDDEN>
 <87zg3o8m2a.fsf@localhost> <83wmys8a2g.fsf@HIDDEN>
 <87v8ecrqib.fsf@localhost> <83bkg481g5.fsf@HIDDEN>
 <87bkg3rso5.fsf@localhost> <83wmyrt02d.fsf@HIDDEN>
 <87edkx3eoh.fsf@localhost>
Date: Thu, 27 Jul 2023 22:53:53 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.251 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: Eli Zaretskii <eliz@HIDDEN>, 64696 <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 (---)

> For example, consider an Org table like
>
> | *This* | is | some text |
> | more |    |  text     |
>
> It looks aligned in Org buffers ("*" is invisible),

I just tried it in a vanilla Emacs-28 and "*" is not made invisible,
because `org-hide-emphasis-markers` defaults to nil.

> but not when copied to message buffer.

I think what you really want is that the above table be properly aligned
regardless of the value of `org-hide-emphasis-markers` and without
changing the buffer's char contents when changing the value of
`org-hide-emphasis-markers`, and I don't think you can do that without
adding `display` space properties dynamically in accordance with the
current value of `org-hide-emphasis-markers`.

Presumably you'll also want to keep columns aligned dynamically as text
is inserted/deleted.  I suspect that once you try to do that, it's
fairly easy to temporarily let-bind `buffer-invisibility-spec` around
the code that inserts SPCs&TABs to enforce the "vanilla" alignment.

Also enforcing this property that the text will be aligned both while
prettified in Emacs and when displayed in a text terminal may come with
the downside that some columns in Emacs will be "way too large" because
its width is determined by the width of the non-prettified text.

> Sure, but how can an application, say, disable all the effects of visual
> representation without (1) searching and let-binding each specific

Define "disable all the effects of visual representation".  I think what
you mean is something like "pretend the text is displayed by sending it
to an text terminal", but the width can depend on the specific text
terminal (especially for non-ASCII Unicode chars, but also for chars <
32).  So it's a non-trivial problem, in reality.


        Stefan





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

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


Received: (at 64696) by debbugs.gnu.org; 27 Jul 2023 09:14:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 27 05:14:34 2023
Received: from localhost ([127.0.0.1]:40747 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qOx4s-0002pk-EA
	for submit <at> debbugs.gnu.org; Thu, 27 Jul 2023 05:14:34 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:41298)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qOx4q-0002pV-3A
 for 64696 <at> debbugs.gnu.org; Thu, 27 Jul 2023 05:14:33 -0400
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 1qOx4k-0006Bj-Bs; Thu, 27 Jul 2023 05:14:26 -0400
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=bsLMNlEoRcrB6AsQsUXq8NrQZlBGtvMjnXqstxGzXIE=; b=agILYN4XtDQb
 fBHH7ujMcmTcZNh1hT/Yz+w/T5u1WLAGY09t7aZF/fH2fKwuK+rRqMUpgDogEuLm8VdnKtCaOhMBR
 MfNKECBdHKvNsSYdZucqsXyREtc56vIWUwWob4iBGbv47xxfm5fYW2nG1FPf7CmDktHgbvzjTqMwk
 ezaDtJd5YRAd3syDLPIyNhHnLSic64rwWGrUIrOvIP3hPPexrb0HPwtKvDEvXW21UiGhIt6OEd5C1
 W9ygyuQQylQaSWayAiQDWkGpzeWqx/TityY7o7briQP73YTWaCFxN98e1ZdOZbnABPKL02rleEH3Z
 D4oZH8RozLthaKkH++O5OQ==;
Received: from [87.69.77.57] (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 1qOx4j-0003qG-Ri; Thu, 27 Jul 2023 05:14:26 -0400
Date: Thu, 27 Jul 2023 12:15:15 +0300
Message-Id: <83a5vhn2ak.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87fs597msx.fsf@localhost> (message from Ihor Radchenko on Thu,
 27 Jul 2023 08:58:54 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <87jzux2zg8.fsf@localhost>
 <83351l74ci.fsf@HIDDEN> <87a5vt2vx8.fsf@localhost>
 <831qh56vvz.fsf@HIDDEN> <871qh52nlw.fsf@localhost>
 <83pm4p5er8.fsf@HIDDEN> <874jm0mhgb.fsf@localhost>
 <831qh459sy.fsf@HIDDEN> <87jzuvq785.fsf@localhost>
 <835y6ca1ah.fsf@HIDDEN> <87zg3o8m2a.fsf@localhost>
 <83wmys8a2g.fsf@HIDDEN> <87v8ecrqib.fsf@localhost>
 <83bkg481g5.fsf@HIDDEN> <87bkg3rso5.fsf@localhost>
 <83wmyrt02d.fsf@HIDDEN> <87edkx3eoh.fsf@localhost>
 <83bkg1sbg7.fsf@HIDDEN> <87zg3kqtbl.fsf@localhost>
 <83zg3kp3of.fsf@HIDDEN> <87fs597msx.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Thu, 27 Jul 2023 08:58:54 +0000
> 
> >> With visual part only using 'display text properties that do not
> >> modify the actual text in file.
> >
> > This will (a) not help you, because the issue of width of the
> > whitespace stretches will still be pertinent; and (b) will complicate
> > Emacs much more, because copying such "text" will become much more
> > tricky in general.
> 
> I am not sure if I understand the problem with copying. Certain text
> properties are already ignored when copying anyway.

Display properties are only supported in Emacs, so copying "outside"
will cause the text to look differently.  Likewise in Emacs, if
display properties are removed when copying.

> Using :align-to space spec and font-lock-keywords.
> This can work, although it is unfortunate that there is no "stretch"
> space that will automatically occupy as much space as possible without
> pushing the line across right fringe.

Of course, there is: use the 'right' position with a negative offset.

> I think that the main source of the confusion is the first line "Return
> width of STRING when displayed in the current buffer", which sounds like
> certain buffer-specific display things are affecting the result.

Feel free to suggest a single short enough sentence which doesn't have
this issue, and yet does explain that the value is not just the count
of characters in the string.




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

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


Received: (at 64696) by debbugs.gnu.org; 27 Jul 2023 08:58:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 27 04:58:52 2023
Received: from localhost ([127.0.0.1]:40726 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qOwpf-0002Pd-Mp
	for submit <at> debbugs.gnu.org; Thu, 27 Jul 2023 04:58:52 -0400
Received: from mout01.posteo.de ([185.67.36.65]:48517)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qOwpd-0002PP-8x
 for 64696 <at> debbugs.gnu.org; Thu, 27 Jul 2023 04:58:50 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 711BD240027
 for <64696 <at> debbugs.gnu.org>; Thu, 27 Jul 2023 10:58:43 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1690448323; bh=n4YQ4bQEyuYXujvz/t85LH8MZBgeA7w1GbBbffUNgKo=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:
 Content-Transfer-Encoding:From;
 b=lKfRj3ybg3Q+hxVbKTftIoGzevxO+QaC5ZtW8QdM6q58yz69UvtIaB1OXa6UzFyhD
 pWcrXNLVzx9bObXY89Ok+CQb0Epo7IMjl95jWhaU8uC4j64H7Qb0Euo4gfvDvX8xNs
 +P/5aKStpvNdlC4WflDCteRfTZSZ0TbspOTJVFi8co0PVlQYN5eb3EcJsPoDLE17re
 7fUrOKnsrZXz98VVELAf2CiyW7AVowGPlXGs2zyDVOn42mz13U9b9QYP7/gN4Dp2L4
 EOOrg1Z7T7BohCcIQI47piMvHiLJQsouybBRFigyB4eyMTOw1RnS4WHUqPq/VFszKe
 QUE41UeGggskg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4RBPnX62F7z6tvy;
 Thu, 27 Jul 2023 10:58:40 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <83zg3kp3of.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <87jzux2zg8.fsf@localhost>
 <83351l74ci.fsf@HIDDEN> <87a5vt2vx8.fsf@localhost>
 <831qh56vvz.fsf@HIDDEN> <871qh52nlw.fsf@localhost>
 <83pm4p5er8.fsf@HIDDEN> <874jm0mhgb.fsf@localhost>
 <831qh459sy.fsf@HIDDEN> <87jzuvq785.fsf@localhost>
 <835y6ca1ah.fsf@HIDDEN> <87zg3o8m2a.fsf@localhost>
 <83wmys8a2g.fsf@HIDDEN> <87v8ecrqib.fsf@localhost>
 <83bkg481g5.fsf@HIDDEN> <87bkg3rso5.fsf@localhost>
 <83wmyrt02d.fsf@HIDDEN> <87edkx3eoh.fsf@localhost>
 <83bkg1sbg7.fsf@HIDDEN> <87zg3kqtbl.fsf@localhost>
 <83zg3kp3of.fsf@HIDDEN>
Date: Thu, 27 Jul 2023 08:58:54 +0000
Message-ID: <87fs597msx.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> In the ideal world, Emacs would indent both visually and textually.
>
> I disagree that this is the ideal.  "Textual" indentation is not
> indentation at all, it is fundamentally a completely different feature
> for completely different purposes.  Even if we agree that Emacs should
> have it (and I don't yet agree), you shouldn't expect from the Emacs
> indentation to fill this niche, except by sheer luck in some use
> cases.

Got it.

>> With visual part only using 'display text properties that do not
>> modify the actual text in file.
>
> This will (a) not help you, because the issue of width of the
> whitespace stretches will still be pertinent; and (b) will complicate
> Emacs much more, because copying such "text" will become much more
> tricky in general.

I am not sure if I understand the problem with copying. Certain text
properties are already ignored when copying anyway.

> But if you want to work on adding this, please feel free.  It has its
> uses, even for indentation; see, for example, pixel-fill.el.  It is on
> our TODO to provide pixel-granularity indentation for text using
> variable-pitch fonts (but this again is for visual appearance only).

I did some preliminary work in Org mode.
For example, I tried to right-align tags like

|left fringe|* Heading                             :tag:|right fringe|

Using :align-to space spec and font-lock-keywords.
This can work, although it is unfortunate that there is no "stretch"
space that will automatically occupy as much space as possible without
pushing the line across right fringe.

Org also provides org-indent-mode that uses text properties to align
text visually.

>> I would use it in Org instead of `org-current-text-column'.
>
> So we have one user.  And even in your case, you don't want them all
> disabled: the character compositions, for example, should stay turned
> ON.

Sure. Especially if the composition is dictated by UTF standard.

>> may not hold in future (the docstring implies that `string-width' may as
>> well consider visuals: "Return width of STRING when displayed in the
>> current buffer.")
>
> Selective citation alert!  The full text of the doc string is:
>
>   Return width of STRING when displayed in the current buffer.
>   Width is measured by how many columns it occupies on the screen.
>   Optional arguments FROM and TO specify the substring of STRING to
>   consider, and are interpreted as in =E2=80=98substring=E2=80=99.
>
>   When calculating width of a multibyte character in STRING,
>   only the base leading-code is considered; the validity of
>   the following bytes is not checked.  Tabs in STRING are always
>   taken to occupy =E2=80=98tab-width=E2=80=99 columns.  The effect of fac=
es and fonts
>   used for non-Latin and other unusual characters (such as emoji) is
>   ignored as well, as are display properties and invisible text.
>   For these reasons, the results are not generally reliable;
>   for accurate dimensions of text as it will be displayed,
>   use =E2=80=98window-text-pixel-size=E2=80=99 instead.
>
> What else do you want us to say, for you to understand that the
> "visual" part here is quite limited?

It is clear that it is limited, but I am concerned that there are still
some display features (and possibly display features added in future)
that may change the behavior.

I think that the main source of the confusion is the first line "Return
width of STRING when displayed in the current buffer", which sounds like
certain buffer-specific display things are affecting the result.

--=20
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 25 Jul 2023 12:37:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 25 08:37:33 2023
Received: from localhost ([127.0.0.1]:44839 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qOHIC-00041q-PK
	for submit <at> debbugs.gnu.org; Tue, 25 Jul 2023 08:37:33 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:36620)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qOHIA-00041d-T8
 for 64696 <at> debbugs.gnu.org; Tue, 25 Jul 2023 08:37:31 -0400
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 1qOHI3-000364-Fv; Tue, 25 Jul 2023 08:37:24 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=yu1VUrOBm71qwC3STeSl5QwCuDrZ1CJ+bEPhjbwAWMM=; b=AIekU9s2CCEV+aZUCijH
 tE1FdOKIZzv0kNKVNZZkEaNwfbpCCw/2rcAv+LlhuAckbwylWDoCE3iGJvnSaFcRzcdUY/DcPjwoW
 06bcqfeSK7I5PriyCK3bhGqlccdH2+Q9v/eer/jZjExYYOua9KIbtAoOQ6Jgsnu7n0pjoPMRIQGPg
 jfVD1lDyBDl/md+it7WIx+H0QN64uG+pBlSuWQD8I6JU2KlA7pvymJO7crD/rEebvkfVNJPwnDmkv
 tYK9bYNVdvw6u0mZDpMbruZAgjeJ+VjGzMbyEBGa9kVx6lMRUClFFF50PJ3M3I0tdrginwd1OJETA
 x18RM1Y2x6WaYA==;
Received: from [87.69.77.57] (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 1qOHHm-00043L-OF; Tue, 25 Jul 2023 08:37:19 -0400
Date: Tue, 25 Jul 2023 15:37:52 +0300
Message-Id: <83zg3kp3of.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87zg3kqtbl.fsf@localhost> (message from Ihor Radchenko on Tue,
 25 Jul 2023 08:38:38 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@HIDDEN>
 <87zg3o8m2a.fsf@localhost> <83wmys8a2g.fsf@HIDDEN>
 <87v8ecrqib.fsf@localhost> <83bkg481g5.fsf@HIDDEN>
 <87bkg3rso5.fsf@localhost> <83wmyrt02d.fsf@HIDDEN>
 <87edkx3eoh.fsf@localhost> <83bkg1sbg7.fsf@HIDDEN> <87zg3kqtbl.fsf@localhost>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Tue, 25 Jul 2023 08:38:38 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> For example, consider an Org table like
> >> 
> >> | *This* | is | some text |
> >> | more |    |  text     |
> >> 
> >> It looks aligned in Org buffers ("*" is invisible), but not when copied
> >> to message buffer.
> >
> > Where does fontification enter this picture?
> 
> "*" is made invisible after fontification.

So these are not font-lock-* faces, right?

> > The important thing to remember is that Emacs makes all those
> > display-time transformation because that's how people want to see the
> > text on the screen.  It is very rare to see an application that wants
> > to show decomposed characters, as in a◌́ instead of á, or to see a TAB
> > shown as a single column.  Heck, even the display of control
> > characters, like , is part of this, and why would we want to turn
> > that off?
> >
> > IOW, the need for turning these off is extremely rare, and doesn't
> > justify such global toggles, because no one will use them.
> 
> I can see your point. However, this is sometimes conflicting with
> copying text verbatim or viewing it in other editors. For example,
> nameless-mode that visually compresses
> my-long-package-name-variable-name into :variable-name creates a lot of
> mess when the same file is committed to public repo and later opened by
> other contributors without nameless-mode enabled.

This might mean we need more intelligent commands that copy text
elsewhere.  However, note that it is OK for Emacs to expect other
software/media to share at least some of the visual features.  For
example, I have yet to see a text-rendering program that doesn't show
diacritics composed with the base characters, and most show Emoji as
you'd expect, not as a series of control codes.  OTOH, tabs could be
shown differently, especially if tab-width was customized.

But I think this is a relatively far tangent, as it is not immediately
related to indentation in Emacs itself.  In Emacs, indentation is a
display-oriented feature, so the few programming languages where
indentation is syntactically and semantically meaningful must do
something special when the buffer uses non-trivial Emacs display
features beyond tab expansion.  Invisible text, in particular, doesn't
go along well with such use cases.

> In the ideal world, Emacs would indent both visually and textually.

I disagree that this is the ideal.  "Textual" indentation is not
indentation at all, it is fundamentally a completely different feature
for completely different purposes.  Even if we agree that Emacs should
have it (and I don't yet agree), you shouldn't expect from the Emacs
indentation to fill this niche, except by sheer luck in some use
cases.

> With visual part only using 'display text properties that do not
> modify the actual text in file.

This will (a) not help you, because the issue of width of the
whitespace stretches will still be pertinent; and (b) will complicate
Emacs much more, because copying such "text" will become much more
tricky in general.

But if you want to work on adding this, please feel free.  It has its
uses, even for indentation; see, for example, pixel-fill.el.  It is on
our TODO to provide pixel-granularity indentation for text using
variable-pitch fonts (but this again is for visual appearance only).

> >> A toggle: disable all visual contributors.
> >
> > It will never be used.
> 
> I would use it in Org instead of `org-current-text-column'.

So we have one user.  And even in your case, you don't want them all
disabled: the character compositions, for example, should stay turned
ON.

> may not hold in future (the docstring implies that `string-width' may as
> well consider visuals: "Return width of STRING when displayed in the
> current buffer.")

Selective citation alert!  The full text of the doc string is:

  Return width of STRING when displayed in the current buffer.
  Width is measured by how many columns it occupies on the screen.
  Optional arguments FROM and TO specify the substring of STRING to
  consider, and are interpreted as in ‘substring’.

  When calculating width of a multibyte character in STRING,
  only the base leading-code is considered; the validity of
  the following bytes is not checked.  Tabs in STRING are always
  taken to occupy ‘tab-width’ columns.  The effect of faces and fonts
  used for non-Latin and other unusual characters (such as emoji) is
  ignored as well, as are display properties and invisible text.
  For these reasons, the results are not generally reliable;
  for accurate dimensions of text as it will be displayed,
  use ‘window-text-pixel-size’ instead.

What else do you want us to say, for you to understand that the
"visual" part here is quite limited?




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

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


Received: (at 64696) by debbugs.gnu.org; 25 Jul 2023 08:38:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 25 04:38:37 2023
Received: from localhost ([127.0.0.1]:44616 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qODYy-0003AC-Ny
	for submit <at> debbugs.gnu.org; Tue, 25 Jul 2023 04:38:37 -0400
Received: from mout01.posteo.de ([185.67.36.65]:59165)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qODYu-00039w-3d
 for 64696 <at> debbugs.gnu.org; Tue, 25 Jul 2023 04:38:35 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 19422240028
 for <64696 <at> debbugs.gnu.org>; Tue, 25 Jul 2023 10:38:26 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1690274306; bh=HBOCIynVJ2osclmzP2Jl9/ujR7FIZA1iMeZzHMx86Fw=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:
 Content-Transfer-Encoding:From;
 b=mhbOLMvcLPeL+rdaLAYRdrfYQY1Wf6JrZTie94K93pvSGAXz7sz7Z6gkUpGxpOy/7
 Zc8F1ZIPLjfMDFWxQLU0OMtJZfM4n6rWnwWPWekkjapMXKUV8OtenyQt49gOMimHj9
 SHhcoLra/f6KJrMc8b4WE4w+EucOsVTHdcj5AdAxvACIg2cWenNBJrfzkNFROxVw7b
 3OvF7KnummQ43bdJiqrhM5XafNArs9YRda9Lq2qW8vVv4JpzRvVEfnkTiW/kCfyRjB
 UXmYvHJCZA3A0BqU60HZoNiHKsuxab/+3as7mPcinBq8nwKsRwN4tXMYL/p49bBL6q
 aMlyjzA3mCKzQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R99R51F4vz6tm4;
 Tue, 25 Jul 2023 10:38:24 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <83bkg1sbg7.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@HIDDEN>
 <87zg3o8m2a.fsf@localhost> <83wmys8a2g.fsf@HIDDEN>
 <87v8ecrqib.fsf@localhost> <83bkg481g5.fsf@HIDDEN>
 <87bkg3rso5.fsf@localhost> <83wmyrt02d.fsf@HIDDEN>
 <87edkx3eoh.fsf@localhost> <83bkg1sbg7.fsf@HIDDEN>
Date: Tue, 25 Jul 2023 08:38:38 +0000
Message-ID: <87zg3kqtbl.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> For example, consider an Org table like
>>=20
>> | *This* | is | some text |
>> | more |    |  text     |
>>=20
>> It looks aligned in Org buffers ("*" is invisible), but not when copied
>> to message buffer.
>
> Where does fontification enter this picture?

"*" is made invisible after fontification.

Fontified:

 | This | is | some text |
 | more |    |  text     |

Unfontified

 | *This* | is | some text |
 | more |    |  text     |

> IOW, the tendency should be to provide _more_ visual indentation, by
> making our indentation commands smarter and more fine-grained (e.g.,
> pixel-wise), not to make them _less_ visual by disabling the important
> display features.
>
> The important thing to remember is that Emacs makes all those
> display-time transformation because that's how people want to see the
> text on the screen.  It is very rare to see an application that wants
> to show decomposed characters, as in a=E2=97=8C=CC=81 instead of a=CC=81,=
 or to see a TAB
> shown as a single column.  Heck, even the display of control
> characters, like , is part of this, and why would we want to turn
> that off?
>
> IOW, the need for turning these off is extremely rare, and doesn't
> justify such global toggles, because no one will use them.

I can see your point. However, this is sometimes conflicting with
copying text verbatim or viewing it in other editors. For example,
nameless-mode that visually compresses
my-long-package-name-variable-name into :variable-name creates a lot of
mess when the same file is committed to public repo and later opened by
other contributors without nameless-mode enabled.

In the ideal world, Emacs would indent both visually and textually. With
visual part only using 'display text properties that do not modify the
actual text in file.

>> It would help to list what contributes to indentation/columns in the
>> documentation.
>
> They are a legion.  Basically, every display-related feature described
> in the ELisp manual -- and there are a lot of them -- is of this
> nature.  Since we already describe them all in the manual, adding a
> section which mentions them all together is strictly not necessary for
> a reference manual.  It's more a job for a tutorial.
>
> You are asking that someone does a very large job of collecting
> existing stuff together, for facilitating a solution of some pretty
> rare problem.  I cannot justify a large job such as this one -- going
> through all the Emacs display features and describing them together --
> for this kind of purpose.  But if someone wants to work on that, I
> won't necessarily object if the result is concise and doesn't repeat
> the existing material.

I was mostly advocating the need in "disable them all" toggle as a less
maintenance-heavy alternative.

>> A toggle: disable all visual contributors.
>
> It will never be used.

I would use it in Org instead of `org-current-text-column'.
It currently relies upon `string-width' ignoring visuals, which may or
may not hold in future (the docstring implies that `string-width' may as
well consider visuals: "Return width of STRING when displayed in the
current buffer.")

--=20
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 24 Jul 2023 13:09:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 24 09:09:17 2023
Received: from localhost ([127.0.0.1]:42129 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qNvJG-0007En-Qr
	for submit <at> debbugs.gnu.org; Mon, 24 Jul 2023 09:09:16 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:59172)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qNvJ5-0007E6-Jz
 for 64696 <at> debbugs.gnu.org; Mon, 24 Jul 2023 09:09:08 -0400
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 1qNvIz-00032d-2E; Mon, 24 Jul 2023 09:08:53 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=md9id+wG8eooQOf79Y9eiOxYFhRRVgQBXXG4IQJb93k=; b=KruU107aXuRfCgeQC3t1
 c4hTOxHKSpEPntlXxblnqrUyYYb5fdiFCfsthajad7iPraGtgkAtCSC0dr6qBp3EpehfVcQL7FOqF
 ui5evbIDLbym6TYAtsuafeBa4UMbsWRM4QsMB0MTGNQXrGTDqkBYa6YOOH3cmnK/RVZl60l8z0Qnv
 JmnfhIavOwG5wpSJVPAStsPV1CAoDP+f6a/GFiKEwObF2L8KGi3rHfGLwP8UK2zfHaswfxHmlHNLD
 xHAgC9e4m1RfNIqVqwjeZXk36sOlbMzRlElT+JLFt4UXA3e8QD5S5NlijzSGZww6wWTJx7uzQ6OO0
 VtSz3+vunDKL4g==;
Received: from [87.69.77.57] (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 1qNvIs-0005PL-Gf; Mon, 24 Jul 2023 09:08:52 -0400
Date: Mon, 24 Jul 2023 16:09:28 +0300
Message-Id: <83bkg1sbg7.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87edkx3eoh.fsf@localhost> (message from Ihor Radchenko on Mon,
 24 Jul 2023 08:18:54 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@HIDDEN>
 <87zg3o8m2a.fsf@localhost> <83wmys8a2g.fsf@HIDDEN>
 <87v8ecrqib.fsf@localhost> <83bkg481g5.fsf@HIDDEN>
 <87bkg3rso5.fsf@localhost> <83wmyrt02d.fsf@HIDDEN> <87edkx3eoh.fsf@localhost>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Mon, 24 Jul 2023 08:18:54 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> 1. Org mode is generally aiming for the produced Org files to be
> >>    readable as unfontified plain text. So, quirks related to visual
> >>    indentation generally tend to mess things up.
> >
> > "Unfontified"?  AFAIK, Org files do use fontifications, don't they?
> > So what do you mean by "unfontified plain text" here?  But that's an
> > aside, feel free to ignore.
> 
> For example, consider an Org table like
> 
> | *This* | is | some text |
> | more |    |  text     |
> 
> It looks aligned in Org buffers ("*" is invisible), but not when copied
> to message buffer.

Where does fontification enter this picture?

> >> 2. Org mode uses indentation as part of the syntax. I had to get rid of
> >>    using `current-column' and calculated "true textual indentation"
> >>    manually to avoid breakage after `current-column' started to take
> >>    into account invisibility. (bug#56837)
> >
> > This cannot be avoided.  Emacs provides by default many features that
> > "mess up" this kind of "true textual indentation".  Some of these
> > features include:
> > ...
> > (I'm probably missing some more.)  Only the Lisp program knows which
> > of those are relevant to the particular application at hand.
> 
> Sure, but how can an application, say, disable all the effects of visual
> representation without (1) searching and let-binding each specific
> toggle (and possibly adding more in future versions of Emacs); (2)
> re-implementing the existing indentation code (like what
> `org-current-text-column' does)?

It can't.  But then it also doesn't want to.  In practice, most of
these features should not be turned off, because either the text will
become illegible, or the indentation performed when the features are
turned off will break when the text is displayed "normally".

IOW, the tendency should be to provide _more_ visual indentation, by
making our indentation commands smarter and more fine-grained (e.g.,
pixel-wise), not to make them _less_ visual by disabling the important
display features.

The important thing to remember is that Emacs makes all those
display-time transformation because that's how people want to see the
text on the screen.  It is very rare to see an application that wants
to show decomposed characters, as in a◌́ instead of á, or to see a TAB
shown as a single column.  Heck, even the display of control
characters, like , is part of this, and why would we want to turn
that off?

IOW, the need for turning these off is extremely rare, and doesn't
justify such global toggles, because no one will use them.

> > We could introduce separate indentation/current-column knobs for each
> > of the above features, but it would make little sense to me, since
> > most, if not all, of them already have such knobs.  For example,
> > character composition can be disabled by flipping a variable.
> 
> It would help to list what contributes to indentation/columns in the
> documentation.

They are a legion.  Basically, every display-related feature described
in the ELisp manual -- and there are a lot of them -- is of this
nature.  Since we already describe them all in the manual, adding a
section which mentions them all together is strictly not necessary for
a reference manual.  It's more a job for a tutorial.

You are asking that someone does a very large job of collecting
existing stuff together, for facilitating a solution of some pretty
rare problem.  I cannot justify a large job such as this one -- going
through all the Emacs display features and describing them together --
for this kind of purpose.  But if someone wants to work on that, I
won't necessarily object if the result is concise and doesn't repeat
the existing material.

> > See above: you are actually opening a Pandora box, and any solution
> > will likely be based on existing variables.  So I think we already
> > have what you want, it just might not be immediately obvious in each
> > case which of the knobs to use.  The default behavior of
> > current-column can already be affected by disabling
> > auto-composition-mode, by tweaking the buffer's invisibility spec, and
> > by defining display properties whose values are conditional.  Tab
> > expansion can also be controlled.  What else would make sense?
> 
> A toggle: disable all visual contributors.

It will never be used.




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

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


Received: (at 64696) by debbugs.gnu.org; 24 Jul 2023 08:18:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 24 04:18:59 2023
Received: from localhost ([127.0.0.1]:41709 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qNqmR-0008Sf-BP
	for submit <at> debbugs.gnu.org; Mon, 24 Jul 2023 04:18:59 -0400
Received: from mout01.posteo.de ([185.67.36.65]:50329)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qNqmN-0008SN-PC
 for 64696 <at> debbugs.gnu.org; Mon, 24 Jul 2023 04:18:58 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 93757240028
 for <64696 <at> debbugs.gnu.org>; Mon, 24 Jul 2023 10:18:49 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1690186729; bh=wCP3EfjV0iXEOj+b8QQhPJpTB78bULm2aSN8XfqJXBw=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=ANwFpH9e23u8KUPOfNMkHNjxI+NzqbTXzmE1U6uBNSoE1w/mG87wG9/Mu1wBQs58t
 5rgC2alBkUCgukWEbNIEPBf8PNy8pl+yTGb4hzIyyZlZmhLAuJ//uOhMbHxKrNc1OI
 bF3M1FERvZa1gkiswbimRE1CQIvPjoiXLGwYA0dB0eh6FBL8o7aEbS5X6T+h5h1agQ
 texhR6YTTiEvZwx3DGqAYp/Sds5W3O49hYr4f73kJULIvuDVVnsDFY1rOD+hmM4eJb
 t4toaO848lXsXMAUkyuQdYxikrKtlhNUcLhZtnX+gUfbNg/wRhguZRbGzEsuuZoJ47
 uFayeixBNJbqA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R8Y2w3cjpz9ryt;
 Mon, 24 Jul 2023 10:18:48 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <83wmyrt02d.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@HIDDEN>
 <87zg3o8m2a.fsf@localhost> <83wmys8a2g.fsf@HIDDEN>
 <87v8ecrqib.fsf@localhost> <83bkg481g5.fsf@HIDDEN>
 <87bkg3rso5.fsf@localhost> <83wmyrt02d.fsf@HIDDEN>
Date: Mon, 24 Jul 2023 08:18:54 +0000
Message-ID: <87edkx3eoh.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> 1. Org mode is generally aiming for the produced Org files to be
>>    readable as unfontified plain text. So, quirks related to visual
>>    indentation generally tend to mess things up.
>
> "Unfontified"?  AFAIK, Org files do use fontifications, don't they?
> So what do you mean by "unfontified plain text" here?  But that's an
> aside, feel free to ignore.

For example, consider an Org table like

| *This* | is | some text |
| more |    |  text     |

It looks aligned in Org buffers ("*" is invisible), but not when copied
to message buffer.

>> 2. Org mode uses indentation as part of the syntax. I had to get rid of
>>    using `current-column' and calculated "true textual indentation"
>>    manually to avoid breakage after `current-column' started to take
>>    into account invisibility. (bug#56837)
>
> This cannot be avoided.  Emacs provides by default many features that
> "mess up" this kind of "true textual indentation".  Some of these
> features include:
> ...
> (I'm probably missing some more.)  Only the Lisp program knows which
> of those are relevant to the particular application at hand.

Sure, but how can an application, say, disable all the effects of visual
representation without (1) searching and let-binding each specific
toggle (and possibly adding more in future versions of Emacs); (2)
re-implementing the existing indentation code (like what
`org-current-text-column' does)?

> We could introduce separate indentation/current-column knobs for each
> of the above features, but it would make little sense to me, since
> most, if not all, of them already have such knobs.  For example,
> character composition can be disabled by flipping a variable.

It would help to list what contributes to indentation/columns in the
documentation.

> See above: you are actually opening a Pandora box, and any solution
> will likely be based on existing variables.  So I think we already
> have what you want, it just might not be immediately obvious in each
> case which of the knobs to use.  The default behavior of
> current-column can already be affected by disabling
> auto-composition-mode, by tweaking the buffer's invisibility spec, and
> by defining display properties whose values are conditional.  Tab
> expansion can also be controlled.  What else would make sense?

A toggle: disable all visual contributors.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 23 Jul 2023 10:05:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 23 06:05:10 2023
Received: from localhost ([127.0.0.1]:38435 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qNVxd-0000Tr-P8
	for submit <at> debbugs.gnu.org; Sun, 23 Jul 2023 06:05:10 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:35680)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qNVxb-0000TX-IK
 for 64696 <at> debbugs.gnu.org; Sun, 23 Jul 2023 06:05:08 -0400
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 1qNVxW-0003tr-67; Sun, 23 Jul 2023 06:05:02 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=Fr4fLrtQntNfFBPer3YL/FiP8xPt6TBZvMyJ98/b4fo=; b=RViD5yL9fld1O/WQrvGi
 h0RVte5mz+rwjKPnXAxn2xvnYOI2dHcg8s8xfsI1+jo4s8KObrcTlVx3EelzD6zkfeIXwdvsKYv1H
 I33vl4T73vcnCoBxyeznHiGx2qgI/dfVvwukeoVLRjaCYwnQcm7ldJIK30mUoD1a3FaytS/KocHXq
 ElF2AVuuVk9W7Q+joaRnBVlxGUdElj0g0NSqCPgffMDtzQWjwxhfWN/rW5eBQNKx8Dv3dcrSAxm7T
 f690m+4zfdj/pylGY6GF8hB/ZUXJda7r0xrJSZFyz4druI+UlgaAtRzlLDE9zCxOmdppOOMNtjgqS
 i9GXy1b6VeXL+Q==;
Received: from [87.69.77.57] (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 1qNVxJ-0002MZ-Sa; Sun, 23 Jul 2023 06:05:01 -0400
Date: Sun, 23 Jul 2023 13:05:30 +0300
Message-Id: <83wmyrt02d.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87bkg3rso5.fsf@localhost> (message from Ihor Radchenko on Sun,
 23 Jul 2023 07:30:34 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@HIDDEN>
 <87zg3o8m2a.fsf@localhost> <83wmys8a2g.fsf@HIDDEN>
 <87v8ecrqib.fsf@localhost> <83bkg481g5.fsf@HIDDEN> <87bkg3rso5.fsf@localhost>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Sun, 23 Jul 2023 07:30:34 +0000
> 
> On one hand, Emacs' indentation is nicely aligning text as is it
> actually displayed in the buffer, taking into account all kinds of bells
> and whistles that alter the displayed text width.
> 
> On the other hand, such visual indentation is not always good. Visuals
> present in one Emacs config may not be enabled in another config. And
> code/text nicely aligned on one machine will suddenly look ugly on
> other. For example, see
> http://endlessparentheses.com/using-prettify-symbols-in-clojure-and-elisp-without-breaking-indentation.html

Programs that want "indentation" that only counts codepoints (which is
really a rare situation, see below) need to disable all kinds of Emacs
features, otherwise they will not get what they want.

> In Org mode, visual indentation is also not necessarily good thing:
> 
> 1. Org mode is generally aiming for the produced Org files to be
>    readable as unfontified plain text. So, quirks related to visual
>    indentation generally tend to mess things up.

"Unfontified"?  AFAIK, Org files do use fontifications, don't they?
So what do you mean by "unfontified plain text" here?  But that's an
aside, feel free to ignore.

> 2. Org mode uses indentation as part of the syntax. I had to get rid of
>    using `current-column' and calculated "true textual indentation"
>    manually to avoid breakage after `current-column' started to take
>    into account invisibility. (bug#56837)

This cannot be avoided.  Emacs provides by default many features that
"mess up" this kind of "true textual indentation".  Some of these
features include:

  . character composition
  . tab expansion
  . display properties that hide text and display some other text
  . display properties that align text
  . faces that affect character metrics via fonts
  . invisible text

(I'm probably missing some more.)  Only the Lisp program knows which
of those are relevant to the particular application at hand.  For
example, in your "true textual indentation", how do you account for
U+0061 LATIN SMALL LETTER A followed by U+0301 COMBINING ACUTE ACCENT?
They are almost always displayed as a single glyph: á.  Do you
consider this a single column or 2 columns?  What about long Emoji
sequences?

We could introduce separate indentation/current-column knobs for each
of the above features, but it would make little sense to me, since
most, if not all, of them already have such knobs.  For example,
character composition can be disabled by flipping a variable.

> > I don't insist in making that change.  Quite the opposite, actually.
> > I also expect it to break gobs of indentation code where invisible
> > text is involved.  Indentation code should probably temporarily remove
> > the invisibility spec, while indenting, or something.
> 
> That would make sense, yes.
> 
> > The main motivation to fix scan_for_column to consider more visual
> > effects was so vertical cursor motion works as expected when large
> > portions of text are hidden.
> 
> What about having something like `current-visual-column' that will be
> used when we really need to examine which display column the cursor is
> it, accounting for all the display-affecting properties?
> 
> Or maybe even have `use-visual-columns' variable that will modify how
> `current-column' behaves ('visual, 'textual, 'visual-ignore-invisible,
> etc)

See above: you are actually opening a Pandora box, and any solution
will likely be based on existing variables.  So I think we already
have what you want, it just might not be immediately obvious in each
case which of the knobs to use.  The default behavior of
current-column can already be affected by disabling
auto-composition-mode, by tweaking the buffer's invisibility spec, and
by defining display properties whose values are conditional.  Tab
expansion can also be controlled.  What else would make sense?




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

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


Received: (at 64696) by debbugs.gnu.org; 23 Jul 2023 07:30:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 23 03:30:30 2023
Received: from localhost ([127.0.0.1]:37877 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qNTXx-0001kv-Rx
	for submit <at> debbugs.gnu.org; Sun, 23 Jul 2023 03:30:30 -0400
Received: from mout02.posteo.de ([185.67.36.66]:48417)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qNTXv-0001kh-Hs
 for 64696 <at> debbugs.gnu.org; Sun, 23 Jul 2023 03:30:28 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id DEAEE240103
 for <64696 <at> debbugs.gnu.org>; Sun, 23 Jul 2023 09:30:21 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1690097421; bh=3KavXumFzdXbR3h+DYVlLGkew5JRuEBCL232JIrMn6w=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=bK8sRLV0xkj7YZOGfgUTR+IiMjaWX6MiPysRRD067v/5v1FuA2dOHSYdTk9V8geFl
 Ozx4jp7V9i6bY6ASii6gtt0Tc6xieAMTONI1OniOrdgFv/iXngPB/aVb/FvaJf2LLp
 FJMW8gV4IEOS2aIPSxMpzLwl4K31OeT7mpaxONGw/Y5PYh231TVngYL/oxKjmzmDyJ
 w2hqfpqGI3pzpj0jhXN2anyFk1p6LrrJfac2r5OQT03NhrEp8ci6trPjhWUa06HCpW
 4qm+t/Y+pZjLVTNgBOooAqTWuwK3YyiqDipUwldS1RVz4D7x/b7bgoPc2caRTM19ow
 7/1OjugpVQtsA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R7w1S5vMKz9ryk;
 Sun, 23 Jul 2023 09:30:20 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <83bkg481g5.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@HIDDEN>
 <87zg3o8m2a.fsf@localhost> <83wmys8a2g.fsf@HIDDEN>
 <87v8ecrqib.fsf@localhost> <83bkg481g5.fsf@HIDDEN>
Date: Sun, 23 Jul 2023 07:30:34 +0000
Message-ID: <87bkg3rso5.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> > With the patch below, Test #2 shows "current-column = 6", which is
>> > correct, since the cursor is shown after "* Test", with all the rest
>> > invisible.
>> 
>> This will definitely break indentation code.
>
> But is correct, don't you agree?

Depends on the usage of `current-column' and design of Emacs
indentation.

On one hand, Emacs' indentation is nicely aligning text as is it
actually displayed in the buffer, taking into account all kinds of bells
and whistles that alter the displayed text width.

On the other hand, such visual indentation is not always good. Visuals
present in one Emacs config may not be enabled in another config. And
code/text nicely aligned on one machine will suddenly look ugly on
other. For example, see
http://endlessparentheses.com/using-prettify-symbols-in-clojure-and-elisp-without-breaking-indentation.html

In Org mode, visual indentation is also not necessarily good thing:

1. Org mode is generally aiming for the produced Org files to be
   readable as unfontified plain text. So, quirks related to visual
   indentation generally tend to mess things up.
2. Org mode uses indentation as part of the syntax. I had to get rid of
   using `current-column' and calculated "true textual indentation"
   manually to avoid breakage after `current-column' started to take
   into account invisibility. (bug#56837)

>> I am pretty sure that it is not the only breakage.
>
> I don't insist in making that change.  Quite the opposite, actually.
> I also expect it to break gobs of indentation code where invisible
> text is involved.  Indentation code should probably temporarily remove
> the invisibility spec, while indenting, or something.

That would make sense, yes.

> The main motivation to fix scan_for_column to consider more visual
> effects was so vertical cursor motion works as expected when large
> portions of text are hidden.

What about having something like `current-visual-column' that will be
used when we really need to examine which display column the cursor is
it, accounting for all the display-affecting properties?

Or maybe even have `use-visual-columns' variable that will modify how
`current-column' behaves ('visual, 'textual, 'visual-ignore-invisible,
etc)

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 22 Jul 2023 14:30:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 22 10:30:54 2023
Received: from localhost ([127.0.0.1]:37414 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qNDdF-0000Hc-TD
	for submit <at> debbugs.gnu.org; Sat, 22 Jul 2023 10:30:54 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:35026)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qNDdE-0000HO-Cl
 for 64696 <at> debbugs.gnu.org; Sat, 22 Jul 2023 10:30:53 -0400
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 1qNDd8-0003g7-4P; Sat, 22 Jul 2023 10:30:46 -0400
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=qNWnPafTUlh28BvXWk6queDJjLIoSH4goopLCCEtCdI=; b=aLA1Aufm21e3
 3q3qMsG2G15+OZN0WE/8evSnsSMgZxrkX2zJYQARYHVFuOtw9py1uHdy3yYqW+AFkewD/0wDyPhsb
 Iiw9pX2jD0ScdsYTDybY86bhyXbBdajPzPDeRwlOomxaJ5oRkDJgEi+S7F57LPjSAQSVO6D9xGtTc
 fMwOC4+EOIuHzVTK+SVoPiU4FUQQa9V4MOw5FCamBbecAFjfs0yr2KnNFN8ZQHKo+Z952VZY7wMs4
 0rswYDuEGHPHKo1O1cdAyKCJlyBw+g9sQ0COOs8G5Ovd+ezsGKmhKQ/ludDEEWwM7GWmose9NYx/F
 /OVrnMrUFbNuUQSINvDh/w==;
Received: from [87.69.77.57] (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 1qNDd7-0006ua-Eu; Sat, 22 Jul 2023 10:30:45 -0400
Date: Sat, 22 Jul 2023 17:31:24 +0300
Message-Id: <83a5vo81c3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87sf9grq9w.fsf@localhost> (message from Ihor Radchenko on Sat,
 22 Jul 2023 14:10:03 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <877cqt7jhp.fsf@localhost>
 <834jlwa17v.fsf@HIDDEN> <87v8ec8lsq.fsf@localhost>
 <83v8ec89hd.fsf@HIDDEN> <87sf9grq9w.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Sat, 22 Jul 2023 14:10:03 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > Bottom line: indentation with invisible text is tricky.  (Who was the
> > genius who decided that using invisibility in Org is a good idea??)
> 
> You mean 'invisible property? Or 'invisible overlays?

I mean both.  The problems happen with both, and current-column treats
both the same, as you can see in skip_invisible (which is also used by
the display code, so the results should be the same as on display).




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

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


Received: (at 64696) by debbugs.gnu.org; 22 Jul 2023 14:28:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 22 10:28:29 2023
Received: from localhost ([127.0.0.1]:37409 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qNDav-0000CQ-6D
	for submit <at> debbugs.gnu.org; Sat, 22 Jul 2023 10:28:29 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:42620)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qNDat-0000CB-8C
 for 64696 <at> debbugs.gnu.org; Sat, 22 Jul 2023 10:28:27 -0400
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 1qNDan-00036P-E0; Sat, 22 Jul 2023 10:28:21 -0400
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=UnC7qVTf+u30KKeiKYnRYgkVa+8cHkHT1DaYcBNMjCI=; b=ckkdnwRUgZbZ
 KjnrOxU35RwJMBTTgyEhf33pOoZi5+xI3CxoC1R/7B55lbkoO61oUhMuU0fClH4db4psH2dyZe5AE
 AwU0hYZkcuq82wU1RX1sv7pqeH9cPJehH5Wo5iYB5W1TBtYBFdULydocgjXHY/JpxNRBDqGYz3zdc
 w7oW2VkD4VsDgBP0LP8rEZk4QQysXTxkrkKED2hdlOGp+B4ApDB1nrMU2xfboiLem7UuzY+X6RrZW
 POqFDzFSxTMLSBY/R7avTVhLYJOVTa0aww3c9GRs2oS1/Vx1KvIYPG3fAUjVj7RiRYhWw8Af+08TR
 ZBuSJVECD44ZTRI8EBsohw==;
Received: from [87.69.77.57] (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 1qNDam-0003Dn-T5; Sat, 22 Jul 2023 10:28:21 -0400
Date: Sat, 22 Jul 2023 17:28:58 +0300
Message-Id: <83bkg481g5.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87v8ecrqib.fsf@localhost> (message from Ihor Radchenko on Sat,
 22 Jul 2023 14:05:00 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@HIDDEN>
 <87zg3o8m2a.fsf@localhost> <83wmys8a2g.fsf@HIDDEN> <87v8ecrqib.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Sat, 22 Jul 2023 14:05:00 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> Test #2 is unexpected - we are inside invisible region, but
> >> current-column reports as if everything were visible.
> >
> > current-column produces incorrect results when the newline before the
> > current line is invisible.  It always starts from the beginning of the
> > current physical line, even if that is in invisible text.
> 
> Then why does test #3 produce current-column = 0?
> The newline before current line is also invisible there.

I'm guessing it's sheer luck or something.  Bugs are like that: they
don't always behave consistently if you change the conditions
slightly.

I didn't look at that case, and frankly, I'm not thrilled to do that.
The code starts by going to the previous newline, and doesn't pay
attention to whether the newline is itself invisible.  Thereafter, it
looks only for _changes_ in the invisible property, so it will not
consider a stretch of text starting from that newline as invisible.
Given this strategy, it should be clear that the result cannot be
correct in general when the newline at BOL is invisible; all the rest
are details that are not really relevant, and spending time on
understanding exactly what happens in this or that particular case is
from my POV a waste of time.

> > We could teach current-column about invisible newlines, see the patch
> > below.  But I'm not sure this is justified, nor whether it won't break
> > something.  The patch below also has a disadvantage that it will still
> > behave as before for a buffer that is not displayed in any window; if
> > we want that to be fixed as well, the changes will need to be more
> > extensive.  (Basically, we will need to write a non-display version of
> > back_to_previous_visible_line_start.)
> >
> > With the patch below, Test #2 shows "current-column = 6", which is
> > correct, since the cursor is shown after "* Test", with all the rest
> > invisible.
> 
> This will definitely break indentation code.

But is correct, don't you agree?

> Look at `indent-line-to':
> 
>   (beginning-of-line 1)
>   (skip-chars-forward " \t")
>   (let ((cur-col (current-column)))
> <...>
> ((> cur-col column) ; too far right (after tab?)
>            (delete-region (progn (move-to-column column t) (point))
>                           ;; The `move-to-column' call may replace
>                           ;; tabs with spaces, so we can't reuse the
>                           ;; previous start point.
>                           (progn (beginning-of-line 1)
>                                  (skip-chars-forward " \t")
>                                  (point))))

This obviously assumes the text is not invisible.

> I am pretty sure that it is not the only breakage.

I don't insist in making that change.  Quite the opposite, actually.
I also expect it to break gobs of indentation code where invisible
text is involved.  Indentation code should probably temporarily remove
the invisibility spec, while indenting, or something.

Once again, the indentation feature was designed to work on PL source
text and on human-readable text files where the user types text that
is completely, or almost completely, visible.  It was not designed for
Outline and similar modes which hide large portions of the buffer
text.  So it is a small wonder that it doesn't work well in those
cases.

The main motivation to fix scan_for_column to consider more visual
effects was so vertical cursor motion works as expected when large
portions of text are hidden.




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

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


Received: (at 64696) by debbugs.gnu.org; 22 Jul 2023 14:09:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 22 10:09:59 2023
Received: from localhost ([127.0.0.1]:37387 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qNDJ1-0008Ab-Gs
	for submit <at> debbugs.gnu.org; Sat, 22 Jul 2023 10:09:59 -0400
Received: from mout02.posteo.de ([185.67.36.66]:55059)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qNDIz-0008AN-1Y
 for 64696 <at> debbugs.gnu.org; Sat, 22 Jul 2023 10:09:57 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 81668240103
 for <64696 <at> debbugs.gnu.org>; Sat, 22 Jul 2023 16:09:51 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1690034991; bh=uGGTgY9x40xMoFkOL8vAijFwESqATiYOFd3b5fHS8S8=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=IT+urmYg2p2Hx7yqgxfmUk55Moh/o7ViOTqvKGctZNUSEpAYjm/rCEyPLhUoZOxPc
 fC0MMbwo3zw4Ol59eLI4NpKz8XxUTTObjNu5rhYkV0kfGhKnW3oHKgo9/TfwU6To7W
 8igK0pLlRFa5MFsXYoxbyCSOOM2d9PGOmzigUYncvAEFB+LJ74n8ZKtu9knJGu0CQG
 /k7ycMGXnTFBdabZKNulnGzdP0f1DMJ0y77+ZeULRrBw+57QHzkjYjzGy6YlXHHZEn
 dQpFUi31Kwt6TB9J00Esw7ZqDAhRL+GlXrmtJPNSxMnJK0L9PIRx6C4jBRteK7oPoI
 yYXoVjgZRECJg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R7Swt5c3Yz6tx6;
 Sat, 22 Jul 2023 16:09:50 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <83v8ec89hd.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <877cqt7jhp.fsf@localhost>
 <834jlwa17v.fsf@HIDDEN> <87v8ec8lsq.fsf@localhost>
 <83v8ec89hd.fsf@HIDDEN>
Date: Sat, 22 Jul 2023 14:10:03 +0000
Message-ID: <87sf9grq9w.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

> Bottom line: indentation with invisible text is tricky.  (Who was the
> genius who decided that using invisibility in Org is a good idea??)

You mean 'invisible property? Or 'invisible overlays?
The latter is inherited from outline-mode.
The former is me, because performance, and because there were no
obvious hard blockers.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 22 Jul 2023 14:04:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 22 10:04:57 2023
Received: from localhost ([127.0.0.1]:37378 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qNDE9-00083E-CW
	for submit <at> debbugs.gnu.org; Sat, 22 Jul 2023 10:04:57 -0400
Received: from mout01.posteo.de ([185.67.36.65]:53357)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qNDE7-000831-MX
 for 64696 <at> debbugs.gnu.org; Sat, 22 Jul 2023 10:04:56 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 393BE240028
 for <64696 <at> debbugs.gnu.org>; Sat, 22 Jul 2023 16:04:49 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1690034689; bh=s5rmk197IkMOQR7LglPrTxXPDO5MhM2NPr3TrxREWpw=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:
 Content-Transfer-Encoding:From;
 b=h3kZunQYVhUuk7wriswxR1O0CidNMpy/zBSdSuLQLCuqx1AW8xB7Y1+VnsCLPKq1/
 ixjfwFuQ8Aymvv2ZSU2avN2U1FQ2B1t2E9bu5/mQ5H86XNQLchDYgK0A3vls+RYokj
 DfBlk559HV4g7eVfdZ9QXo3mj9soVjFN5n+T/55pYU7hK7GdFgb21HnCzolXCVYHMO
 31kSHHWDlFXxGzxoyYu+AvDyQ4q4oypeTx7Mw/+XJHsSPxGW0zZyCch6hBRJYX1mmh
 NbjWtzyfQitqtt1rogbcb9ykKRGv1ctW6awQ/6ZPndlk4vD/2lvoWATeslPseWfgo/
 uOLOuDVA1R5jQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R7Sq40l9Qz6tvJ;
 Sat, 22 Jul 2023 16:04:47 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <83wmys8a2g.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@HIDDEN>
 <87zg3o8m2a.fsf@localhost> <83wmys8a2g.fsf@HIDDEN>
Date: Sat, 22 Jul 2023 14:05:00 +0000
Message-ID: <87v8ecrqib.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> =E2=9B=94 Warning (emacs): Test #2:: =E2=80=99word=E2=80=99 is inside fo=
lded heading (hidden using overlays).
>> =E2=9B=94 Warning (emacs): Moved point after first =E2=80=99word=E2=80=99
>> =E2=9B=94 Warning (emacs): 1:: current-column =3D 4
>>=20
>> Test #2 is unexpected - we are inside invisible region, but
>> current-column reports as if everything were visible.
>
> current-column produces incorrect results when the newline before the
> current line is invisible.  It always starts from the beginning of the
> current physical line, even if that is in invisible text.

Then why does test #3 produce current-column =3D 0?
The newline before current line is also invisible there.

> We could teach current-column about invisible newlines, see the patch
> below.  But I'm not sure this is justified, nor whether it won't break
> something.  The patch below also has a disadvantage that it will still
> behave as before for a buffer that is not displayed in any window; if
> we want that to be fixed as well, the changes will need to be more
> extensive.  (Basically, we will need to write a non-display version of
> back_to_previous_visible_line_start.)
>
> With the patch below, Test #2 shows "current-column =3D 6", which is
> correct, since the cursor is shown after "* Test", with all the rest
> invisible.

This will definitely break indentation code.

Look at `indent-line-to':

  (beginning-of-line 1)
  (skip-chars-forward " \t")
  (let ((cur-col (current-column)))
<...>
((> cur-col column) ; too far right (after tab?)
           (delete-region (progn (move-to-column column t) (point))
                          ;; The `move-to-column' call may replace
                          ;; tabs with spaces, so we can't reuse the
                          ;; previous start point.
                          (progn (beginning-of-line 1)
                                 (skip-chars-forward " \t")
                                 (point))))

In the Test #2 situation, if `current-column' returns 6 and we have
* Test
 <point>word

(indent-line-to 3)

we will go into (> cur-col column) branch and
(delete-region <line end position> <first non-whitespace after bol>)

In other words, `indent-line-to' with delete "word".

I am pretty sure that it is not the only breakage.

--=20
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 22 Jul 2023 13:32:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 22 09:32:31 2023
Received: from localhost ([127.0.0.1]:35693 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qNCil-0006fV-8o
	for submit <at> debbugs.gnu.org; Sat, 22 Jul 2023 09:32:31 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13283)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1qNCij-0006fH-Fq
 for 64696 <at> debbugs.gnu.org; Sat, 22 Jul 2023 09:32:29 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id F2D201000C4;
 Sat, 22 Jul 2023 09:32:23 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D747810001F;
 Sat, 22 Jul 2023 09:32:22 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1690032742;
 bh=gxM7qcaEChKTqMnKTBSBKHEqq4l68Z+Os51gBZbv8uU=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=cF6SvX9KDa4Xx59ixVfPFuNpZ70tF857FrwJaHR3zhT++Qs39TtQ8DMQocLFHKwzC
 z2b80B/7EYZHndhYqSddEIEjlp4OrGbZOGV2p23C9KZ1xmhAvbkImkGknYlkz/Rzot
 IgLPhVqzFu5Dd/12XhmgrXv9MpvZueTP1sbBfQP5z6T9BUBM8EG2Qrp9H0QB+dEdGt
 6edJ839Yk+bhv2d4hHqds67gfrLmJhngSpB0FnIPIgifNktPdHJIh8nhwsmQEtCRHn
 iX9BNv24LTI7UUxzBb/sblRSxtruTjdO1Z6cIfbTUxRSNxCL6mG6ZWELZw9Iief/qu
 ptIi2BFhHTw7A==
Received: from pastel (unknown [104.247.231.138])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AE6821201FF;
 Sat, 22 Jul 2023 09:32:22 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <87zg3o8m2a.fsf@localhost> (Ihor Radchenko's message of "Sat, 22
 Jul 2023 07:03:41 +0000")
Message-ID: <jwvbkg4yt5t.fsf-monnier+emacs@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@HIDDEN>
 <87zg3o8m2a.fsf@localhost>
Date: Sat, 22 Jul 2023 09:32:22 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.090 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: Eli Zaretskii <eliz@HIDDEN>, 64696 <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 (---)

> =E2=9B=94 Warning (emacs): Test #2:: =E2=80=99word=E2=80=99 is inside fol=
ded heading (hidden using overlays).
> =E2=9B=94 Warning (emacs): Moved point after first =E2=80=99word=E2=80=99
> =E2=9B=94 Warning (emacs): 1:: current-column =3D 4
>
> Test #2 is unexpected - we are inside invisible region, but
> current-column reports as if everything were visible.

Side note: `current-column` treats invisible text differently
depending on whether it's replaced by ellipses or not.

This was done so that reindenting a region or a sexp doesn't go haywire
when part of the region is currently hidden by code folding.

I now think that relying on "ellipses or not" was not a great idea
(there are ellipses which `current-column` should count as the width of
the ellipsis rather than the width of the hidden text, e.g. when
ellipses are used to truncate cells in a table).


        Stefan





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

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


Received: (at 64696) by debbugs.gnu.org; 22 Jul 2023 11:34:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 22 07:34:59 2023
Received: from localhost ([127.0.0.1]:35573 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qNAt1-0003X5-0v
	for submit <at> debbugs.gnu.org; Sat, 22 Jul 2023 07:34:59 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:55396)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qNAsx-0003Wp-T6
 for 64696 <at> debbugs.gnu.org; Sat, 22 Jul 2023 07:34:57 -0400
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 1qNAss-0000QG-Ai; Sat, 22 Jul 2023 07:34:50 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=jeZbguRJi8PMQzLgt4qf1RXqPfsoP0rag5P2FlQKyPY=; b=jl+b3TERIQ3Tupky0hUm
 eFm2J5jcmyE/otGC4puCAjMVqaHS0dKcTqAT7cr8rhBT2thXEiUMIno2jbdOzO4WKll/5Y6nV/l26
 H5c51Cm4B8rM2KhV243xfd04yHZ3RUzcCbsrpbajolAYu72mQ48ZqjuHcqAwygx8khm/xy3bwpN+B
 sLTebczzN/l3yPQ1zQjQe/b7tK3nYErqKzyPdj19ejeO9k/lX6UV53UV0lC+ppVkhsGmETHkZk0ss
 8oezYZTP6/vdsi87DRkOtF5tPGnKiy200Qe9o6ZBBbRpwr2JjweTJyxL6M5KzqsZjpX46D2JnhK8s
 HdQhQ1NiqDOz3g==;
Received: from [87.69.77.57] (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 1qNAsr-00012z-Q8; Sat, 22 Jul 2023 07:34:50 -0400
Date: Sat, 22 Jul 2023 14:35:26 +0300
Message-Id: <83v8ec89hd.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87v8ec8lsq.fsf@localhost> (message from Ihor Radchenko on Sat,
 22 Jul 2023 07:09:25 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <877cqt7jhp.fsf@localhost>
 <834jlwa17v.fsf@HIDDEN> <87v8ec8lsq.fsf@localhost>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Sat, 22 Jul 2023 07:09:25 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> With `indent-tabs-mode' disabled, running the test yields different
> >> results. (AFAIU, it should not).
> >
> > Is this about indent-to or about current-column?  I'd like to see
> > first if there are any problems in current-column.
> 
> Ok.
> 
> Test #3 with and without indent-tabs-mode are not the same:
> 
> (indent-tabs-mode is nil)
> ⛔ Warning (emacs): Test #3:: ’word’ is hidden applying ’invisible text property to heading body.
> ⛔ Warning (emacs): Moved point after first ’word’
> ⛔ Warning (emacs): 1:: current-column = 0
> ⛔ Warning (emacs): Indented to column 50
> ⛔ Warning (emacs): 3:: current-column = 0
> ⛔ Warning (emacs): Enabled visible mode
> ⛔ Warning (emacs): 5:: current-column = 54
> 
> (indent-tabs-mode is t)
> ⛔ Warning (emacs): Test #3:: ’word’ is hidden applying ’invisible text property to heading body.
> ⛔ Warning (emacs): Moved point after first ’word’
> ⛔ Warning (emacs): 1:: current-column = 0
> ⛔ Warning (emacs): Indented to column 50
> ⛔ Warning (emacs): 3:: current-column = 0
> ⛔ Warning (emacs): Enabled visible mode
> ⛔ Warning (emacs): 5:: current-column = 50
> 
> Note how the last current-column value is different.
> It may be something about current-column or about indent-to.

(With the patched current-column, I get 48 and 50.)

It's neither.  If you think about this, you will realize that
something like this is expected: current-column will always return
different results when you remove the invisibility properties,
depending on whether tabs were used for indentation, because the width
of a tab is not constant, it depends on where on display it is
located.

In this case, the "real" column after the first "word" is 4, but when
there are invisible properties, its column is 6 (with the patched
current-column).  So indent-to needs to insert the equivalent of 44
columns to get to column 50.  With indent-tabs-mode nil it actually
inserts 44 spaces, so when the invisibility is removed, we get
current-column = 4 + 44 = 48.  When indent-tabs-mode is t, indent-to
decides to insert 6 tabs and 2 spaces, so you get a different result
when you remove the invisibility.

Bottom line: indentation with invisible text is tricky.  (Who was the
genius who decided that using invisibility in Org is a good idea??)




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

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


Received: (at 64696) by debbugs.gnu.org; 22 Jul 2023 11:22:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 22 07:22:21 2023
Received: from localhost ([127.0.0.1]:35567 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qNAgm-0000gP-Gs
	for submit <at> debbugs.gnu.org; Sat, 22 Jul 2023 07:22:20 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:57636)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qNAgj-0000gC-Fr
 for 64696 <at> debbugs.gnu.org; Sat, 22 Jul 2023 07:22:19 -0400
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 1qNAgd-0002nc-Er; Sat, 22 Jul 2023 07:22:11 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=dzc05AH4DVVZOoczR6Lh1NChgGaJvQmkRwC/vMN/jjs=; b=d9QSIyyDVdZVjoTpHzJX
 bYs+5kGumKJlkQW5Kyc0cMUCpZLdRdNG9opVyJn68mIfAY1N0xtO7oIpZumjbOqO9z2w71njhVPT2
 R7MK0ixQHxgHSE05VkYL8nDy6d1u2IqjZvZz1mjC8Y5og8Sw45tsXnNAudG5KCQCmEE22Jrq5rtK9
 ObLfbGN+RWwDaIvdgLp2SnPQKoF1yn9H42TRBPIg6lZ3CJQY3o+ggwMOn2y+8995bRdmGW0pcrtxg
 gqhFjy71dHt45fBWxE8hSPlVgB8/C0yhLkJVEVVHDdZD8hoBVIXj1YtTy3CjfAtS34lNnvlUKcEzE
 7hECZsh3yfahsw==;
Received: from [87.69.77.57] (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 1qNAgb-0003us-HS; Sat, 22 Jul 2023 07:22:10 -0400
Date: Sat, 22 Jul 2023 14:22:47 +0300
Message-Id: <83wmys8a2g.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87zg3o8m2a.fsf@localhost> (message from Ihor Radchenko on Sat,
 22 Jul 2023 07:03:41 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@HIDDEN> <87zg3o8m2a.fsf@localhost>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Sat, 22 Jul 2023 07:03:41 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> You can do M-x yant/full-test after evaluating the code below
> >
> > And what are the problems you see with current-column in this example?
> > (Let's leave indent-to alone for now.)
> 
> ⛔ Warning (emacs): Test #1:: Everything visible.
> ⛔ Warning (emacs): Moved point after first ’word’
> ⛔ Warning (emacs): 1:: current-column = 4
> 
> Test #1 is expected - everything is visible, we are indeed at column 4.
> 
> ⛔ Warning (emacs): Test #2:: ’word’ is inside folded heading (hidden using overlays).
> ⛔ Warning (emacs): Moved point after first ’word’
> ⛔ Warning (emacs): 1:: current-column = 4
> 
> Test #2 is unexpected - we are inside invisible region, but
> current-column reports as if everything were visible.

current-column produces incorrect results when the newline before the
current line is invisible.  It always starts from the beginning of the
current physical line, even if that is in invisible text.

We could teach current-column about invisible newlines, see the patch
below.  But I'm not sure this is justified, nor whether it won't break
something.  The patch below also has a disadvantage that it will still
behave as before for a buffer that is not displayed in any window; if
we want that to be fixed as well, the changes will need to be more
extensive.  (Basically, we will need to write a non-display version of
back_to_previous_visible_line_start.)

With the patch below, Test #2 shows "current-column = 6", which is
correct, since the cursor is shown after "* Test", with all the rest
invisible.

If we think this kind of change is a good idea (Stefan?), patches to
make the below work without employing display code (which needs the
window) will be welcome.

diff --git a/src/indent.c b/src/indent.c
index eda85f2..1357fd2 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -563,11 +563,35 @@ scan_for_column (ptrdiff_t *endpos, EMACS_INT *goalcol,
   ptrdiff_t end = endpos ? *endpos : PT;
   ptrdiff_t scan, scan_byte, next_boundary, prev_pos, prev_bpos;
 
-  scan = find_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -1, NULL, &scan_byte, 1);
-
   window = Fget_buffer_window (Fcurrent_buffer (), Qnil);
   w = ! NILP (window) ? XWINDOW (window) : NULL;
 
+  int prevbyte = 0;
+  Lisp_Object prop = Qnil;
+  if (PT > BEGV && w)
+    {
+      prevbyte = FETCH_BYTE (PT_BYTE - 1);
+      prop  = Fget_char_property (make_fixnum (PT - 1), Qinvisible, window);
+    }
+  if (w && !(prevbyte == '\n' && TEXT_PROP_MEANS_INVISIBLE (prop) == 0))
+    {
+      struct it it;
+      struct text_pos pt;
+      specpdl_ref count = SPECPDL_INDEX ();
+      void *itdata = bidi_shelve_cache ();
+      SET_TEXT_POS (pt, PT, PT_BYTE);
+      record_unwind_protect_void (unwind_display_working_on_window);
+      display_working_on_window_p = true;
+      start_display (&it, w, pt);
+      reseat_at_previous_visible_line_start (&it);
+      scan = IT_CHARPOS (it);
+      scan_byte = IT_BYTEPOS (it);
+      bidi_unshelve_cache (itdata, 0);
+      unbind_to (count, Qnil);
+    }
+  else
+    scan = find_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -1, NULL, &scan_byte, 1);
+
   if (current_buffer->long_line_optimizations_p)
     {
       bool lines_truncated = false;




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

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


Received: (at 64696) by debbugs.gnu.org; 22 Jul 2023 07:09:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 22 03:09:23 2023
Received: from localhost ([127.0.0.1]:35348 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qN6jz-0008J4-8t
	for submit <at> debbugs.gnu.org; Sat, 22 Jul 2023 03:09:23 -0400
Received: from mout01.posteo.de ([185.67.36.65]:57865)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qN6jw-0008Ir-Lv
 for 64696 <at> debbugs.gnu.org; Sat, 22 Jul 2023 03:09:21 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 0F870240027
 for <64696 <at> debbugs.gnu.org>; Sat, 22 Jul 2023 09:09:15 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1690009755; bh=Hg43zBoPogstxborVzkYgY1NO0tUwrCdcw/HQTU2Vfs=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:
 Content-Transfer-Encoding:From;
 b=QOPZPFF7ewKyy/j3l3sw6L/228rvDcuGFQ0UTThgz1+rXvXC+IM7JufkcubNw3kPU
 SLKEIXRtC2/G6OP0PQ0BAP48lejH555e1lIusgl/mpzBNeCZFl56HZ/B/xA6xwCcVL
 uzq0M2Xv0cx9yPaS5ISBRFP+un31XaKUVWrqoa1jf+Ko7NgQwExBU9uLAIv9f2Ifa7
 xfRvArky+o712AWdmElyAhH5Qvg4yi3+LAfzhaEe9mZXSXPGihisEUZECeCewb9xH1
 j/N4efikEff4rDlCjX12WLj6Hd/bYNY91EqIyT/kPiU3zf0S4S7sMAuuItXgf7Acgj
 zTxJr+/4yugoA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R7HbZ0L84z6tyT;
 Sat, 22 Jul 2023 09:09:13 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <834jlwa17v.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <877cqt7jhp.fsf@localhost>
 <834jlwa17v.fsf@HIDDEN>
Date: Sat, 22 Jul 2023 07:09:25 +0000
Message-ID: <87v8ec8lsq.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> With `indent-tabs-mode' disabled, running the test yields different
>> results. (AFAIU, it should not).
>
> Is this about indent-to or about current-column?  I'd like to see
> first if there are any problems in current-column.

Ok.

Test #3 with and without indent-tabs-mode are not the same:

(indent-tabs-mode is nil)
=E2=9B=94 Warning (emacs): Test #3:: =E2=80=99word=E2=80=99 is hidden apply=
ing =E2=80=99invisible text property to heading body.
=E2=9B=94 Warning (emacs): Moved point after first =E2=80=99word=E2=80=99
=E2=9B=94 Warning (emacs): 1:: current-column =3D 0
=E2=9B=94 Warning (emacs): Indented to column 50
=E2=9B=94 Warning (emacs): 3:: current-column =3D 0
=E2=9B=94 Warning (emacs): Enabled visible mode
=E2=9B=94 Warning (emacs): 5:: current-column =3D 54

(indent-tabs-mode is t)
=E2=9B=94 Warning (emacs): Test #3:: =E2=80=99word=E2=80=99 is hidden apply=
ing =E2=80=99invisible text property to heading body.
=E2=9B=94 Warning (emacs): Moved point after first =E2=80=99word=E2=80=99
=E2=9B=94 Warning (emacs): 1:: current-column =3D 0
=E2=9B=94 Warning (emacs): Indented to column 50
=E2=9B=94 Warning (emacs): 3:: current-column =3D 0
=E2=9B=94 Warning (emacs): Enabled visible mode
=E2=9B=94 Warning (emacs): 5:: current-column =3D 50

Note how the last current-column value is different.
It may be something about current-column or about indent-to.

--=20
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 22 Jul 2023 07:03:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 22 03:03:41 2023
Received: from localhost ([127.0.0.1]:35341 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qN6eT-00088r-1f
	for submit <at> debbugs.gnu.org; Sat, 22 Jul 2023 03:03:41 -0400
Received: from mout01.posteo.de ([185.67.36.65]:36373)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qN6eN-00088S-NX
 for 64696 <at> debbugs.gnu.org; Sat, 22 Jul 2023 03:03:39 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id F0D9D240029
 for <64696 <at> debbugs.gnu.org>; Sat, 22 Jul 2023 09:03:29 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1690009410; bh=r7wtRRu4ee7yLo1ihvZiH1KHWFn4C+1O681i5pqOy1I=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:
 Content-Transfer-Encoding:From;
 b=rU838VvGyp3w3MH1dQe2hlHaTfkYs92t9XJm6FOOTM9sM9atmoB2Epqm+12BwjJWL
 XtLq7SGSpGfjRGi6MXbeq3mI1Lu9+yC2NcWJuUatXWtrwPVaWejs5Zs3GPLTBPebal
 PrEEbk/jbEX29N3xAQNVYG/MYcxIBIsp7kb9r0mWSNLb46n1g6B0HDC9xc+WqTbW0C
 K0dQPpOrcN4SIfLi0XwWPPbhRdEBQ1G0zUlTa1Wh7aoSOL8xj0xPgNmU1AlIef2uVu
 4xwVpK4VchaFyRbaXkkPsfj8g3P4jU6FomdBNOEuPzcPsYQftC0JK95y1KSMfsT1c/
 ReY7pRSMEGGyQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R7HSw3wwtz9rxB;
 Sat, 22 Jul 2023 09:03:28 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <835y6ca1ah.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <835y6ca1ah.fsf@HIDDEN>
Date: Sat, 22 Jul 2023 07:03:41 +0000
Message-ID: <87zg3o8m2a.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Ihor Radchenko <yantar92@HIDDEN>
>> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
>> Date: Thu, 20 Jul 2023 09:10:02 +0000
>>=20
>> You can do M-x yant/full-test after evaluating the code below
>
> And what are the problems you see with current-column in this example?
> (Let's leave indent-to alone for now.)

=E2=9B=94 Warning (emacs): Test #1:: Everything visible.
=E2=9B=94 Warning (emacs): Moved point after first =E2=80=99word=E2=80=99
=E2=9B=94 Warning (emacs): 1:: current-column =3D 4

Test #1 is expected - everything is visible, we are indeed at column 4.

=E2=9B=94 Warning (emacs): Test #2:: =E2=80=99word=E2=80=99 is inside folde=
d heading (hidden using overlays).
=E2=9B=94 Warning (emacs): Moved point after first =E2=80=99word=E2=80=99
=E2=9B=94 Warning (emacs): 1:: current-column =3D 4

Test #2 is unexpected - we are inside invisible region, but
current-column reports as if everything were visible.

=E2=9B=94 Warning (emacs): Test #3:: =E2=80=99word=E2=80=99 is hidden apply=
ing =E2=80=99invisible text property to heading body.
=E2=9B=94 Warning (emacs): Moved point after first =E2=80=99word=E2=80=99
=E2=9B=94 Warning (emacs): 1:: current-column =3D 0

Test #3 follows your previous explanation that current-column ignores
invisible text.

--=20
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 22 Jul 2023 06:50:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 22 02:50:33 2023
Received: from localhost ([127.0.0.1]:35335 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qN6Rl-0007ji-LS
	for submit <at> debbugs.gnu.org; Sat, 22 Jul 2023 02:50:33 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:37888)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qN6Rj-0007jW-Py
 for 64696 <at> debbugs.gnu.org; Sat, 22 Jul 2023 02:50:32 -0400
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 1qN6Re-0000Wl-82; Sat, 22 Jul 2023 02:50:26 -0400
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=37ZLUsoa6OBdYpG0EW9eWzM2ibdFM0d56heFGPa0Jrk=; b=W0um3Cek+KIA
 9urrwExKvGKpw6CNtAZ2oRiMdKrBMNCSAUOZ7LzBVew/KBLg9zXIGHpTIlxdahtUeE96ySMhKm2Pe
 NDFIYsn+CSUM9YcrZ7VKc+CvK4HvGcBMPcqLHRgfGqI1+JpG/pFso+bj2t2tCU4dODIZrrrbYVi43
 dlTTpgCHmgLdkyhVEWSlKeMKnphJJfUy05LdmVKSxjte5t115WKc5oktaKKOhbJsNZgpTGqcA5w7z
 YV5h9RFzVGPj9ayvibaaP9wyejJh2Mrp9KcgpA30DFO2ctHjEVyxCCcs7MvGuR0xRfd64T1tnubJf
 +npRP9L+RcOomHNaNtX2TA==;
Received: from [87.69.77.57] (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 1qN6Ra-0007N5-Hf; Sat, 22 Jul 2023 02:50:25 -0400
Date: Sat, 22 Jul 2023 09:51:00 +0300
Message-Id: <834jlwa17v.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <877cqt7jhp.fsf@localhost> (message from Ihor Radchenko on Fri,
 21 Jul 2023 08:32:18 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost> <877cqt7jhp.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Fri, 21 Jul 2023 08:32:18 +0000
> 
> Ihor Radchenko <yantar92@HIDDEN> writes:
> 
> And results also somehow depend on `indent-tabs-mode'.
> If I try
> 
> (defun yant/test-init-buffer ()
>   (switch-to-buffer (get-buffer-create "*Test*"))
>   (delete-other-windows)
>   (unless (eq major-mode 'outline-mode) (outline-mode))
>   (erase-buffer)
>   (indent-tabs-mode -1) ;; <<< do not indent using tabs
>   (insert "\n")
>   (insert "* Test\n")
>   (insert "word word\n")
>   (goto-char (point-min)))
> 
> With `indent-tabs-mode' disabled, running the test yields different
> results. (AFAIU, it should not).

Is this about indent-to or about current-column?  I'd like to see
first if there are any problems in current-column.




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

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


Received: (at 64696) by debbugs.gnu.org; 22 Jul 2023 06:49:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 22 02:49:03 2023
Received: from localhost ([127.0.0.1]:35330 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qN6QJ-0007hW-0o
	for submit <at> debbugs.gnu.org; Sat, 22 Jul 2023 02:49:03 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:37190)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qN6QE-0007h0-DE
 for 64696 <at> debbugs.gnu.org; Sat, 22 Jul 2023 02:49:01 -0400
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 1qN6Q5-00007X-I6; Sat, 22 Jul 2023 02:48:51 -0400
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=fZvUmIS5ple0TMQpvLTn7nB1HSfXGRQ7BGpP6RvkifQ=; b=JadlDXbHV6ww
 5dbaAW9Eq7beNOfAfL9F90yUzjBuM9eJk6sO3KXUmPjxia7c1jN11dYF5DkP3bPhSfTqFHEB+utU8
 Uwmswvh1cZjP1PByJeykXJJJWf9EsfvrPpeZ1lsEnaicsCiNdltO088TgD4/u17zKwzMmnTQ1D8+d
 imlea+BuuDo+cST9ezLbZq7oJcppXi/kDd0zga5jWto64JS+JwWLBmdD/KEkLPo7034m+EqXEigUK
 LIIkKn7PbMkBNVj8zoBWEl5qfZ1smr4BzbFlrrTdJjDig+viwiUGDmHmh6bom0uZ2ENew67TxkLE3
 e4uvK4Kul8W9srQwgCpqjQ==;
Received: from [87.69.77.57] (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 1qN6Q4-0001qG-Da; Sat, 22 Jul 2023 02:48:49 -0400
Date: Sat, 22 Jul 2023 09:49:26 +0300
Message-Id: <835y6ca1ah.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87jzuvq785.fsf@localhost> (message from Ihor Radchenko on Thu,
 20 Jul 2023 09:10:02 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN> <87jzuvq785.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Thu, 20 Jul 2023 09:10:02 +0000
> 
> You can do M-x yant/full-test after evaluating the code below

And what are the problems you see with current-column in this example?
(Let's leave indent-to alone for now.)




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

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


Received: (at 64696) by debbugs.gnu.org; 21 Jul 2023 08:32:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 21 04:32:18 2023
Received: from localhost ([127.0.0.1]:60536 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qMlYg-00075V-3K
	for submit <at> debbugs.gnu.org; Fri, 21 Jul 2023 04:32:18 -0400
Received: from mout02.posteo.de ([185.67.36.66]:49295)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qMlYb-000759-6R
 for 64696 <at> debbugs.gnu.org; Fri, 21 Jul 2023 04:32:16 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 5C00F240103
 for <64696 <at> debbugs.gnu.org>; Fri, 21 Jul 2023 10:32:07 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1689928327; bh=28Dti7k6KDXAIgP52l3llbK7e6W7TCd6rtqMLYZK8z8=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=cWtR6+JGa8aH0PGIAHt7yo3Vd8YSRC9eBa7ub+nSJsuOMSHr36F9jQYMkjFSvjN+0
 Ik2V9uYn9QqgMRcVPodIXIjY9A4Y4KICI6UErwjbJXhGaXoQvS74GWRN8ZhhNvU+GB
 /Bp4zY5m3tyAEUvC9pWw/5cTV02UspvftTQVpCB4h/9ebGIfcQUozgKtUpkUDrVfI3
 KQpxICVHqyRHZNxfzsfArn3+VrRHVwPPTJ4gn2L8NXZr0B8O0DResbu8ZqWLQjy/Jy
 KxnILnlmhr5LCdhMlGDe48czCyMoA14l36Km6DOjSrz4SBzwsNapIVXec87LK5ExbD
 e8fmeW/UcwETg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R6jTf1Hcyz6txH;
 Fri, 21 Jul 2023 10:32:06 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <87jzuvq785.fsf@localhost>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
 <87jzuvq785.fsf@localhost>
Date: Fri, 21 Jul 2023 08:32:18 +0000
Message-ID: <877cqt7jhp.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Ihor Radchenko <yantar92@HIDDEN> writes:

> (defun yant/test-init-buffer ()
>   (switch-to-buffer (get-buffer-create "*Test*"))
>   (delete-other-windows)
>   (unless (eq major-mode 'outline-mode) (outline-mode))
>   (erase-buffer)
>   (insert "\n")
>   (insert "* Test\n")
>   (insert "word word\n")
>   (goto-char (point-min)))

And results also somehow depend on `indent-tabs-mode'.
If I try

(defun yant/test-init-buffer ()
  (switch-to-buffer (get-buffer-create "*Test*"))
  (delete-other-windows)
  (unless (eq major-mode 'outline-mode) (outline-mode))
  (erase-buffer)
  (indent-tabs-mode -1) ;; <<< do not indent using tabs
  (insert "\n")
  (insert "* Test\n")
  (insert "word word\n")
  (goto-char (point-min)))

With `indent-tabs-mode' disabled, running the test yields different
results. (AFAIU, it should not).

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 20 Jul 2023 09:10:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 20 05:10:05 2023
Received: from localhost ([127.0.0.1]:57662 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qMPfg-0007kU-Bw
	for submit <at> debbugs.gnu.org; Thu, 20 Jul 2023 05:10:05 -0400
Received: from mout01.posteo.de ([185.67.36.65]:37773)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qMPfa-0007jp-Vd
 for 64696 <at> debbugs.gnu.org; Thu, 20 Jul 2023 05:10:02 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id C5E3A24002A
 for <64696 <at> debbugs.gnu.org>; Thu, 20 Jul 2023 11:09:52 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1689844192; bh=kxbw0WztD5k3dcwAO+uFocGZbNxdbtwhqn+ZZTt49s4=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=q65IaUpQDDNNzHteLggzw9VW0QFgdKk3onVh9RrOjXp1Q5Q9Mc2p3BFwN9UWls800
 1Q5VUsEvKJhmxVUIQHjA/9rYQQW+Jg9Z7n8fwMcZ8yyeFREKTljjScV6RlVSTyAxih
 xmULaDbCWzOMqMPynC1AmlmEUYNQTreKXvW25TWrBMyclkVjA7xr9VulDJZhwAImV4
 iHcSVrSCfnfj4IPxJteOWpJaod/QZ4DHwiu+/n3vfjyEpnDEkdRpFMTTa4zCTowcUN
 Qnm/Gpz5W8lu2Fw9iX+NHd9/x2qxQPP+WR9LlrVqFypKYfxfRI2Xv63JOV5IJIeh/g
 Yank6fEeE1lwQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R66Mg4nnzz6tw0;
 Thu, 20 Jul 2023 11:09:51 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <831qh459sy.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
 <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@HIDDEN>
Date: Thu, 20 Jul 2023 09:10:02 +0000
Message-ID: <87jzuvq785.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> > Invisible text is skipped by current-column.
>> 
>> I am not sure if I understand what you mean by "skipped".
>
> "Skipped" means that the invisible text is not counted as occupying
> columns on display.  It is skipped without incrementing the column
> count.  See this part of scan_for_column:

In my tests, invisible overlay property does not appear to affect things.

>> Consider the following file in outline-mode:
>> [...]
>
> Please make it easier for me to follow the questions you are asking
> and provide helpful responses by (a) making the recipes as simple as
> possible, and (b) by describing them in full detail.  "Folded",
> "unfolded heading", "applied invisible text property", etc. -- all
> those might be crystal clear to you, but they aren't so to me, and
> require me to guess (and err) what exactly did you do and how.

Sure.
You can do M-x yant/full-test after evaluating the code below

(defun yant/test-indent-columns ()
  (visible-mode -1)
  (search-forward "word")
  (warn "Moved point after first 'word'")
  (warn "1:: current-column = %d" (current-column))
  (redisplay)
  (warn "redisplayed")
  (warn "2:: current-column = %d" (current-column))
  (indent-to 50)
  (warn "Indented to column 50")
  (warn "3:: current-column = %d" (current-column))
  (redisplay)
  (warn "redisplayed")
  (warn "4:: current-column = %d" (current-column))
  (visible-mode +1)
  (warn "Enabled visible mode")
  (warn "5:: current-column = %d" (current-column))
  (redisplay)
  (warn "redisplayed")
  (warn "6:: current-column = %d" (current-column))
  (visible-mode -1)
  (read-char "Press any key")
  (kill-buffer))

(defun yant/test-init-buffer ()
  (switch-to-buffer (get-buffer-create "*Test*"))
  (delete-other-windows)
  (unless (eq major-mode 'outline-mode) (outline-mode))
  (erase-buffer)
  (insert "\n")
  (insert "* Test\n")
  (insert "word word\n")
  (goto-char (point-min)))

(defun yant/full-test ()
  (interactive)
  (when (get-buffer "*Warnings*")
    (with-current-buffer "*Warnings*" (with-silent-modifications (erase-buffer))))
  (yant/test-init-buffer)
  (warn "We are going to indent second 'word' to column 50 and check `current-column'.")
  (outline-show-all)
  (warn "Test #1:: Everything visible.")
  (read-char "Press any key to start the test")
  (yant/test-indent-columns)
  (yant/test-init-buffer)
  (warn "Test #2:: 'word' is inside folded heading (hidden using overlays).")
  (outline-cycle-buffer)
  (read-char "Press any key to start the test")
  (yant/test-indent-columns)
  (yant/test-init-buffer)
  (warn "Test #3:: 'word' is hidden applying 'invisible text property to heading body.")
  (outline-show-all)
  (save-excursion
    (search-forward "Test")
    (with-silent-modifications (put-text-property (point) (point-max) 'invisible t)))
  (read-char "Press any key to start the test")
  (yant/test-indent-columns)
  (yant/test-init-buffer)
  (warn "Test #4:: 'word' is hidden applying non-sticky 'invisible text property to heading body.")
  (outline-show-all)
  (save-excursion
    (search-forward "Test")
    (with-silent-modifications (put-text-property (point) (point-max) 'invisible t))
    (with-silent-modifications (put-text-property (point) (point-max) 'rear-nonsticky '(invisible))))
  (read-char "Press any key to continue")
  (yant/test-indent-columns))


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 19 Jul 2023 15:08:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 19 11:08:46 2023
Received: from localhost ([127.0.0.1]:56963 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qM8nG-0005ox-Ba
	for submit <at> debbugs.gnu.org; Wed, 19 Jul 2023 11:08:46 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43992)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qM8nE-0005od-FM
 for 64696 <at> debbugs.gnu.org; Wed, 19 Jul 2023 11:08:45 -0400
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 1qM8n8-0004Xl-AX; Wed, 19 Jul 2023 11:08:38 -0400
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=SAeztQjBxeicDTcRQo7XuyA4C7gYLOezB2gBg4hYVKI=; b=VHwWrnVtl8vn
 F1UMeJV56j+/oONgFPuqXMjDQMvLQMXF3O0f55W+wudan55hVJ0Oi4qkboWTNxHjgqbeRbfm73i6o
 iyTyvOZV/nA41TahBVoeyXvsIeiuExkjbGaG8kzlfSpq9Yboi8kwiitSe+03KHMDIZTgaijmKnCvS
 oQ5l2gSt/k/du9eqe9hMYBlf/P+F6jnN0hEqFfcQRaIERXeg/EhJnaljRmyCZsY09gNc3wsNUCM4K
 N2Fc9meamyX+pO5SojjpcbV5w/x1ATqimPKmXyVWnREw6u0D5tG/JUsHYiXj6HUs8c1//J6Dzt9dK
 +798Yb2lWQ6tR0dIfFdlLg==;
Received: from [87.69.77.57] (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 1qM8n3-0004lr-CS; Wed, 19 Jul 2023 11:08:36 -0400
Date: Wed, 19 Jul 2023 18:09:05 +0300
Message-Id: <83pm4o3pm6.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87cz0oyo43.fsf@localhost> (message from Ihor Radchenko on Wed,
 19 Jul 2023 14:25:48 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <jwv7cqx5nvm.fsf-monnier+emacs@HIDDEN>
 <83y1jd5gyf.fsf@HIDDEN> <jwvttu1qarv.fsf-monnier+emacs@HIDDEN>
 <87y1jcl2be.fsf@localhost> <83zg3s3v3q.fsf@HIDDEN> <87cz0oyo43.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Wed, 19 Jul 2023 14:25:48 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > I don't see any inconsistency.  'insert' is a much more
> > general-purpose primitive than indent-to.  It would be dead wrong for
> > each insertion to inherit the properties.
> >
> > indent-to is different: when you indent text, you supposed want the
> > whitespace to use the same face, for example.  Think about it.
> 
> Not necessarily. Sometimes, we just use it for plain text alignment.
> Like in block comments or Org tables.

I can understand "sometimes".  My point was that it isn't "always" nor
even "almost always".  IOW, the fact that indent-to inherits is not
arbitrary.




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

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


Received: (at 64696) by debbugs.gnu.org; 19 Jul 2023 14:25:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 19 10:25:46 2023
Received: from localhost ([127.0.0.1]:56893 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qM87d-0004c5-Na
	for submit <at> debbugs.gnu.org; Wed, 19 Jul 2023 10:25:46 -0400
Received: from mout02.posteo.de ([185.67.36.66]:59339)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qM87a-0004bn-VO
 for 64696 <at> debbugs.gnu.org; Wed, 19 Jul 2023 10:25:44 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 5799D240101
 for <64696 <at> debbugs.gnu.org>; Wed, 19 Jul 2023 16:25:37 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1689776737; bh=uwq9FIDCuZxzANH7ZZd7Ijma5JcCoV3/DMT8bQNpvsg=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=r1F0jgGQxedW8ztZOft6UiqitrDU3JLZHhKWkn4ATHZ27Ol3Z9YHOroJoWoHTMWsE
 miCxop3KmUZihU07BMfAkf7YHH1+2VpOtobHW4XnhU//BpIVGPcc2okRlM9leMQpub
 5oIpCK4FFkxw5XKAcU75oiEVRWFXUvLk7aPXRaGaIkj9zj/Chh3FhaLKOGYtkVwEsl
 xCGpTPXxaDXdr6v325Pk3TCqzgcZ5091qiim+rbaMthmN0IqNUqyX2t3bKboT24FDz
 igYlwdW0kg5NRrPe0ukvfHrc/+W7kzSoPqhejIVwmEYOJ0ihF4nW9tgmPo64HaYCQU
 qAwZ+F/3LRmaA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R5dQS3FVmz6txP;
 Wed, 19 Jul 2023 16:25:36 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <83zg3s3v3q.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <jwv7cqx5nvm.fsf-monnier+emacs@HIDDEN>
 <83y1jd5gyf.fsf@HIDDEN> <jwvttu1qarv.fsf-monnier+emacs@HIDDEN>
 <87y1jcl2be.fsf@localhost> <83zg3s3v3q.fsf@HIDDEN>
Date: Wed, 19 Jul 2023 14:25:48 +0000
Message-ID: <87cz0oyo43.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

> I don't see any inconsistency.  'insert' is a much more
> general-purpose primitive than indent-to.  It would be dead wrong for
> each insertion to inherit the properties.
>
> indent-to is different: when you indent text, you supposed want the
> whitespace to use the same face, for example.  Think about it.

Not necessarily. Sometimes, we just use it for plain text alignment.
Like in block comments or Org tables.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 19 Jul 2023 13:52:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 19 09:52:21 2023
Received: from localhost ([127.0.0.1]:55221 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qM7bJ-0003M3-Lf
	for submit <at> debbugs.gnu.org; Wed, 19 Jul 2023 09:52:21 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:19220)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1qM7bF-0003Lk-Ns
 for 64696 <at> debbugs.gnu.org; Wed, 19 Jul 2023 09:52:20 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D69B944085D;
 Wed, 19 Jul 2023 09:52:11 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DC72E4413C7;
 Wed, 19 Jul 2023 09:51:33 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1689774693;
 bh=2pZev88R96DdkHctJvBwJjXFd935G4aHVIcPMdpxF0A=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=dTPPRa9BSgmHi3Q/x5juKnPYLhGHbszsHSw7V3rSOt8wUnIdHrgz99wk94iExc7nd
 r/KydH8eGPHPu3ODw1gKF84xj29xEsTiu5zPDEpVJhI0KSmUXDGFO7TWyiN0jaTCyu
 reXKTwVCYW9wq21VgBUTs+ZHwtznx/OxL/X8HrobIgo7x51ubo3EF8fiM3ZLNUsYQX
 okpBsaicYLJq+W9dVzv/UL74Lwx6+he/FjtD4eEykNKSmxRho2OO4aBF6XGr4U/JQZ
 sJEUD7d+A8K1mCD8xG+Aauin1nVJjCU1Jr/7xUzopgyQOarCmGpLKY4SiS6/RWn4np
 P2i+0qWqiWSgw==
Received: from pastel (unknown [104.247.226.95])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B6AF51201F0;
 Wed, 19 Jul 2023 09:51:33 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <871qh4mgxo.fsf@localhost> (Ihor Radchenko's message of "Wed, 19
 Jul 2023 08:41:39 +0000")
Message-ID: <jwvlefc2epc.fsf-monnier+emacs@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <jwv7cqx5nvm.fsf-monnier+emacs@HIDDEN>
 <871qh4mgxo.fsf@localhost>
Date: Wed, 19 Jul 2023 09:51:31 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.025 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: Eli Zaretskii <eliz@HIDDEN>, 64696 <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 (---)

>> Could you give a bit of background about why you use set an `invisible`
>> property that is inherited when inserting chars after it?
>>
>> I mean I understand it's the default behavior of the `invisible`
>> property, but when making a piece of text invisible, it's common
>> that we arrange for that invisible property not to leak to text inserted
>> after it (either by setting the marker type of the overlay's end
>> or via the `rear-nonsticky` text-property).
>> This is useful for when the users goes and types right after the
>> invisible text, otherwise their text becomes invisible.
>
> Because Org sets and clears invisible property manually during fontification.

I don't see how that explains why you chose to set an `invisible`
property that is inherited when inserting chars after it.


        Stefan





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

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


Received: (at 64696) by debbugs.gnu.org; 19 Jul 2023 13:10:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 19 09:10:10 2023
Received: from localhost ([127.0.0.1]:55180 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qM6wT-00085K-Ko
	for submit <at> debbugs.gnu.org; Wed, 19 Jul 2023 09:10:09 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:48448)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qM6wR-000856-KD
 for 64696 <at> debbugs.gnu.org; Wed, 19 Jul 2023 09:10:08 -0400
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 1qM6wM-0000GZ-6u; Wed, 19 Jul 2023 09:10:02 -0400
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=GcBz1bLZIopWGcE+19thsnCqqx9cG8X91WYpTvSKxO8=; b=O1NlJ6JCkWbM
 V4IdmPKpxkp5PsJIKFLBBPGSQKK+QeWpQxJ8hX9ovJEzfhZYkponhEABpPuhVcmMCTc1BBiDLWJ82
 hg33RPxbO9+QzRj3OQqBgxK0t1yX+lJIpqJc7+qgJhniLblifcZeimJdeqKkEPy+a44a/QbS6fgaa
 PcRQGGKgWwdXU92QMs97u2gMkcVUr3DJyysH1WyBM1DbnPzTsv/bd/JeC+U9t9lk29G6+RiK+lqB3
 Ha/FE5QnFXwQT2xWyinpMPVmx+i3Vh7DZfzxnDpbRXVAfBuDtc6zeBQx2OG3Rq/GrF2rb7UwEkv9r
 YhWa45zUO1zqh7NyTPdANw==;
Received: from [87.69.77.57] (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 1qM6wL-0004y0-HX; Wed, 19 Jul 2023 09:10:01 -0400
Date: Wed, 19 Jul 2023 16:10:33 +0300
Message-Id: <83zg3s3v3q.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87y1jcl2be.fsf@localhost> (message from Ihor Radchenko on Wed,
 19 Jul 2023 08:42:45 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <jwv7cqx5nvm.fsf-monnier+emacs@HIDDEN>
 <83y1jd5gyf.fsf@HIDDEN> <jwvttu1qarv.fsf-monnier+emacs@HIDDEN>
 <87y1jcl2be.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>, 64696 <at> debbugs.gnu.org
> Date: Wed, 19 Jul 2023 08:42:45 +0000
> 
> Stefan Monnier <monnier@HIDDEN> writes:
> 
> >>> FWIW, I can't see any good reason to inherit properties here, other than
> >>> "we've always done that", but I'd be surprised if making this change
> >>> won't affect some other use elsewhere :-(
> >>
> >> ??? That's a non-starter, from where I stand.
> >
> > I formulated it differently, but you're just agreeing with the "but ..."
> > quoted above :-)
> 
> Note that unlike `indent-to', `insert' does not inherit properties.
> Not to say that changing `indent-to' is safe, but there is slight
> historical inconsistency here.

I don't see any inconsistency.  'insert' is a much more
general-purpose primitive than indent-to.  It would be dead wrong for
each insertion to inherit the properties.

indent-to is different: when you indent text, you supposed want the
whitespace to use the same face, for example.  Think about it.




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

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


Received: (at 64696) by debbugs.gnu.org; 19 Jul 2023 13:07:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 19 09:07:23 2023
Received: from localhost ([127.0.0.1]:55175 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qM6tm-000819-Uf
	for submit <at> debbugs.gnu.org; Wed, 19 Jul 2023 09:07:23 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:52882)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qM6tj-00080u-Ri
 for 64696 <at> debbugs.gnu.org; Wed, 19 Jul 2023 09:07:20 -0400
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 1qM6tc-0006Aa-AU; Wed, 19 Jul 2023 09:07:13 -0400
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=Az71CHyvz/nLykmD7ekf3Z2CU8QxgS5o+ZqlcFJFZyM=; b=Ddnq7jivbLDB
 r+RPDqWd/GBZOv2hm6KA6xGcWX3ncvedBgAmsEHijLlZ9qmWe889NVw2iXeDUONHoYjUzAIK3OJJv
 /zB3J5NUvJFpsTwNGd/Pe078KYwGV9LdBk3pIs/7hsXLckdAqUaGgUSHZn4quzBxkt07Me5F/rgPP
 N306Nn9yKGTrNnhHx5WgAE6SqWin5l47TIGE/ujCYQBDV46/Ke7B44hSi4qbXyIFApMha0/vLE3qj
 d1edl4sw2jRiW/J70bhkBMpuqKXWvhprze0Vo7YKoPlKME+3WcAwbxYTQxWdzipzAWOYPeT+WADrG
 ZSPpGZdO5nCr5lk5xb//HA==;
Received: from [87.69.77.57] (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 1qM6tb-0008RB-JK; Wed, 19 Jul 2023 09:07:12 -0400
Date: Wed, 19 Jul 2023 16:07:41 +0300
Message-Id: <831qh459sy.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <874jm0mhgb.fsf@localhost> (message from Ihor Radchenko on Wed,
 19 Jul 2023 08:30:28 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN> <874jm0mhgb.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Wed, 19 Jul 2023 08:30:28 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> However, I do not fully understand what happens if we try to indent
> >> fully hidden text (like inside Org's folds). See my previous bug
> >> reports: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56837 and
> >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58791
> >
> > Invisible text is skipped by current-column.
> 
> I am not sure if I understand what you mean by "skipped".

"Skipped" means that the invisible text is not counted as occupying
columns on display.  It is skipped without incrementing the column
count.  See this part of scan_for_column:

  /* Scan forward to the target position.  */
  while (scan < end)
    {
      int c;

      /* Occasionally we may need to skip invisible text.  */
      while (scan == next_boundary)
	{
	  ptrdiff_t old_scan = scan;
	  /* This updates NEXT_BOUNDARY to the next place
	     where we might need to skip more invisible text.  */
	  scan = skip_invisible (scan, &next_boundary, end, Qnil);

And note that I was only talking about current-column (and
move-to-column, which AFAIR behaves the same).

> Consider the following file in outline-mode:
> [...]

Please make it easier for me to follow the questions you are asking
and provide helpful responses by (a) making the recipes as simple as
possible, and (b) by describing them in full detail.  "Folded",
"unfolded heading", "applied invisible text property", etc. -- all
those might be crystal clear to you, but they aren't so to me, and
require me to guess (and err) what exactly did you do and how.

Please understand: I have very limited time to invest in answering
questions about how the Emacs internals work and why.  I have too
little free time and too much to do, day in and day out, just to keep
this project moving.  So please have mercy on me, and help me answer
your questions (a lot of them lately, btw), in a useful manner,
without spending an inordinate amount of time.  Each such question
usually requires looking up stuff in the code, describing it to you in
enough detail for you to understand, sometimes stepping through the
code in a debugger to make sure the code really works like I think it
does, etc.  Add to this the need to understand what you mean by all
those undisclosed details, and the burden becomes unbearable.

Please!




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

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


Received: (at 64696) by debbugs.gnu.org; 19 Jul 2023 08:42:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 19 04:42:44 2023
Received: from localhost ([127.0.0.1]:54939 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qM2lg-0006g0-0v
	for submit <at> debbugs.gnu.org; Wed, 19 Jul 2023 04:42:44 -0400
Received: from mout01.posteo.de ([185.67.36.65]:33667)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qM2lc-0006fh-BB
 for 64696 <at> debbugs.gnu.org; Wed, 19 Jul 2023 04:42:42 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id C0193240028
 for <64696 <at> debbugs.gnu.org>; Wed, 19 Jul 2023 10:42:34 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1689756154; bh=N2f4M5SLviksu9PDPRYCB44Crz2uyRGfZ7UkUwrRHtI=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=aTTPhK9shxroTtosn9L5ose9bjCeJhjvYdd/kEZr3sYvdUcwUzE4gU6Z+x1hnlyjR
 i374m7oz9tGlczWbSuUxnY3m68q87EopxsIjjGzGS/QKCOIL5/FwElIamoEMrSvTFU
 KFssFEE7MEa2jqt1N+GsTsoFTCOdt3CmgQmDfS/mBIxDmmSJxXZj3JpkYNSb6WIImq
 G6yEOW0PUFIiftRMELHLN5tPaXdbr08ZnmwxFNfmFsBmYoYtw7avNsTjRAN3ZS/nOV
 LvJJ9OIsToc0nv1109oXykZoyIHFF6H8FzBnbrR90swGGK7hEVNHCLGbSzb+22zEaQ
 DXUaWtHl3eJMw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R5Tpf0qYXz9rxF;
 Wed, 19 Jul 2023 10:42:33 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <jwvttu1qarv.fsf-monnier+emacs@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <jwv7cqx5nvm.fsf-monnier+emacs@HIDDEN>
 <83y1jd5gyf.fsf@HIDDEN> <jwvttu1qarv.fsf-monnier+emacs@HIDDEN>
Date: Wed, 19 Jul 2023 08:42:45 +0000
Message-ID: <87y1jcl2be.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: Eli Zaretskii <eliz@HIDDEN>, 64696 <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 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>>> FWIW, I can't see any good reason to inherit properties here, other than
>>> "we've always done that", but I'd be surprised if making this change
>>> won't affect some other use elsewhere :-(
>>
>> ??? That's a non-starter, from where I stand.
>
> I formulated it differently, but you're just agreeing with the "but ..."
> quoted above :-)

Note that unlike `indent-to', `insert' does not inherit properties.
Not to say that changing `indent-to' is safe, but there is slight
historical inconsistency here.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 19 Jul 2023 08:41:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 19 04:41:38 2023
Received: from localhost ([127.0.0.1]:54935 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qM2kc-0006eC-II
	for submit <at> debbugs.gnu.org; Wed, 19 Jul 2023 04:41:38 -0400
Received: from mout01.posteo.de ([185.67.36.65]:33421)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qM2kY-0006dx-LV
 for 64696 <at> debbugs.gnu.org; Wed, 19 Jul 2023 04:41:37 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id CA46A24002D
 for <64696 <at> debbugs.gnu.org>; Wed, 19 Jul 2023 10:41:28 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1689756088; bh=JfD5HEvHv02LYZGEQoJRj+rBcKYQ+bD9bevN8k524cA=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=mqw4aoF7S5EVS68UBJyIK04rWu8UUfhef32j+Z3VEUPtH4ky44iz+ebjGuz3pwm99
 NRt+YJshisrxU9bCVw+ncSbCL5RP7AbbX5z13+oLfWfY7ucFQFTNKRa980OsX0Vdui
 hW2UMk7SnA6QCtvxHJ5rV23JCbvOER5h2R2sEuUi2n0i4OBO29wUzTxw6oZL2QY130
 8gL4wDbAYiywPtlUjmeVcX2TtbMrXWHZyFmHN2ryj1l3GrBTHPExs7AnmgrJO0RqX+
 FftAns6dKRffahdB5v/RBJlTm+XlreJSAxbFnYTNPzuL1VqMKGFR6VBpgpSVYxwlSQ
 oDcRlLxdaMQTQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R5TnN0Lf3z6tmv;
 Wed, 19 Jul 2023 10:41:27 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <jwv7cqx5nvm.fsf-monnier+emacs@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <jwv7cqx5nvm.fsf-monnier+emacs@HIDDEN>
Date: Wed, 19 Jul 2023 08:41:39 +0000
Message-ID: <871qh4mgxo.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: Eli Zaretskii <eliz@HIDDEN>, 64696 <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 (---)

Stefan Monnier <monnier@HIDDEN> writes:

> Could you give a bit of background about why you use set an `invisible`
> property that is inherited when inserting chars after it?
>
> I mean I understand it's the default behavior of the `invisible`
> property, but when making a piece of text invisible, it's common
> that we arrange for that invisible property not to leak to text inserted
> after it (either by setting the marker type of the overlay's end
> or via the `rear-nonsticky` text-property).
> This is useful for when the users goes and types right after the
> invisible text, otherwise their text becomes invisible.

Because Org sets and clears invisible property manually during fontification.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 19 Jul 2023 08:30:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 19 04:30:29 2023
Received: from localhost ([127.0.0.1]:54923 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qM2Zo-0006NF-Sp
	for submit <at> debbugs.gnu.org; Wed, 19 Jul 2023 04:30:29 -0400
Received: from mout02.posteo.de ([185.67.36.66]:60149)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qM2Zk-0006Ms-Ta
 for 64696 <at> debbugs.gnu.org; Wed, 19 Jul 2023 04:30:27 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id F210B240101
 for <64696 <at> debbugs.gnu.org>; Wed, 19 Jul 2023 10:30:18 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1689755419; bh=KmjwgLvEkO5h1GnWEMBDJ0DgXRG1Rfg3KqrYTbitobs=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=Nw//aSxdVx/0ALE8l59AMJk/bHkLhh28j2CeHhLaGBnh6ZNmVpKukSqTKGLpdJr6k
 63Pme81/GX1vejNf5XaCWCJkqZ//j5O6MGGaQ3qJ7KvUU5jlc5TbzE2eYHiDQoDkGU
 De5avGtSCigr9M88nkbHSgunlPmDiVhKsdNTLJA3OsC+otu56GuPEIsuMoz+VtzMbD
 WuN14wadSsxhKs6QVO1VBQVLaMCWc/CXPajLrRukr3C+saLNgRKLbFHkHbDjGb4JUL
 YrVKLwHylxJxViMdLcn0NSBcptFlYfXbXPOrWMzwR2Gu0y3gq73IVjJ8SU+qPpVd3M
 Vhu3/ecjvQsvQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R5TXT6S0Cz9rxY;
 Wed, 19 Jul 2023 10:30:17 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <83pm4p5er8.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
 <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@HIDDEN>
Date: Wed, 19 Jul 2023 08:30:28 +0000
Message-ID: <874jm0mhgb.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> However, I do not fully understand what happens if we try to indent
>> fully hidden text (like inside Org's folds). See my previous bug
>> reports: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56837 and
>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58791
>
> Invisible text is skipped by current-column.

I am not sure if I understand what you mean by "skipped".
Consider the following file in outline-mode:

-----
<point>
* This
word word
-----

I tried the following command with M-:

(progn
  (visible-mode -1)
  (search-forward "word")
  (message "1:: current-column = %d" (current-column))
  (redisplay)
  (message "2:: current-column = %d" (current-column))
  (indent-to 50)
  (message "3:: current-column = %d" (current-column))
  (redisplay)
  (message "4:: current-column = %d" (current-column))
  (visible-mode +1)
  (message "5:: current-column = %d" (current-column))
  (redisplay)
  (message "6:: current-column = %d" (current-column))
  (visible-mode -1))

First, I left the heading unfolded:

1:: current-column = 4
2:: current-column = 4
3:: current-column = 50
4:: current-column = 50
5:: current-column = 50
6:: current-column = 50

Then, I undid the indent, folded the heading, and repeated

1:: current-column = 4 <==== same despite text being invisible via overlay
2:: current-column = 4
3:: current-column = 50
4:: current-column = 50
5:: current-column = 50
6:: current-column = 50

Then, I undid the indent again, and applied 'invisible text property to
the heading text

1:: current-column = 0 <==== now, `current-column' ignores the invisible text
2:: current-column = 0
3:: current-column = 50 <=== This presumably inserts more tabs/spaces, but not!
4:: current-column = 0  <=== redisplay changed `current-column' ??
5:: current-column = 50 <=== indeed, the number of spaces is the same as visible text
6:: current-column = 50

Then, I repeated again, but applied 'rear-nonsticky (invisible) text
property as well

1:: current-column = 0
2:: current-column = 0
3:: current-column = 50
4:: current-column = 50
5:: current-column = 50
6:: current-column = 50

I cannot make much sense of the above results.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 18 Jul 2023 19:33:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 18 15:33:58 2023
Received: from localhost ([127.0.0.1]:54338 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qLqSL-0000OQ-Ii
	for submit <at> debbugs.gnu.org; Tue, 18 Jul 2023 15:33:58 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:49155)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1qLqSF-0000O3-Mj
 for 64696 <at> debbugs.gnu.org; Tue, 18 Jul 2023 15:33:56 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 746E48065C;
 Tue, 18 Jul 2023 15:33:46 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 337C88024B;
 Tue, 18 Jul 2023 15:33:45 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1689708825;
 bh=Ahjal31Np4ax7KZnSX+Ykbl+cGfMRBfMHigUxCAWEMY=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=Fn8sZ/cQM6ya77v30c/Y2z64o6zQn8+baO6iN3zxtpS3AADRKlJZtgy64sbYQcO4F
 aX2xwV9dhmtmKxdHI1dF6lunzAOS6vx/RZKV3qjgABGca2NCz7yq3FugB380G5RFx5
 GmH+VlyGThiEJJnZehVU1nCG8ANEpVWIJ+HCRHP+VB8cpAguEqS6IOjP7z1QkUXSuD
 R1zcWKQqmiBWYf9LDc6npNp5y5E70F57Rm/Hyuv2XVmplqXXlYHYeIUO1B/iaVrp4V
 G9XUvnt965BCjI3srNdaoK6FxP0xNEpaG3Zkf6+Fz0hKAHFUXqaetdMKMjNV/BM8qY
 /d0fx4n5YNAyg==
Received: from alfajor (unknown [23.233.149.155])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0AD2512025D;
 Tue, 18 Jul 2023 15:33:45 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <83y1jd5gyf.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 18 Jul
 2023 19:20:56 +0300")
Message-ID: <jwvttu1qarv.fsf-monnier+emacs@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <jwv7cqx5nvm.fsf-monnier+emacs@HIDDEN>
 <83y1jd5gyf.fsf@HIDDEN>
Date: Tue, 18 Jul 2023 15:33:44 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.296 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: yantar92@HIDDEN, 64696 <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 (---)

>> FWIW, I can't see any good reason to inherit properties here, other than
>> "we've always done that", but I'd be surprised if making this change
>> won't affect some other use elsewhere :-(
>
> ??? That's a non-starter, from where I stand.

I formulated it differently, but you're just agreeing with the "but ..."
quoted above :-)

> If you really think it can be useful for the inserted whitespace to
> lose _all_ of the properties,

Yes, I think if we could go back in 1994 and not pass that arg back
then, it would have been a better choice and wouldn't have introduced
any significant problem.

> I can suggest a new optional argument to do that.  Would that be
> good enough?

It might indeed be the best we can do now.  It's probably going to be
ugly to get that argument from where we know we need it through other
functions to `indent-to` :-(

But before we go through that, I'd still like to hear the general
context where the problem occurs in Org (e.g. why wasn't
`read-nonsticky` used).


        Stefan





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

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


Received: (at 64696) by debbugs.gnu.org; 18 Jul 2023 17:08:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 18 13:08:06 2023
Received: from localhost ([127.0.0.1]:54123 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qLoBC-0004ow-1m
	for submit <at> debbugs.gnu.org; Tue, 18 Jul 2023 13:08:06 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40264)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qLoBA-0004oR-3M
 for 64696 <at> debbugs.gnu.org; Tue, 18 Jul 2023 13:08:04 -0400
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 1qLoB4-0001Oy-SE; Tue, 18 Jul 2023 13:07:58 -0400
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=X0pMsmYe6mDBwPpNBz6umFe1QDO9mVBmggLMj80mrOU=; b=XGIyBgxJJpt4
 3s5OSlCRSqnfCiiK73rH2JpdGm1GgpB9WpplOA89TLMTjkGYxZQmnw/lIzn8oT9rWvco3Q48reBaK
 klBRGIk7E12uCVW/nXrZdadZUPJJWHMqHdACZVpd5vl4I+SZia48gMc1YS0TKlXdLr0jkQhKRHde5
 eP5Sf9REqsBP8S8H8t6xkphc+PgZEsPMrI+vCbOqB/sIA/XhcE5JZ/SSW75oV58NyKhiG3zbLGm9t
 0NM3GmvCWFZPLHEJ1czktgghQoaH+3AFdNDT3F0LqOHxBgTwMRgmEko+Nu+7qvnV3vmGizpD5dik9
 yHl8FXAqMtc/CmlNCBg0Aw==;
Received: from [87.69.77.57] (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 1qLoB4-0006G3-5g; Tue, 18 Jul 2023 13:07:58 -0400
Date: Tue, 18 Jul 2023 20:08:27 +0300
Message-Id: <83pm4p5er8.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <871qh52nlw.fsf@localhost> (message from Ihor Radchenko on Tue,
 18 Jul 2023 16:25:31 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN> <871qh52nlw.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Tue, 18 Jul 2023 16:25:31 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > I was actually trying to understand what alternative behavior you'd
> > like to see.
> 
> I am not sure, because I do not fully understand how the new
> implementation of `current-column' works in the wild.
> 
> My general understanding of the indentation is that it works "visually",
> so that indentation makes things look aligned to graphical column in
> the displayed Emacs windows.

It tries, yes.

> However, I do not fully understand what happens if we try to indent
> fully hidden text (like inside Org's folds). See my previous bug
> reports: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56837 and
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58791

Invisible text is skipped by current-column.




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

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


Received: (at 64696) by debbugs.gnu.org; 18 Jul 2023 16:25:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 18 12:25:31 2023
Received: from localhost ([127.0.0.1]:54074 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qLnVz-00016f-CU
	for submit <at> debbugs.gnu.org; Tue, 18 Jul 2023 12:25:31 -0400
Received: from mout02.posteo.de ([185.67.36.66]:33897)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qLnVw-00016O-Hn
 for 64696 <at> debbugs.gnu.org; Tue, 18 Jul 2023 12:25:29 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 65E9C240105
 for <64696 <at> debbugs.gnu.org>; Tue, 18 Jul 2023 18:25:22 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1689697522; bh=uj4fQunM7pTsevhs3ZfRu62U+nx7rGxNBSB4BnYZqnA=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=mWQ5icAS+hlye1TM/jMSK+LEd63xTj4HhmAsdSmEnTWmrTwa65xtmThJf9dmgAQAr
 KvhcrBm/pZ73NHSaSSVeXrg2yWaGo7ctgXLejNGlvd0dXZs3+T2eTWqokd3dBDZl/o
 lpkYm6wmbearjGau3h9cCVizq1Kqfslcq8ZMXLLBOlIWpTJTF7n0UjBPQGBfkhy7Fr
 yeV/7k8S/NwzPUxB/KGlbEGowUxZAjbRNdlWbKijsHwSKA5tTMfIgM6Gh1un2u8jMH
 RO3htBWCBCjtsS+SzX347c2wNfXe64BC1+sPK9MyN1aIWEfQHPriU0XTw3O/yp4Zi8
 YPEvv5oiWLhow==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R54751GDqz6v0s;
 Tue, 18 Jul 2023 18:25:21 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <831qh56vvz.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
 <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@HIDDEN>
Date: Tue, 18 Jul 2023 16:25:31 +0000
Message-ID: <871qh52nlw.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

> I was actually trying to understand what alternative behavior you'd
> like to see.

I am not sure, because I do not fully understand how the new
implementation of `current-column' works in the wild.

My general understanding of the indentation is that it works "visually",
so that indentation makes things look aligned to graphical column in
the displayed Emacs windows.

However, I do not fully understand what happens if we try to indent
fully hidden text (like inside Org's folds). See my previous bug
reports: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56837 and
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58791

You mentioned in the past that indenting invisible text does not make
sense, although it does in Org, and things did not break spectacularly
after bug#58791 was fixed.

The overall design of `indent-to' is unfortunately elusive for me.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 18 Jul 2023 16:20:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 18 12:20:43 2023
Received: from localhost ([127.0.0.1]:54064 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qLnRJ-0000z0-V9
	for submit <at> debbugs.gnu.org; Tue, 18 Jul 2023 12:20:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:41412)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qLnRB-0000yd-Bn
 for 64696 <at> debbugs.gnu.org; Tue, 18 Jul 2023 12:20:40 -0400
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 1qLnR5-00086B-GA; Tue, 18 Jul 2023 12:20:27 -0400
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=W6q1zw95GGBxisk2mJGJLsJLEDKcu4N3RcIbSYfNHCw=; b=bkTIb7qFATgv
 Oxd0GlJDezgNECN1xQqmRoAzLgJuKxN+KoV5+qyxawdPWfJlJtG1WrF2dWQWJBOp19a+WqM+q77WH
 FCVUVx2HDiOKtifGUuGbsb4cotBoTKPh2IbF1zwCzBROOcr158SFIuuulp2i3RT+zpup5ryFf38o2
 8H2SnTqHv2QmI0/Ly9xkGa5uz6Ko3gGxM/Vxe+77nJHMqXi+hkvgJcHdRJwSP6xsggYNYBBw+TBdy
 IzyUR6V7ysEgDPVrASDhuhSFDdkM5et4sQhcJdO9dGdRMuR98loXRueyunMMSscbi0VXQEgHeoV+H
 O3H3Ow0BD+Wv1LmVQlMfUg==;
Received: from [87.69.77.57] (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 1qLnR4-0007We-Vw; Tue, 18 Jul 2023 12:20:27 -0400
Date: Tue, 18 Jul 2023 19:20:56 +0300
Message-Id: <83y1jd5gyf.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <jwv7cqx5nvm.fsf-monnier+emacs@HIDDEN> (message from Stefan
 Monnier on Tue, 18 Jul 2023 10:15:48 -0400)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <jwv7cqx5nvm.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: yantar92@HIDDEN, 64696 <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 (---)

> From: Stefan Monnier <monnier@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  64696 <at> debbugs.gnu.org
> Date: Tue, 18 Jul 2023 10:15:48 -0400
> 
> FWIW, I can't see any good reason to inherit properties here, other than
> "we've always done that", but I'd be surprised if making this change
> won't affect some other use elsewhere :-(

??? That's a non-starter, from where I stand.  If you really think it
can be useful for the inserted whitespace to lose _all_ of the
properties, I can suggest a new optional argument to do that.  Would
that be good enough?




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

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


Received: (at 64696) by debbugs.gnu.org; 18 Jul 2023 16:12:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 18 12:12:50 2023
Received: from localhost ([127.0.0.1]:54045 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qLnJi-0000lj-8g
	for submit <at> debbugs.gnu.org; Tue, 18 Jul 2023 12:12:50 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:36908)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qLnJc-0000lI-UF
 for 64696 <at> debbugs.gnu.org; Tue, 18 Jul 2023 12:12:48 -0400
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 1qLnJV-0005Z2-6Q; Tue, 18 Jul 2023 12:12:37 -0400
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=M0VnuufqBJZZR1OaEmgU81U1jQC9bECKC12FdvB2Tvc=; b=EITDDnwKRYIW
 YYSfm/50CuKyMm0QCcHJiJmBAc++gzMoCEWWZKkaHdFyOhPXq1XyNnyc86Fxnm7xacmN8vd177N2O
 D2jn1OftdRV9ZlIUmWiEnC2v1S+ZfhmhNVDbmwyYrElmchBnX75mc1dGJ9Ge/bbZAKzC/ffSPJNwL
 f23e+pW2ZUqDnjnuTiwxmGrPzr8ObolTtEbmcIiqQdVnaACXFT+Dqqwl96d9bDRLswZ3B5mR9m7ZL
 jB+3g4mVepHXbOjL6t4wJ5cWws4S7XTaL3HPC7GiIKBF0gVEIQ9IvQRuXrwohP2i77Y10hezLT9ex
 4u0wEDrrOU1cJ7cJ18hAwA==;
Received: from [87.69.77.57] (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 1qLnJU-0006eJ-Me; Tue, 18 Jul 2023 12:12:37 -0400
Date: Tue, 18 Jul 2023 19:13:04 +0300
Message-Id: <831qh56vvz.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87a5vt2vx8.fsf@localhost> (message from Ihor Radchenko on Tue,
 18 Jul 2023 13:25:55 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN> <87a5vt2vx8.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: monnier@HIDDEN, 64696 <at> debbugs.gnu.org
> Date: Tue, 18 Jul 2023 13:25:55 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > "Bug" in what sense?
> 
> In a sense that `indent-to' does not do what it is documented to do.
> So, either documentation should be corrected or the implementation
> should be changed.

I was actually trying to understand what alternative behavior you'd
like to see.




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

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


Received: (at 64696) by debbugs.gnu.org; 18 Jul 2023 14:15:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 18 10:15:58 2023
Received: from localhost ([127.0.0.1]:53690 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qLlUc-0005sq-Af
	for submit <at> debbugs.gnu.org; Tue, 18 Jul 2023 10:15:58 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:30504)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1qLlUZ-0005sd-So
 for 64696 <at> debbugs.gnu.org; Tue, 18 Jul 2023 10:15:57 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 999828060D;
 Tue, 18 Jul 2023 10:15:50 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 73E8E8024B;
 Tue, 18 Jul 2023 10:15:49 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1689689749;
 bh=+hgZx4xgSlhL0jTwsGdqODg9zZk5N3LD5/GMuTSZ/3w=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=HscsKDKJmGHZRRTvj8k2u4LvAe+nqEsYZAeBVWmPTdk+G7s/J9rkxSh/7+2wqQAde
 f7PodXCCvltxaJKmMhYufOq8Ytn2nRC7qYL9CrXzaRhHrnU0oFZAApuoW7ddOEwml4
 G+hjSykBwNqp2LTzsh5UFbB94yrHa345lureVjTZbQDCd7h7GUW3OiOiD+ttpsXMNC
 EWsFc/bkkFaIrvmzj0KEqqw+7bFhzAgoHIJsloSOMqgLTVNDgGNVWzH+WRlIcfolkH
 163N+8maePAq3MRKvPL0DnDFinVL/ANi7+FFu/TqQy+otZ6qxsCmldhfNqHhYv8AOG
 pk7ilYWpFYUFg==
Received: from pastel (unknown [104.247.226.95])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4A00812030C;
 Tue, 18 Jul 2023 10:15:49 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <87jzux2zg8.fsf@localhost> (Ihor Radchenko's message of "Tue, 18
 Jul 2023 12:09:43 +0000")
Message-ID: <jwv7cqx5nvm.fsf-monnier+emacs@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost>
Date: Tue, 18 Jul 2023 10:15:48 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.020 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: Eli Zaretskii <eliz@HIDDEN>, 64696 <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 (---)

>>> However, after un-commenting `put-text-property' line, no indentation is
>>> done "visually" because Finsert_char is called with INHERIT argument Qt.
>> Isn't that in general TRT?  When you indent text, you _want_ to
>> inherit the text properties, right?
>> Whether the inherited properties should also include the invisible
>> property could be subject to discussion, but it isn't 100% clear to me
>> that it should always be excluded.
>
> The problem is that inheriting 'invisible (if its value is actually
> hiding text) yields to cursor not moving to the target column.
> When I read the docstring:
[...]
>     Indent from point with tabs and spaces until COLUMN is reached.

That's a good point.

Could you give a bit of background about why you use set an `invisible`
property that is inherited when inserting chars after it?

I mean I understand it's the default behavior of the `invisible`
property, but when making a piece of text invisible, it's common
that we arrange for that invisible property not to leak to text inserted
after it (either by setting the marker type of the overlay's end
or via the `rear-nonsticky` text-property).
This is useful for when the users goes and types right after the
invisible text, otherwise their text becomes invisible.

Of course, the command loop also tries to move point away from such
positions, so it can be useful not to use `rear-nonsticky`, so as to
"force" point to go before the invisible text rather than after.  But in
that case I'd expect that you'd also want to call `indent-to` with point
before the invisible text rather than after.

>> In any case, I think you can bind text-property-default-nonsticky
>> around the indent-to call to control this, right?  Or use the
>> rear-sticky text property.
> That's what I did to fix things on Org side, but I believe that the
> current behaviour is a genuine bug.

I think the only non-ugly fix would be to make `indent-to` call
`insert-char` without the `inherit` argument.

The history of this code is simple: `indent-to` was changed to pass the
`inherit` arg back in Aug 1994 at the same time `insert-char` got its new
`inherit` argument (see commits 6d1bd1a58117 and e2eeabbbce46),
i.e. quite early on, around the time text-properties were added.

FWIW, I can't see any good reason to inherit properties here, other than
"we've always done that", but I'd be surprised if making this change
won't affect some other use elsewhere :-(


        Stefan





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

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


Received: (at 64696) by debbugs.gnu.org; 18 Jul 2023 13:25:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 18 09:25:56 2023
Received: from localhost ([127.0.0.1]:52177 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qLkiB-0004E0-S3
	for submit <at> debbugs.gnu.org; Tue, 18 Jul 2023 09:25:56 -0400
Received: from mout02.posteo.de ([185.67.36.66]:57795)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qLki8-0004Dj-NJ
 for 64696 <at> debbugs.gnu.org; Tue, 18 Jul 2023 09:25:54 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id A156D240106
 for <64696 <at> debbugs.gnu.org>; Tue, 18 Jul 2023 15:25:46 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1689686746; bh=bI5HEg2PsazR6L2KtxM6iHFQEcMOTW64GrHcyihn2nA=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:
 Content-Transfer-Encoding:From;
 b=HfEYzpn5S+Mo7ilSHYVNewAOg/AwKmfoWmsQcK6PUXh/kiBhu03La/0R0KqbWyIGE
 uouX1lJfiEe+9MpBmb2nmlZ4HLdVO4xpuwm5O7TiPxuF55AN0Hp+aGaF8BAvg/570B
 Bfs3PR0MqmoKtihNiWDKFF1e01gAn9AZTyHRHdchebm4S/a3OAOkPKjbtyR0tXe4Vk
 xizKrmIL2v4eEpiNujSQMrXxnYU6tNjXPZhgan998Z9wMe7jZLzK4Z0RFU/ZMUs09e
 D7TW226ZPQWg0kUPrJkkJpoWiVj3k3fpRgtbGmMgWDCl7ZXcm96a5l1AnZteVmiIt/
 52z443iphwiug==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R507r6kZyz6tx2;
 Tue, 18 Jul 2023 15:25:44 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <83351l74ci.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@HIDDEN>
Date: Tue, 18 Jul 2023 13:25:55 +0000
Message-ID: <87a5vt2vx8.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> More generally, `indent-to' implementation assumes that it is sufficient
>> to insert "COLUMN - (current-column)" spaces in order to reach COLUMN
>> (let me ignore tabs for simplicity).
>
> But ignoring the tabs is not a valid "trick" here, because it exactly
> means that your interpretation is too na=C3=AFve: there's more in
> indentation to a certain column than meets the eye, precisely because
> of stuff like tabs, display properties, composed characters, and other
> calamities.

Ok. More precisely, `indent-to' implementation assumes that it is
sufficient to insert COLUMN/tab_width - (current-column))/tab_width tabs
and then add (COLUMN - (current-column) - N_tabs * tab_width) spaces.
(when indent-tabs-mode is active)

Still not taking into account display and invisible properties. Just
assuming that width of the inserted tabs and spaces is fixed.

At the same time, `current_column' does take into account display
properties. And thus we have one part of `indent-to' considering
invisible and display properties, while other part ignoring them.

>> And the actual scenario for Org is even more complex because
>> Org fontification is what is adding that problematic invisible text
>> property, leading to race condition between redisplay and indentation.
>> When I sprinkled (redisplay) calls to different places in Org's
>> tag alignment code, the results varied depending on where the
>> (redisplay) call was inserted.
>
> there couldn't be any race condition here, because indent-to is not
> run when redisplay runs.  I guess you mean that one could see the
> indentation appear, then disappear as result of JIT fontifications, or
> not appear at all, depending on the details?

No. I mean that (current-column) may change after fontification is
applied. We had a similar issue recently in
https://list.orgmode.org/als4q47p4dt4iva4s73sihe75qjdz4ni554h55e63o6izogzst=
@vs3olesw6da3/T/#m8d85b510def4163f8401988aaa44bf935027745f

Though this part may or may not be considered a bug. I am more concerned
about 'invisible property.

>> That's what I did to fix things on Org side, but I believe that the
>> current behaviour is a genuine bug.
>
> "Bug" in what sense?

In a sense that `indent-to' does not do what it is documented to do.
So, either documentation should be corrected or the implementation
should be changed.

--=20
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 18 Jul 2023 13:10:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 18 09:10:11 2023
Received: from localhost ([127.0.0.1]:52098 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qLkSr-0003km-Cu
	for submit <at> debbugs.gnu.org; Tue, 18 Jul 2023 09:10:11 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:34558)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qLkSp-0003k8-6E
 for 64696 <at> debbugs.gnu.org; Tue, 18 Jul 2023 09:10:03 -0400
Received: from fencepost.gnu.org ([209.51.188.10])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1qLkSh-0005DC-St; Tue, 18 Jul 2023 09:09:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=PBy881hPgyViIZMmoS1gDh0Tzmnh4nag5nRdJuOc9JU=; b=m2Tnt1zZ3ix2Rp6SuHmJ
 tlqW3QGBivdQSpFo6ZpGdLe471YTT355Bxwm7V2lOYqgBk3SjejN+LSVl90RS2vh5VT+dGRF2dWNM
 UcTfRhL1NGtbGVNXfKbFhPM4qR5YFw3mePgnQjAxNAqVfdPqxo+meP8teV1nf3V5Rmv96Z+yNkFak
 0twav6Idchxylr6Kznzk/wnRN5cKnCnnDKTu/Z/enRUIITzfaaCvTu6TI0HBAa721A2dNYWiBmARq
 w+1tyAIHQJ874dM2tP93/tFfCiI1BD7gpsnlOxgrTLyUL04cTcP8zIBjI6R2WudcS9xaJZaKrE3QG
 AEVDqePh8neesw==;
Received: from [87.69.77.57] (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 1qLkSf-0004CI-7z; Tue, 18 Jul 2023 09:09:55 -0400
Date: Tue, 18 Jul 2023 16:10:21 +0300
Message-Id: <83351l74ci.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87jzux2zg8.fsf@localhost> (message from Ihor Radchenko on Tue,
 18 Jul 2023 12:09:43 +0000)
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
 <87jzux2zg8.fsf@localhost>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: monnier@HIDDEN, 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Cc: Stefan Monnier <monnier@HIDDEN>, 64696 <at> debbugs.gnu.org
> Date: Tue, 18 Jul 2023 12:09:43 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > Whether the inherited properties should also include the invisible
> > property could be subject to discussion, but it isn't 100% clear to me
> > that it should always be excluded.
> 
> The problem is that inheriting 'invisible (if its value is actually
> hiding text) yields to cursor not moving to the target column.
> 
> When I read the docstring:
> 
>     (indent-to COLUMN &optional MINIMUM)
>     
>     Documentation
>     Indent from point with tabs and spaces until COLUMN is reached.
> 
> I expect that (current-column) will become COLUMN after calling
> `indent-to'. It is not the case in the described scenario.

If the problem is documentation, we can easily augment the
documentation to match the actual behavior.

So let's first discuss the behavior, not what the documentation says.

> More generally, `indent-to' implementation assumes that it is sufficient
> to insert "COLUMN - (current-column)" spaces in order to reach COLUMN
> (let me ignore tabs for simplicity).

But ignoring the tabs is not a valid "trick" here, because it exactly
means that your interpretation is too nave: there's more in
indentation to a certain column than meets the eye, precisely because
of stuff like tabs, display properties, composed characters, and other
calamities.

> And the actual scenario for Org is even more complex because
> Org fontification is what is adding that problematic invisible text
> property, leading to race condition between redisplay and indentation.
> When I sprinkled (redisplay) calls to different places in Org's
> tag alignment code, the results varied depending on where the
> (redisplay) call was inserted.

there couldn't be any race condition here, because indent-to is not
run when redisplay runs.  I guess you mean that one could see the
indentation appear, then disappear as result of JIT fontifications, or
not appear at all, depending on the details?

> > In any case, I think you can bind text-property-default-nonsticky
> > around the indent-to call to control this, right?  Or use the
> > rear-sticky text property.
> 
> That's what I did to fix things on Org side, but I believe that the
> current behaviour is a genuine bug.

"Bug" in what sense?  Do you mean that indenting should disregard
properties completely? or just the invisible property? or something
else?  indent-to is a general-purpose primitive, so any change there
will affect gobs of Emacs Lisp programs, and we must specify the
desired behavior in a lot of detail in order to be able to discuss
such changes.




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

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


Received: (at 64696) by debbugs.gnu.org; 18 Jul 2023 12:09:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 18 08:09:47 2023
Received: from localhost ([127.0.0.1]:51845 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qLjWV-0001uZ-ES
	for submit <at> debbugs.gnu.org; Tue, 18 Jul 2023 08:09:47 -0400
Received: from mout02.posteo.de ([185.67.36.66]:35115)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qLjWS-0001uN-Qi
 for 64696 <at> debbugs.gnu.org; Tue, 18 Jul 2023 08:09:46 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id CF9FD240103
 for <64696 <at> debbugs.gnu.org>; Tue, 18 Jul 2023 14:09:38 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1689682178; bh=Oozs17zjhJ3DWTYafRDXutrqU++mJBoXwDDn+SvPF14=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=fEb1zqbyV9lGO0rlWp19laYdZoDox+KpQw46xFt7FURjJKZkZZMpVdW0rdIab4khu
 Uy7iMlCXfhTPT7wCyQ13Q0EpHgQpZ6UAFi2+Tn2BNMY6PQwv+ECJlqWb8EiG5hM1m1
 6pTrfZUKpSXW5a7ZhR0YVD5nAzsMJS3wNz8ze2FzvO8LIMnTB47dToFWr8Pdsf71hj
 5sXBu0AkZuAilhJRQ3hyM5XuoCb+MA/2RnmSqvd0uXRYKeZoOEwQdGmyQv7BtMtqVx
 m2scCwKCtO2ojPkcMIz2XR7GVa8x4oYcJhjPw+lOQriW1EQggUlEl0l0QxZD+CVEbx
 I39mVxGMkFjuw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R4yRw3w5sz6tsb;
 Tue, 18 Jul 2023 14:09:32 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64696: 30.0.50; indent-to inherits preceding text
 properties, including 'invisible
In-Reply-To: <83ilah79aq.fsf@HIDDEN>
References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@HIDDEN>
Date: Tue, 18 Jul 2023 12:09:43 +0000
Message-ID: <87jzux2zg8.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: Stefan Monnier <monnier@HIDDEN>, 64696 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> However, after un-commenting `put-text-property' line, no indentation is
>> done "visually" because Finsert_char is called with INHERIT argument Qt.
>
> Isn't that in general TRT?  When you indent text, you _want_ to
> inherit the text properties, right?
>
> Whether the inherited properties should also include the invisible
> property could be subject to discussion, but it isn't 100% clear to me
> that it should always be excluded.

The problem is that inheriting 'invisible (if its value is actually
hiding text) yields to cursor not moving to the target column.

When I read the docstring:

    (indent-to COLUMN &optional MINIMUM)
    
    Documentation
    Indent from point with tabs and spaces until COLUMN is reached.

I expect that (current-column) will become COLUMN after calling
`indent-to'. It is not the case in the described scenario.

More generally, `indent-to' implementation assumes that it is sufficient
to insert "COLUMN - (current-column)" spaces in order to reach COLUMN
(let me ignore tabs for simplicity).

However, it is not true for invisible text and when 'display is
specifying custom space width (and what about :align-to?).

And the actual scenario for Org is even more complex because
Org fontification is what is adding that problematic invisible text
property, leading to race condition between redisplay and indentation.
When I sprinkled (redisplay) calls to different places in Org's
tag alignment code, the results varied depending on where the
(redisplay) call was inserted.

> In any case, I think you can bind text-property-default-nonsticky
> around the indent-to call to control this, right?  Or use the
> rear-sticky text property.

That's what I did to fix things on Org side, but I believe that the
current behaviour is a genuine bug.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




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

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


Received: (at 64696) by debbugs.gnu.org; 18 Jul 2023 11:23:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 18 07:23:25 2023
Received: from localhost ([127.0.0.1]:51720 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qLind-0006TT-IF
	for submit <at> debbugs.gnu.org; Tue, 18 Jul 2023 07:23:25 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:46264)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qLinb-0006TF-Ij
 for 64696 <at> debbugs.gnu.org; Tue, 18 Jul 2023 07:23:24 -0400
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 1qLinV-0007aG-Of; Tue, 18 Jul 2023 07:23:17 -0400
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=TI5P816IJuNTznykq1kTkN3j0cN4vvvW++uKwCaMcWA=; b=cRLokW9fIVnr
 AY018mRFfstxG/2L2/vXZN0hWkxmqc+E1mv0bW0V3wjrvTLVh9c8By4T2un8hAecL8ZdqDa74jVJJ
 L+I/D/1z2yAx4ruXMIp2Dovw/ZNa9ls7LX6ZZhR8cIgzzTiDBOeUa/xQ2nSAZjVA2y4pvhcS00A6E
 ADEHS3h/Z70q7uX8J52AebsN9C+qXpzWbtwtGnzoQKyK5B3JaofAQNubBNJDfbI8zbi3fNh7rA1pU
 By10cE9oytgVuqN/SggvgR5LjK2p4L5HjozCs9xn11HxTokIEIL639hAIjD1mtAEVpF23jatvaeS9
 6+oZl3A7aODtt+2YbOaQtA==;
Received: from [87.69.77.57] (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 1qLinC-0007np-DY; Tue, 18 Jul 2023 07:23:17 -0400
Date: Tue, 18 Jul 2023 14:23:25 +0300
Message-Id: <83ilah79aq.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <87fs5l3b3g.fsf@localhost> (message from Ihor Radchenko on Tue,
 18 Jul 2023 07:58:11 +0000)
Subject: Re: bug#64696: 30.0.50;
 indent-to inherits preceding text properties, including 'invisible
References: <87fs5l3b3g.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64696
Cc: 64696 <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 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Date: Tue, 18 Jul 2023 07:58:11 +0000
> 
> (progn
>   (switch-to-buffer (get-buffer-create "*Test*"))
>   (erase-buffer)
>   (insert "Test case with char before point hidden<point>     :more text:")
>   (search-backward ">")
>   (forward-char)
>   (with-silent-modifications (put-text-property (1- (point)) (point) 'invisible t))
>   (let ((indent-tabs-mode nil)) (indent-to 100)))
> 
> The text is inserted and then indented as expected when 'invisible
> property is not applied:
> 
> -------------
> Test case with char before point hidden<point>                                                      <point>     :more text:
> -------------
> 
> However, after un-commenting `put-text-property' line, no indentation is
> done "visually" because Finsert_char is called with INHERIT argument Qt.

Isn't that in general TRT?  When you indent text, you _want_ to
inherit the text properties, right?

Whether the inherited properties should also include the invisible
property could be subject to discussion, but it isn't 100% clear to me
that it should always be excluded.

In any case, I think you can bind text-property-default-nonsticky
around the indent-to call to control this, right?  Or use the
rear-sticky text property.

Adding Stefan, in case he has some comments.




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

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


Received: (at submit) by debbugs.gnu.org; 18 Jul 2023 07:58:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 18 03:58:22 2023
Received: from localhost ([127.0.0.1]:51448 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qLfbB-0000uf-OX
	for submit <at> debbugs.gnu.org; Tue, 18 Jul 2023 03:58:22 -0400
Received: from lists.gnu.org ([2001:470:142::17]:34272)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1qLfb7-0000uR-JI
 for submit <at> debbugs.gnu.org; Tue, 18 Jul 2023 03:58:20 -0400
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 1qLfb2-0007Ww-35
 for bug-gnu-emacs@HIDDEN; Tue, 18 Jul 2023 03:58:12 -0400
Received: from mout01.posteo.de ([185.67.36.65])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>)
 id 1qLfay-0004He-TH
 for bug-gnu-emacs@HIDDEN; Tue, 18 Jul 2023 03:58:11 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 0E93E24002A
 for <bug-gnu-emacs@HIDDEN>; Tue, 18 Jul 2023 09:58:05 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1689667086; bh=4bSCv7HIPnYt42HfgRjvaNrRRxgD/ZJtbYCvkmdSinU=;
 h=From:To:Subject:Date:Message-ID:MIME-Version:From;
 b=fZuasQ9Hl/7sSiQ+bEJoiXon5xccZAanE0eRCdFAfxpe2sooGd4FxyciU7n0lh4sC
 79zElbiUNJPthm9x6DCrEWQBsjYJ98qbJhrVJnvvKmAz+4oiSkTPJMQdoUVXZailxu
 wNOtlYuY1u1AZU1zBPj7D3IMrzWFdnMrLlb7FF0ecrcB9rfN6/zAW+R+IYgkddgnd9
 C9J6dpjfJNBleGHoPr1U+vumLNaFvGZinZA1yHo1/3tbBQ6Uy8oBclZ8sk9AyFeOxz
 L1L7XyYp6m2v1SxAM0nv0xshLarAGtx1yzXq2pQr9e07EB7sakY2EwXyTVV08uThva
 f8Nk4miaxX8Tg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4R4rsn1Wp4z9rxB
 for <bug-gnu-emacs@HIDDEN>; Tue, 18 Jul 2023 09:58:04 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.0.50; indent-to inherits preceding text properties, including
 'invisible
Date: Tue, 18 Jul 2023 07:58:11 +0000
Message-ID: <87fs5l3b3g.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@HIDDEN;
 helo=mout01.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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 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 (/)

Hi,

This is a follow-up of Org mode bug report
https://orgmode.org/list/8b691a7f-6b62-d573-e5a8-80fac3dc9bc6@HIDDEN

Consider the following MWE:

(progn
  (switch-to-buffer (get-buffer-create "*Test*"))
  (erase-buffer)
  (insert "Test case with char before point hidden<point>     :more text:")
  (search-backward ">")
  (forward-char)
  (with-silent-modifications (put-text-property (1- (point)) (point) 'invisible t))
  (let ((indent-tabs-mode nil)) (indent-to 100)))

The text is inserted and then indented as expected when 'invisible
property is not applied:

-------------
Test case with char before point hidden<point>                                                      <point>     :more text:
-------------

However, after un-commenting `put-text-property' line, no indentation is
done "visually" because Finsert_char is called with INHERIT argument Qt.

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.17.8) of 2023-07-17 built on localhost
Repository revision: 603ac9505d5d0eebf27798620d1826788739fad8
Repository branch: feature/named-lambdas
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: Gentoo Linux

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>




Acknowledgement sent to Ihor Radchenko <yantar92@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#64696; 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: Fri, 28 Jul 2023 14:30:02 UTC

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