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: Juri Linkov
Subject: bug#51016: 28.0.50; 'diff-font-lock-prettify' breaks display of outline headers
Date: Sat, 20 Nov 2021 21:17:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>> Yep, I already tried `(re-search-forward diff-hunk-header-re)' too,
>> and it works.  But still typing TAB on the hunk heading
>> with outline-minor-mode-cycle=t does nothing, whereas typing TAB
>> on the file heading correctly cycles the file diff.
>
> Oh yeah, now I'm seeing the problem.  I don't really use outline mode
> daily, so I'm not sure how it's supposed to work, but -- TAB in these
> buffers are bound to diff-hunk-next, and as far as I can tell, outline
> mode has just placed a keymap property on the file headings, not the
> hunk headings.
>
> Or is that the actual bug here?  😀  I should probably have read the
> entire thread before getting involved.

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 🤐  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 ".*".





reply via email to

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