emacs-devel
[Top][All Lists]
Advanced

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

Re: [elpa] externals/transient 459e28e28a 03/11: Add lisp-imenu-generic-


From: Stefan Monnier
Subject: Re: [elpa] externals/transient 459e28e28a 03/11: Add lisp-imenu-generic-expression entry
Date: Sun, 26 Dec 2021 12:01:45 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> --- a/lisp/transient.el
> +++ b/lisp/transient.el
> @@ -3638,6 +3638,19 @@ search instead."
>  
>  ;;;; Miscellaneous
>  
> +(with-eval-after-load 'lisp-mode
> +  (cl-pushnew (list nil (concat "^\\s-*("
> +                                (eval-when-compile
> +                               (regexp-opt
> +                                '("transient-define-prefix"
> +                                     "transient-define-suffix"
> +                                     "transient-define-infix"
> +                                     "transient-define-argument")
> +                                   t))
> +                             "\\s-+\\(" lisp-mode-symbol-regexp "\\)")
> +                 2)
> +              lisp-imenu-generic-expression :test #'equal))

Hmm... `lisp-mode` doesn't seem right since that's the mode used for
Common-Lisp (yes, I know, here you're referring to the file, which
confusingly defines a lot more than just the `lisp-mode`).
I think `elisp-mode` would be closer to the truth.

Then again, they're both preloaded, so the `with-eval-after-load` can be
completely skipped.

BTW, I wish we had some kind of `register-defining-form` function which
would take care of tweaking the `imenu-generic-expression` as well as
the `font-lock-keywords` of elisp-mode.


        Stefan




reply via email to

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