GNU bug report logs - #56837
28.1.90; `current-indentation' sometimes returns zero inside invisible text

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> gmail.com>

Date: Sat, 30 Jul 2022 07:57:01 UTC

Severity: normal

Merged with 56838, 60692

Found in versions 28.1.90, 29.0.60

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ihor Radchenko <yantar92 <at> gmail.com>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 56837 <at> debbugs.gnu.org
Subject: bug#56837: 28.1.90; `current-indentation' sometimes returns zero inside invisible text
Date: Sat, 30 Jul 2022 14:38:47 +0300
> From: Ihor Radchenko <yantar92 <at> gmail.com>
> Cc: 56837 <at> debbugs.gnu.org
> Date: Sat, 30 Jul 2022 19:27:09 +0800
> 
> A simpler version would be let-binding buffer-invisibility-spec.

Really?

> Note that there is similar issue with current-column, though
> current-column is much less likely to be used without considering
> display properties.

These are all display-related, in that their results are supposed to
closely reflect what will be shown on display.

> Would it be possible to include the "text" versions of
> current-indentation and current-column into Emacs?
> 
> Something like
> 
> (defmacro org-current-text-indentation ()
>   "Like `current-indentation', but ignore display/invisible properties."
>   `(let ((buffer-invisibility-spec nil))
>      (current-indentation)))
> 
> (defmacro org-current-text-column ()
>   "Like `current-column', but ignore display/invisible properties."
>   `(string-width (buffer-substring-no-properties
> 		  (line-beginning-position) (point))))

Sounds strange to have this, but if Lars thinks it's useful, I won't
object.

> If not, could you at least mention the invisible text issues in
> `current-indentation' docstring?

OK.




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

Previous Next


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