From: Lars Ingebrigtsen Date: Wed, 20 Apr 2022 10:48:55 +0000 (+0200) Subject: Fix the outline level in the Emacs NEWS modes X-Git-Tag: emacs-29.0.90~1931^2~389 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c2dc6db2fdd743befa5d6634967b5a1a994a9c6e;p=emacs.git 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). --- 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))