From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#64696: 30.0.50; indent-to inherits preceding text properties, including 'invisible Date: Tue, 18 Jul 2023 13:25:55 +0000 Message-ID: <87a5vt2vx8.fsf@localhost> References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@gnu.org> <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32047"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, 64696@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 18 15:26:39 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qLkin-0007wf-Tb for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Jul 2023 15:26:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLkiM-0005qa-ER; Tue, 18 Jul 2023 09:26:06 -0400 Original-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 ) id 1qLkiI-0005qD-K0 for bug-gnu-emacs@gnu.org; Tue, 18 Jul 2023 09:26:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qLkiI-0000aY-1x for bug-gnu-emacs@gnu.org; Tue, 18 Jul 2023 09:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qLkiH-0004EP-Tw for bug-gnu-emacs@gnu.org; Tue, 18 Jul 2023 09:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Jul 2023 13:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64696 X-GNU-PR-Package: emacs Original-Received: via spool by 64696-submit@debbugs.gnu.org id=B64696.168968675616248 (code B ref 64696); Tue, 18 Jul 2023 13:26:01 +0000 Original-Received: (at 64696) by debbugs.gnu.org; 18 Jul 2023 13:25:56 +0000 Original-Received: from localhost ([127.0.0.1]:52177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLkiB-0004E0-S3 for submit@debbugs.gnu.org; Tue, 18 Jul 2023 09:25:56 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:57795) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLki8-0004Dj-NJ for 64696@debbugs.gnu.org; Tue, 18 Jul 2023 09:25:54 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id A156D240106 for <64696@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== Original-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) In-Reply-To: <83351l74ci.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:265462 Archived-At: Eli Zaretskii 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 . Support Org development at , or support my work at