unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emilio Lopes <eclig@gmx.net>
To: help-gnu-emacs@gnu.org
Subject: Re: global-set-key, error: Invalid modifier in string
Date: Fri, 17 Aug 2007 20:16:32 +0200	[thread overview]
Message-ID: <qywsvu10xr.fsf@freenet.de> (raw)
In-Reply-To: 1187364053.751956.181150@22g2000hsm.googlegroups.com

John  writes:

> On Aug 17, 6:13 am, bojohan+n...@dd.chalmers.se (Johan Bockgård)
> wrote:
>> Strings can't contain non-ASCII control characters. Use (kbd "C-.") or
>> [?\C-.] etc instead.

> I'm not familiar with the differences between ascii and non-ascii ctrl
> characters, but using kbd fixed the problem. :)

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)

-- 
Emílio C. Lopes
Munich, Germany

  parent reply	other threads:[~2007-08-17 18:16 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 [this message]
2007-08-20  6:12       ` Stefan Monnier
     [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=qywsvu10xr.fsf@freenet.de \
    --to=eclig@gmx.net \
    --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).