From c2dc6db2fdd743befa5d6634967b5a1a994a9c6e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 20 Apr 2022 12:48:55 +0200 Subject: [PATCH] Fix the outline level in the Emacs NEWS modes * lisp/textmodes/emacs-news-mode.el (emacs-news--mode-common): Fix the outline level (bug#54993). --- lisp/textmodes/emacs-news-mode.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el index d9c5b15bf42..2ebd4aa8296 100644 --- a/lisp/textmodes/emacs-news-mode.el +++ b/lisp/textmodes/emacs-news-mode.el @@ -52,8 +52,11 @@ (defun emacs-news--mode-common () (setq-local font-lock-defaults '(emacs-news-mode-font-lock-keywords t)) - (setq-local outline-regexp "^\\*+ " + (setq-local outline-regexp "\\*+ " outline-minor-mode-cycle t + ;; We subtract one from the level, because we have a + ;; space after the asterisks. + outline-level (lambda () (1- (length (match-string 0)))) outline-minor-mode-highlight 'append) (outline-minor-mode)) -- 2.39.2