From a2cf5646d4cb3a2444ba53eb5452509f3ad9c6f7 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 12 Aug 2022 18:33:34 +0200 Subject: [PATCH] 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 c9ec0e8cf81..ffb713fd682 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") -- 2.39.5