From 1e021ac45b352bb99e14cc9b30fa1e73ad2c267f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 10 Sep 2022 05:03:58 +0200 Subject: [PATCH] Support outline-minor-mode in emacs-authors-mode * lisp/textmodes/emacs-authors-mode.el (emacs-authors-mode): Support and enable outline-minor-mode. --- lisp/textmodes/emacs-authors-mode.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/emacs-authors-mode.el b/lisp/textmodes/emacs-authors-mode.el index 866822c103d..3eba8e0e456 100644 --- a/lisp/textmodes/emacs-authors-mode.el +++ b/lisp/textmodes/emacs-authors-mode.el @@ -130,7 +130,20 @@ Provides some basic font locking and not much else." '(emacs-authors-mode-font-lock-keywords nil nil ((?_ . "w")))) (setq font-lock-multiline nil) (setq imenu-generic-expression emacs-authors-imenu-generic-expression) - (emacs-etc--hide-local-variables)) + (emacs-etc--hide-local-variables) + (setq-local outline-regexp (rx (+ (not (any ":\n"))) ": " + (or "changed" "co-wrote" "wrote") " ") + outline-minor-mode-cycle t + outline-level + (lambda () + (if (looking-at (rx bol + (or (or " " + (seq "and " (or "co-wrote" + "changed"))) + eol))) + 2 + 1))) + (outline-minor-mode)) (define-obsolete-face-alias 'etc-authors-default 'emacs-authors-default "29.1") (define-obsolete-face-alias 'etc-authors-author 'emacs-authors-author "29.1") -- 2.39.2