unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* imenu rescan automatically
@ 2024-08-11 16:51 Heime
  2024-08-11 23:41 ` Joel Reicher
  0 siblings, 1 reply; 12+ messages in thread
From: Heime @ 2024-08-11 16:51 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

I made this interactive function that adds items to imenu menubar.

But I want a rescan to happen automatically rather than having to
do it after I call the function.

(defun lumin-expr-elisp (actm)

  (interactive
   (list
     (let ( (cseq '("Declarations")) )
       (completing-read "ACTM: " cseq nil t "Declarations"))))

   (cond
     
     ((equal actm "Declarations")
        (setq imenu-generic-expression
          `( ("defconst"
                ,(concat "^\\s-*"
                         "(defconst\\s-+"
                         "\\(\\(\\sw\\|\\s_\\)+\\)") 1)

             ("defvar"
                ,(concat "^\\s-*"
                         "(\\(defvar\\|defvar-local\\)\\s-+"
                         "\\(\\(\\sw\\|\\s_\\)+\\)") 2)

             ("defcustom"
                ,(concat "^\\s-*"
                         "(defcustom\\s-+"
                         "\\(\\(\\sw\\|\\s_\\)+\\)") 1)

             ("defun"
                ,(concat "^\\s-*"
                         "(\\(defun\\|define-minor-mode\\)\\s-+"
                         "\\(\\(\\sw\\|\\s_\\)+\\)") 2) ))) )

   (when imenu-generic-expression
     (imenu--make-index-alist t)
     (imenu-add-to-menubar "Lumi")
     (call-interactively 'imenu)) )






^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-08-12 13:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-11 16:51 imenu rescan automatically Heime
2024-08-11 23:41 ` Joel Reicher
2024-08-12  9:34   ` Heime
2024-08-12 10:13     ` Joel Reicher
2024-08-12 10:21       ` Heime
2024-08-12 10:50         ` Joel Reicher
2024-08-12 11:27           ` Heime
2024-08-12 11:57             ` Joel Reicher
2024-08-12 12:14               ` Heime
2024-08-12 12:20                 ` Joel Reicher
2024-08-12 12:32                   ` Christopher Dimech
2024-08-12 13:02                     ` Joel Reicher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).