From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#64696: 30.0.50; indent-to inherits preceding text properties, including 'invisible Date: Sat, 22 Jul 2023 14:35:26 +0300 Message-ID: <83v8ec89hd.fsf@gnu.org> References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@gnu.org> <87jzux2zg8.fsf@localhost> <83351l74ci.fsf@gnu.org> <87a5vt2vx8.fsf@localhost> <831qh56vvz.fsf@gnu.org> <871qh52nlw.fsf@localhost> <83pm4p5er8.fsf@gnu.org> <874jm0mhgb.fsf@localhost> <831qh459sy.fsf@gnu.org> <87jzuvq785.fsf@localhost> <877cqt7jhp.fsf@localhost> <834jlwa17v.fsf@gnu.org> <87v8ec8lsq.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21135"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, 64696@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 22 13:35:16 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 1qNAtI-0005G5-CI for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Jul 2023 13:35:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNAt7-0005yU-V4; Sat, 22 Jul 2023 07:35:05 -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 1qNAt5-0005yG-47 for bug-gnu-emacs@gnu.org; Sat, 22 Jul 2023 07:35:03 -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 1qNAt4-0000af-Ri for bug-gnu-emacs@gnu.org; Sat, 22 Jul 2023 07:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qNAt4-0003XR-8p for bug-gnu-emacs@gnu.org; Sat, 22 Jul 2023 07:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Jul 2023 11:35:02 +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.169002569913587 (code B ref 64696); Sat, 22 Jul 2023 11:35:02 +0000 Original-Received: (at 64696) by debbugs.gnu.org; 22 Jul 2023 11:34:59 +0000 Original-Received: from localhost ([127.0.0.1]:35573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNAt1-0003X5-0v for submit@debbugs.gnu.org; Sat, 22 Jul 2023 07:34:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNAsx-0003Wp-T6 for 64696@debbugs.gnu.org; Sat, 22 Jul 2023 07:34:57 -0400 Original-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 ) 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==; Original-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 ) id 1qNAsr-00012z-Q8; Sat, 22 Jul 2023 07:34:50 -0400 In-Reply-To: <87v8ec8lsq.fsf@localhost> (message from Ihor Radchenko on Sat, 22 Jul 2023 07:09:25 +0000) 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:265800 Archived-At: > From: Ihor Radchenko > Cc: monnier@iro.umontreal.ca, 64696@debbugs.gnu.org > Date: Sat, 22 Jul 2023 07:09:25 +0000 > > Eli Zaretskii 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??)