Subject: [PATCH] lisp-mode.el: Add defvar-keymap to lisp-imenu-generic-expression

From: Brian Leung <[email-masked]>
Date: Mon, 24 Jul 2023 11:49:44 +0000

Tags: patch

See attached. I made this commit on master branch, but maybe it 
would make sense on the release branch (I don't feel strongly 
either way)?

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, 
cairo
version 1.16.0, Xaw3d scroll bars)
Repository revision: 157e735ce89ede9cc939f4ed0f72c5af7ae60735
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 
11.0.12101008
System Description: NixOS 23.11 (Tapir)

Configured using:
 'configure
 --prefix=/nix/store/d16f6cwsasmchfdllgb9qr7yajinpb8q-emacs-git-20230717.0
 --disable-build-details --with-modules --with-x-toolkit=lucid
 --with-xft --with-cairo --with-native-compilation 
 --with-tree-sitter'
>From 0118cc9f5bbb14c6b87d3a6a8464bcddcd68c389 Mon Sep 17 00:00:00 2001
From: Brian Leung <[email-masked]>
Date: Mon, 24 Jul 2023 04:32:19 -0700
Subject: [PATCH] lisp-mode.el: Add defvar-keymap to
 lisp-imenu-generic-expression

* lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Add
defvar-keymap.  We do not ignore (defvar-keymap FOO) constructs in
imenu as we do with (defvar FOO) since the former constructs are
generally not vacuous whereas the latter ones often are.
---
 lisp/emacs-lisp/lisp-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 1990630608d..4eee009f689 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -134,7 +134,7 @@ lisp-imenu-generic-expression
 	 (purecopy (concat "^\\s-*("
 			   (regexp-opt
 			    '(;; Elisp
-                              "defconst" "defcustom"
+                              "defconst" "defcustom" "defvar-keymap"
                               ;; CL
                               "defconstant"
 			      "defparameter" "define-symbol-macro")
-- 
2.41.0