From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64696: 30.0.50; indent-to inherits preceding text properties, including 'invisible Date: Tue, 18 Jul 2023 10:15:48 -0400 Message-ID: References: <87fs5l3b3g.fsf@localhost> <83ilah79aq.fsf@gnu.org> <87jzux2zg8.fsf@localhost> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34110"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 64696@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 18 16:18:00 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 1qLlWZ-0008Uk-0m for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Jul 2023 16:17:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLlVG-000769-F3; Tue, 18 Jul 2023 10:16:38 -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 1qLlUk-0006pP-JT for bug-gnu-emacs@gnu.org; Tue, 18 Jul 2023 10:16:10 -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 1qLlUg-0001H6-LQ for bug-gnu-emacs@gnu.org; Tue, 18 Jul 2023 10:16:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qLlUg-0005tG-GK for bug-gnu-emacs@gnu.org; Tue, 18 Jul 2023 10:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Jul 2023 14:16: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.168968975822625 (code B ref 64696); Tue, 18 Jul 2023 14:16:02 +0000 Original-Received: (at 64696) by debbugs.gnu.org; 18 Jul 2023 14:15:58 +0000 Original-Received: from localhost ([127.0.0.1]:53690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLlUc-0005sq-Af for submit@debbugs.gnu.org; Tue, 18 Jul 2023 10:15:58 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:30504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLlUZ-0005sd-So for 64696@debbugs.gnu.org; Tue, 18 Jul 2023 10:15:57 -0400 Original-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) Original-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== Original-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) In-Reply-To: <87jzux2zg8.fsf@localhost> (Ihor Radchenko's message of "Tue, 18 Jul 2023 12:09:43 +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:265466 Archived-At: >>> 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