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


Message #16 received at 56837 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ihor Radchenko <yantar92 <at> gmail.com>
Cc: 56837 <at> debbugs.gnu.org
Subject: Re: bug#56837: 28.1.90; `current-indentation' sometimes returns
 zero inside invisible text
Date: Sat, 30 Jul 2022 13:08:18 +0300
> From: Ihor Radchenko <yantar92 <at> gmail.com>
> Cc: 56837 <at> debbugs.gnu.org
> Date: Sat, 30 Jul 2022 17:08:12 +0800
> 
> > Bottom line: I think you are hitting undefined behavior here.
> 
> Maybe. But then I'd like to be able to get the "hard" indentation
> information for the underlying text in buffer, accounting for tab-width,
> and disregarding overlays and other font-lock staff.

I guess you should temporarily remove the invisible property?  Like
this:

  (let ((invis-spec buffer-invisibility-spec)
        indent)
     (remove-from-invisibility-spec '(outline . t))
     (setq indent
           (save-excursion (search-forward " a") (current-indentation)))
     (setq buffer-invisibility-spec invis-spec) indent)




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.