GNU bug report logs - #66166
30.0.50; [PATCH] Consider outline-heading-end-regexp in outline-font-lock-keywords

Previous Next

Package: emacs;

Reported by: Gabriel <gabriel376 <at> hotmail.com>

Date: Sat, 23 Sep 2023 07:57:01 UTC

Severity: normal

Tags: patch

Fixed in version 30.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


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

From: Gabriel <gabriel376 <at> hotmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; [PATCH] Consider outline-heading-end-regexp in
 outline-font-lock-keywords
Date: Sat, 23 Sep 2023 04:50:38 -0300
[Message part 1 (text/plain, inline)]
Consider outline-heading-end-regexp in outline-font-lock-keywords.

Example of use case:
1) emacs -Q
2) in *scratch* buffer, type ";;; Hello" in a new line, plus some line breaks
3) eval:
   (setq-local outline-regexp ";;;*")
   (setq-local outline-heading-end-regexp "\n")
   (setq-local outline-minor-mode-highlight 'override)
   (custom-set-faces '(outline-1 ((t :background "red" :extend t))))
   (outline-minor-mode 1)
4) expected: since the outline-1 face has the extend attribute and the
heading regexp ends in a line break, the outline-1 face on ";;; Hello"
should be applied until the line break (extended)

Patch:
[0001-Consider-outline-heading-end-regexp-in-outline-font-.patch (text/x-diff, inline)]
From 5d56f04e4f59e8fef9f4521901f527db09004534 Mon Sep 17 00:00:00 2001
From: Gabriel <gabriel376 <at> hotmail.com>
Date: Sat, 23 Sep 2023 04:32:02 -0300
Subject: [PATCH 1/1] Consider outline-heading-end-regexp in
 outline-font-lock-keywords

* lisp/outline.el (outline-font-lock-keywords): Add
outline-heading-end-regexp to regexp.
---
 lisp/outline.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/outline.el b/lisp/outline.el
index d8dd491212e..7f826a4ece2 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -260,7 +260,7 @@ outline-font-lock-keywords
   '(
     ;; Highlight headings according to the level.
     (eval . (list (or outline-search-function
-                      (concat "^\\(?:" outline-regexp "\\).*"))
+                      (concat "^\\(?:" outline-regexp "\\).*" outline-heading-end-regexp))
                   0 '(if outline-minor-mode
                          (if outline-minor-mode-highlight
                              (list 'face (outline-font-lock-face)))
-- 
2.34.1

[Message part 3 (text/plain, inline)]
---
Gabriel

This bug report was last modified 1 year and 129 days ago.

Previous Next


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