GNU bug report logs - #60692
29.0.60; current-indentation wrong without outline ellipsis

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Mon, 9 Jan 2023 17:36:02 UTC

Severity: normal

Merged with 56837, 56838

Found in versions 28.1.90, 29.0.60

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 60692 <at> debbugs.gnu.org
Subject: Re: bug#60692: 29.0.60;
 current-indentation wrong without outline ellipsis
Date: Mon, 09 Jan 2023 20:34:50 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Date: Mon, 09 Jan 2023 19:34:07 +0200
> 
> When there is an outline ellipsis displayed at the end of outline headings,
> then the correct indentation 2 is returned in this test case:
> 
> (progn
>   (switch-to-buffer (get-buffer-create "test1"))
>   (insert "* h\n  .\n")
>   (outline-mode)
>   (outline-hide-sublevels 1)
>   (goto-char 8)
>   (current-indentation))

How is 2 correct in this case?  I'd expect 6.  2 is correct when point
is on 'h'.

> But when the ellipsis is disabled with invisibility-spec:
> 
> (progn
>   (switch-to-buffer (get-buffer-create "test2"))
>   (insert "* h\n  .\n")
>   (outline-mode)
>   (remove-from-invisibility-spec '(outline . t))
>   (add-to-invisibility-spec 'outline)
>   (outline-hide-sublevels 1)
>   (goto-char 8)
>   (current-indentation))
> 
> then the returned indentation is 0 that is incorrect.

I think they are both incorrect, because the algorithm in
current-indentation doesn't expect that the current line is entirely
made of invisible text.




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

Previous Next


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