unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jamie Beardslee <beardsleejamie@gmail.com>
To: Marcin Borkowski <mbork@mbork.pl>
Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: How to define a prefixed map for a minor mode?
Date: Sun, 07 Jun 2020 19:54:40 +1200	[thread overview]
Message-ID: <87ftb7wbsv.fsf@gmail.com> (raw)
In-Reply-To: <87h7vnmks7.fsf@mbork.pl> (Marcin Borkowski's message of "Sun, 07 Jun 2020 08:50:48 +0200")

> (easy-mmode-defmap ecat-mode-map
>   `(((kbd "C-c .") . ecat-basic-map))
>   "Keymap for `ecat-mode'.")

You're missing a couple of unquotes there -- that should be:

`((,(kbd "C-c .") . ,ecat-basic-map))

Smerge-mode uses a prefix key (C-c ^) for all commands and this is done
in pretty much the same way:

(easy-mmode-defmap smerge-basic-map
  `(("n" . smerge-next)
    ("p" . smerge-prev)
    [...])
  "The base keymap for `smerge-mode'.")

(defcustom smerge-command-prefix "\C-c^"
  "Prefix for `smerge-mode' commands."
  [...])

(easy-mmode-defmap smerge-mode-map
  `((,smerge-command-prefix . ,smerge-basic-map))
  "Keymap for `smerge-mode'.")



  reply	other threads:[~2020-06-07  7:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-07  6:50 How to define a prefixed map for a minor mode? Marcin Borkowski
2020-06-07  7:54 ` Jamie Beardslee [this message]
2020-06-07 20:45   ` Marcin Borkowski
2020-06-07  7:59 ` Michael Heerdegen
2020-06-07  8:16   ` Michael Heerdegen
2020-06-07 20:45     ` Marcin Borkowski
2020-06-08 11:23       ` Michael Heerdegen
2020-06-07 20:44   ` Marcin Borkowski
2020-06-07 10:18 ` Joost Kremers

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=87ftb7wbsv.fsf@gmail.com \
    --to=beardsleejamie@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=mbork@mbork.pl \
    /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).