unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Heime <heimeborgia@protonmail.com>
To: Heime <heimeborgia@protonmail.com>
Cc: Joel Reicher <joel.reicher@gmail.com>,
	Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: imenu framework
Date: Sun, 28 Jul 2024 23:55:50 +0000	[thread overview]
Message-ID: <PomrFqJfHVBwUdUqSSm4WQ81xZTwthlGSrlrW7_nruV93T6RAMzzsCFFCIDkhwpd5YoRlaMqdEN2h7FazljPM_VEZBnnyzvQwHn-ZotB4lE=@protonmail.com> (raw)
In-Reply-To: <7U1y4ZfDEPDy1EhmNhXap-Nyr43egKTVAHLTLB0D04GPqXCZJKNibj8op97CZlA42y0L4IniVZN4sH_vK-mxeEb9rQ9nYIrA_k07O2gqzlc=@protonmail.com>






Sent with Proton Mail secure email.

On Monday, July 29th, 2024 at 10:02 AM, Heime <heimeborgia@protonmail.com> wrote:

> On Monday, July 29th, 2024 at 5:18 AM, Heime heimeborgia@protonmail.com wrote:
> 
> > On Sunday, July 28th, 2024 at 6:23 PM, Joel Reicher joel.reicher@gmail.com wrote:
> > 
> > > Heime heimeborgia@protonmail.com writes:
> > > 
> > > > imenu is a framework for mode-specific buffer indexes
> > > > 
> > > > Does this mean that it can list the function names depending on
> > > > the programming language mode ?
> > > 
> > > That's what the language mode should provide, yes, but strictly
> > > speaking it depends on the mode.
> > > 
> > > Do you have a particular mode in mind? Its code can be examined.
> > > 
> > > For example, java-ts-mode contains
> > > 
> > > (setq-local treesit-simple-imenu-settings
> > > '(("Class" "\\`class_declaration\\\\\\\\\\\\\\\\'" nil nil) ("Interface" "\\\\\\\\\\\\\\\\`interface_declaration\\'" nil
> > > nil)
> > > ("Enum" "\\`record_declaration\\\\\\\\\\\\\\\\'" nil nil) ("Method" "\\\\\\\\\\\\\\\\`method_declaration\\'" nil nil)))
> > > 
> > > (and then there is glue in the generic treesitter code)
> > > 
> > > Cheers,
> > > 
> > > - Joel

Have split the regexp strings this way, but getting into problems when
using concat.

  (setq imenu-generic-expression
        `( ("Functions"
              ,(concat "^\\s-*"
                       "(defun\\s-+\\([[:word:]-]+\\)") 1)
           ("Variables"
              ,(concat "^\\s-*"
                       "(\\(defvar\\|defvar-local\\|defconst\\)"
                       "\\s-+\\([[:word:]-]+\\)")  2)))




      reply	other threads:[~2024-07-28 23:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-27 21:29 imenu framework Heime
2024-07-28  6:23 ` Joel Reicher
2024-07-28 17:18   ` Heime
2024-07-28 22:02     ` Heime
2024-07-28 23:55       ` Heime [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='PomrFqJfHVBwUdUqSSm4WQ81xZTwthlGSrlrW7_nruV93T6RAMzzsCFFCIDkhwpd5YoRlaMqdEN2h7FazljPM_VEZBnnyzvQwHn-ZotB4lE=@protonmail.com' \
    --to=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=joel.reicher@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).