From: "what.a.guy" <wr@taxupdate.com>
To: Help-gnu-emacs@gnu.org
Subject: very basic help for writing a new mode
Date: Fri, 5 Sep 2008 15:01:37 -0700 (PDT) [thread overview]
Message-ID: <19340325.post@talk.nabble.com> (raw)
I have data files which are sexp's of the form:
(version-string
("tax name 1" various fields follow)
("tax name 2" ...)
...
)
I'd like to have a mode which derives from scheme-mode, but with the "tax
name" strings as entries in a buffer index (imenu or ecb). Here's my
attempt:
(defvar tax-imenu-generic-expression
'((nil "^\\s-+(\"\\(w+\\)\"" 1)))
(define-derived-mode tax-mode scheme-mode
"major mode for handling tax files"
(make-local-variable 'imenu-generic-expression)
(make-local-variable 'imenu-case-fold-search)
(setq imenu-generic-expression tax-imenu-generic-expression
imenu-case-fold-search nil))
(provide 'tax-mode)
This does the right thing with font-locking, but I can't get it to list the
tax names as a buffer index (seems like semantic is still using the
scheme-imenu-generic-expression). I'm very new to elisp, so I'm struggling
even in figuring out how to debug this. Any suggestions?
Wayne
--
View this message in context: http://www.nabble.com/very-basic-help-for-writing-a-new-mode-tp19340325p19340325.html
Sent from the Emacs - Help mailing list archive at Nabble.com.
reply other threads:[~2008-09-05 22:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=19340325.post@talk.nabble.com \
--to=wr@taxupdate.com \
--cc=Help-gnu-emacs@gnu.org \
/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).