]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix the outline level in the Emacs NEWS modes
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 20 Apr 2022 10:48:55 +0000 (12:48 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 20 Apr 2022 10:48:55 +0000 (12:48 +0200)
* lisp/textmodes/emacs-news-mode.el (emacs-news--mode-common): Fix
the outline level (bug#54993).

lisp/textmodes/emacs-news-mode.el

index d9c5b15bf42363bc485c498f311be5a2b30e3948..2ebd4aa82964652c58cabcf71bddf3de1f0e1ae7 100644 (file)
 
 (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))