From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#51016: 28.0.50; 'diff-font-lock-prettify' breaks display of outline headers Date: Sat, 20 Nov 2021 21:17:10 +0200 Organization: LINKOV.NET Message-ID: <86y25imyna.fsf@mail.linkov.net> References: <87bl44qz5o.fsf@gmail.com> <87wnmgk6r7.fsf@gmail.com> <87tugrmi1j.fsf@gnus.org> <86pmqxuymw.fsf@mail.linkov.net> <87ee7cwqwj.fsf@gnus.org> <86r1bcpo5i.fsf@mail.linkov.net> <87zgpzrznf.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8604"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Matthias Meulien , 51016@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 20 20:20:27 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1moVuU-00020e-MK for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Nov 2021 20:20:26 +0100 Original-Received: from localhost ([::1]:45646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1moVuT-0007Gv-MC for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Nov 2021 14:20:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moVu6-0007Gj-R5 for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 14:20:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60380) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moVu6-0005Xq-Ip for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 14:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1moVu6-0003pr-EK for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 14:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Nov 2021 19:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51016 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51016-submit@debbugs.gnu.org id=B51016.163743598414708 (code B ref 51016); Sat, 20 Nov 2021 19:20:02 +0000 Original-Received: (at 51016) by debbugs.gnu.org; 20 Nov 2021 19:19:44 +0000 Original-Received: from localhost ([127.0.0.1]:43693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moVto-0003pA-9U for submit@debbugs.gnu.org; Sat, 20 Nov 2021 14:19:44 -0500 Original-Received: from relay10.mail.gandi.net ([217.70.178.230]:59551) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moVtl-0003oh-6A for 51016@debbugs.gnu.org; Sat, 20 Nov 2021 14:19:41 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 82E8A240006; Sat, 20 Nov 2021 19:19:34 +0000 (UTC) In-Reply-To: <87zgpzrznf.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 20 Nov 2021 09:37:24 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:220518 Archived-At: >> 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 ".*".