bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60692: 29.0.60; current-indentation wrong without outline ellipsis


From: Eli Zaretskii
Subject: bug#60692: 29.0.60; current-indentation wrong without outline ellipsis
Date: Mon, 09 Jan 2023 21:10:28 +0200

> Cc: 60692@debbugs.gnu.org
> Date: Mon, 09 Jan 2023 20:34:50 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > From: Juri Linkov <juri@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'.

Sorry, I was confused.  I thought we were talking about
current-column.

About current-indentation: it skips invisible text, so it's unclear to
me why you expected to see 2.  The doc string says:

  Text that has an invisible property is considered as having width 0, unless
  `buffer-invisibility-spec' specifies that it is replaced by an ellipsis.

The "current indentation" on the line of buffer position 8 is entirely
in invisible text, and current-indentation only accounts for _visible_
whitespace, per the above documentation.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]