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

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

bug#51016: 28.0.50; 'diff-font-lock-prettify' breaks display of outline


From: Lars Ingebrigtsen
Subject: bug#51016: 28.0.50; 'diff-font-lock-prettify' breaks display of outline headers
Date: Sun, 21 Nov 2021 18:02:32 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Juri Linkov <juri@linkov.net> writes:

> Actually, ‘outline-font-lock-keywords’ extends the outline regexp
> to (concat "^\\(?:" outline-regexp "\\).+").  And indeed,
>
>   (re-search-forward (concat "^\\(?:" diff-hunk-header-re "\\).+"))
>
> fails in diff buffers.  Don't ask me why outline.el adds ".+"
> at the end, I don't know 🤐

That is quite odd, but it's been that way since 2003?  The doc string
says

---
Regular expression to match the beginning of a heading.
Any line whose beginning matches this regexp is considered to start a heading.
---

So it's specifying "the beginning", which could imply that there's
always supposed to be something after it, but it's an odd limitation.

> To circumvent this idiosyncrasy for headings in ‘describe-bindings’, I
> had to use a different regexp in ‘outline-minor-mode-highlight-buffer’
> (not based on font-lock):
>
>   (concat "^\\(?:" outline-regexp "\\).*$")))
>
> where ".+" is replaced with less-strict ".*".

And diff-hunk-header-re definitely specifies an entire line.

Perhaps we could just change the .+ thing to .* and see whether it
breaks anything?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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