[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#56837: 28.1.90; `current-indentation' sometimes returns zero inside
From: |
Eli Zaretskii |
Subject: |
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@gmail.com>
> Cc: 56837@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)