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

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

bug#66166: 30.0.50; [PATCH] Consider outline-heading-end-regexp in outli


From: Gabriel
Subject: bug#66166: 30.0.50; [PATCH] Consider outline-heading-end-regexp in outline-font-lock-keywords
Date: Sat, 23 Sep 2023 04:50:38 -0300

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:
>From 5d56f04e4f59e8fef9f4521901f527db09004534 Mon Sep 17 00:00:00 2001
From: Gabriel <gabriel376@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

---
Gabriel

reply via email to

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