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

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Tue, 18 Jul 2023 07:59:01 UTC

Severity: normal

Found in version 30.0.50

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ihor Radchenko <yantar92 <at> posteo.net>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 64696 <at> debbugs.gnu.org
Subject: bug#64696: 30.0.50; indent-to inherits preceding text properties, including 'invisible
Date: Tue, 18 Jul 2023 14:23:25 +0300
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> 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.




This bug report was last modified 2 years and 50 days ago.

Previous Next


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