unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Sebastian Meisel <sebastianmeisel@web.de>
To: Emacs Mailing List <help-gnu-emacs@gnu.org>
Subject: Re: Emacs-Lisp Q: Minor mode keymap
Date: Fri, 27 Apr 2007 09:25:24 +0200	[thread overview]
Message-ID: <4631A564.4010804@web.de> (raw)
In-Reply-To: <1332jm5qdlpdnaf@corp.supernews.com>

Mark Elston schrieb:
>
> What I would like to do is package these functions as a minor
> mode with its own keymap and use \C-b in the LaTeX-mode-map
> used in AucTeX.  Creating the minor mode map is pretty easy.
> I assume that from there I do something like:
>
>   (define-prefix-command my-mode-map)
>
> or something similar.
>
> But from there, I don't see what to do.  Do I have to modify my
> .emacs to get the binding correct?  Can't I do it in the minor
> mode file?
Put something like that in your mode file:

(defvar YOUR-mode-map
  (let ((map  (make-sparse-keymap)))
    (define-key map "YOURKEYS"  'YOURFUN)
    ...
   map)
  "Keymap for YOUR-mode.")

(define-YOUR-mode
  "MY mode DOESSOMETHING.
Basic Commands
===== ========
\\[YOURFUN]\tDOESSOMETHING.
...
"
:lighter  "THISSHALLFILLMYENTIREMODELINETOSHOWMYMODEISON"
:keymap  YOUR-mode-map)
<----

Replace the uppercase parts ;-)

Sebastian Meisel

  reply	other threads:[~2007-04-27  7:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-27  1:18 Emacs-Lisp Q: Minor mode keymap Mark Elston
2007-04-27  7:25 ` Sebastian Meisel [this message]
2007-04-27  7:48   ` Lennart Borgman (gmail)
     [not found] ` <mailman.2580.1177659117.7795.help-gnu-emacs@gnu.org>
2007-04-27 17:49   ` Mark Elston
2007-04-27 20:15     ` Mark Elston

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=4631A564.4010804@web.de \
    --to=sebastianmeisel@web.de \
    --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).