From: "Drew Adams" <drew.adams@oracle.com>
Subject: Cannot use "\C-!" in a string in Emacs 22?
Date: Mon, 26 Sep 2005 11:56:59 -0700 [thread overview]
Message-ID: <MEEKKIABFKKDFJMPIOEBEEOCCMAA.drew.adams@oracle.com> (raw)
I'm interested in a key-binding syntax that works with Emacs 20 through 22
(for those bindings that are acceptable to all of those versions). The (kbd
...) syntax, for instance, doesn't work with earlier Emacsen, so that choice
is out, for me.
I tried (define-key my-map "\C-!" 'my-cmd), which works in Emacs 20, but
gives this error in Emacs 22: "Invalid modifier in string". Based on the
error message, which speaks of strings, not key bindings, I tried (setq foo
"\C-!"), which gives the same error - so I guess it's a string-syntax
problem, not a key-binding syntax problem.
Is it normal that this was broken in moving to Emacs 22 (or 21)? Where is
the explanation of this in the Elisp manual (I looked in section Strings and
Characters and in the keybinding discussions).
Anyway, for the key binding, I settled on (define-key my-map [C-!] 'my-cmd),
after some experimentation - it seems to work for key bindings in both
versions.
I admit that I'm confused about the various key-binding syntaxes. I've
consulted the manual, but, except for (kbd...), I don't see a universal
syntax to use for all key sequences, and (kbd...) is not usable with Emacs
20. I somehow seem to always end up with collections of "\modifier-key",
[(modifier fn-key)], and [modifier-key]. I'm probably just not reading the
doc correctly, but I'd appreciate some light on the question.
next reply other threads:[~2005-09-26 18:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-26 18:56 Drew Adams [this message]
2005-09-26 19:44 ` Cannot use "\C-!" in a string in Emacs 22? Stefan Monnier
2005-09-26 20:28 ` Drew Adams
2005-09-26 20:50 ` Edward O'Connor
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=MEEKKIABFKKDFJMPIOEBEEOCCMAA.drew.adams@oracle.com \
--to=drew.adams@oracle.com \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).