unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: global-set-key, error: Invalid modifier in string
Date: Mon, 20 Aug 2007 02:12:02 -0400	[thread overview]
Message-ID: <jwvfy2evisk.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: qywsvu10xr.fsf@freenet.de

> I have this macro at the top of my ~/.emacs so that I don't have to
> think about this mess anymore:

>     (defmacro global-defkey (key def)
>       "*Bind KEY globally to DEF.
>     KEY should be a string constant in the format used for
>     saving keyboard macros (cf. `insert-kbd-macro')."
>       `(global-set-key (kbd ,key) ,def))

> Use it as in:

>     (global-defkey "C-M-<backspace>" 'backward-kill-sexp)

I prefer to solve this issue by saying that key combos are not characters and
hence key sequences are not strings.
So I recommend to use the array notation instead, which also happens to be
the "native" notation.


        Stefan

  reply	other threads:[~2007-08-20  6:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-17  5:08 global-set-key, error: Invalid modifier in string John
2007-08-17  8:17 ` Peter Dyballa
2007-08-17 10:13 ` Johan Bockgård
2007-08-17 15:20   ` John
2007-08-17 15:40     ` John
2007-08-19 15:56       ` Johan Bockgård
2007-08-17 18:16     ` Emilio Lopes
2007-08-20  6:12       ` Stefan Monnier [this message]
     [not found] ` <mailman.4897.1187338712.32220.help-gnu-emacs@gnu.org>
2007-08-17 15:08   ` John

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=jwvfy2evisk.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --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).