]> git.eshelyaron.com Git - emacs.git/commitdiff
Support outline-minor-mode in emacs-authors-mode
authorStefan Kangas <stefankangas@gmail.com>
Sat, 10 Sep 2022 03:03:58 +0000 (05:03 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Sat, 10 Sep 2022 03:03:58 +0000 (05:03 +0200)
* lisp/textmodes/emacs-authors-mode.el (emacs-authors-mode):
Support and enable outline-minor-mode.

lisp/textmodes/emacs-authors-mode.el

index 866822c103db8c022ced3c3d4262fcfd06f41e56..3eba8e0e456cc4a5dfe29da27b210a623d3a383e 100644 (file)
@@ -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")