emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a2cf5646d4: Support imenu in emacs-authors-mode


From: Stefan Kangas
Subject: master a2cf5646d4: Support imenu in emacs-authors-mode
Date: Fri, 12 Aug 2022 12:35:43 -0400 (EDT)

branch: master
commit a2cf5646d4cb3a2444ba53eb5452509f3ad9c6f7
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Support imenu in emacs-authors-mode
    
    * lisp/textmodes/emacs-authors-mode.el
    (emacs-authors-imenu-generic-expression): New variable.
    (emacs-authors-mode): Add imenu support.
---
 lisp/textmodes/emacs-authors-mode.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lisp/textmodes/emacs-authors-mode.el 
b/lisp/textmodes/emacs-authors-mode.el
index c9ec0e8cf8..ffb713fd68 100644
--- a/lisp/textmodes/emacs-authors-mode.el
+++ b/lisp/textmodes/emacs-authors-mode.el
@@ -119,6 +119,12 @@ With a prefix arg ARG, move point that many authors 
backward."
   (interactive "p" emacs-authors-mode)
   (emacs-authors-next-author (- arg)))
 
+(defvar emacs-authors-imenu-generic-expression
+  `((nil ,(rx bol (group (+ (not ":"))) ": "
+              (or "wrote" "co-wrote" "changed")
+              " ")
+         1)))
+
 (define-obsolete-variable-alias 'etc-authors-mode-map 'emacs-authors-mode-map 
"29.1")
 (defvar-keymap emacs-authors-mode-map
   :doc "Keymap for `emacs-authors-mode'."
@@ -132,6 +138,7 @@ Provides some basic font locking and not much else."
   (setq-local font-lock-defaults
               '(emacs-authors-mode-font-lock-keywords nil nil ((?_ . "w"))))
   (setq font-lock-multiline nil)
+  (setq imenu-generic-expression emacs-authors-imenu-generic-expression)
   (emacs-authors-mode--hide-local-variables))
 
 (define-obsolete-face-alias 'etc-authors-default 'emacs-authors-default "29.1")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]