From: Randy Taylor Date: Wed, 8 Mar 2023 01:38:18 +0000 (-0500) Subject: Fix enums and unions appearing as structs in c-ts-base-mode's imenu X-Git-Tag: emacs-29.0.90~207 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1de513a29fa;p=emacs.git Fix enums and unions appearing as structs in c-ts-base-mode's imenu * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Separate enums and unions out from structs. --- diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index fdd962ff020..ff86b9e0544 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -930,9 +930,9 @@ the semicolon. This function skips the semicolon." ;; Imenu. (setq-local treesit-simple-imenu-settings (let ((pred #'c-ts-mode--defun-valid-p)) - `(("Struct" ,(rx bos (or "struct" "enum" "union") - "_specifier" eos) - ,pred nil) + `(("Enum" "\\`enum_specifier\\'" ,pred nil) + ("Struct" "\\`struct_specifier\\'" ,pred nil) + ("Union" "\\`union_specifier\\'" ,pred nil) ("Variable" ,(rx bos "declaration" eos) ,pred nil) ("Function" "\\`function_definition\\'" ,pred nil) ("Class" ,(rx bos (or "class_specifier"