From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: More imenu questions
Date: Thu, 10 Nov 2005 15:00:14 -0700 [thread overview]
Message-ID: <dl0fti$7b7$1@sea.gmane.org> (raw)
In-Reply-To: <1131650614.618835.24650@z14g2000cwz.googlegroups.com>
gamename wrote:
> I'm trying to add menu items in tcl like this:
> (setq tcl-imenu-generic-expression
> '((TestCases "^aetest::testcase -tc_id \\([_-A-Za-z0-9+]+\\)[
> ]+{" 1)))
,----[ C-h v imenu-generic-expression RET ]
| imenu-generic-expression's value is nil
|
| Documentation:
| The regex pattern to use for creating a buffer index.
|
| If non-nil this pattern is passed to `imenu--generic-function'
| to create a buffer index.
|
| The value should be an alist with elements that look like this:
| (MENU-TITLE REGEXP INDEX)
| or like this:
| (MENU-TITLE REGEXP INDEX FUNCTION ARGUMENTS...)
| with zero or more ARGUMENTS. The former format creates a simple
element in
| the index alist when it matches; the latter creates a special element
| of the form (NAME POSITION-MARKER FUNCTION ARGUMENTS...)
| with FUNCTION and ARGUMENTS copied from `imenu-generic-expression'.
|
| MENU-TITLE is a string used as the title for the submenu or nil if the
| entries are not nested.
|
| REGEXP is a regexp that should match a construct in the buffer that is
| to be displayed in the menu; i.e., function or variable definitions,
| etc. It contains a substring which is the name to appear in the
| menu. See the info section on Regexps for more information.
|
| INDEX points to the substring in REGEXP that contains the name (of the
| function, variable or type) that is to appear in the menu.
|
| The variable is buffer-local.
|
| The variable `imenu-case-fold-search' determines whether or not the
| regexp matches are case sensitive, and `imenu-syntax-alist' can be
| used to alter the syntax table for the search.
|
| For example, see the value of `lisp-imenu-generic-expression' used by
| `fortran-mode' with `imenu-syntax-alist' set locally to give the
| characters which normally have "symbol" syntax "word" syntax
| during matching.
|
| Defined in `imenu'.
`----
> When I turn on the major mode (tcl-mode), I get this error:
> "Wrong type argument: symbolp, ((TestCases "^aetest::testcase -tc_id
> \\([_-A-Za-z0-9+]+\\)[ ]+{" 1))"
>
> What am I doing wrong?
You've got an extra level of parentheses:
(setq tcl-imenu-generic-expression
'(TestCases "^aetest::testcase -tc_id \\([_-A-Za-z0-9+]+\\)[
]+{" 1))
Also, [\n]+ would be more readable than a literal newline.
--
Kevin Rodgers
next prev parent reply other threads:[~2005-11-10 22:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-10 19:23 More imenu questions gamename
2005-11-10 21:11 ` Peter Dyballa
2005-11-10 22:00 ` Kevin Rodgers [this message]
2005-11-10 23:55 ` rgb
[not found] ` <mailman.14783.1131660316.20277.help-gnu-emacs@gnu.org>
2005-11-11 0:15 ` rgb
[not found] ` <mailman.14778.1131657088.20277.help-gnu-emacs@gnu.org>
2005-11-11 1:57 ` gamename
2005-11-11 16:43 ` rgb
2005-11-11 17:04 ` Drew Adams
2005-11-11 23:58 ` Donal K. Fellows
2005-11-14 22:24 ` Bruce Stephens
2005-11-12 17:20 ` gamename
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='dl0fti$7b7$1@sea.gmane.org' \
--to=ihs_4664@yahoo.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).