unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Cannot use "\C-!" in a string in Emacs 22?
@ 2005-09-26 18:56 Drew Adams
  2005-09-26 19:44 ` Stefan Monnier
  2005-09-26 20:50 ` Edward O'Connor
  0 siblings, 2 replies; 4+ messages in thread
From: Drew Adams @ 2005-09-26 18:56 UTC (permalink / 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-26 20:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-26 18:56 Cannot use "\C-!" in a string in Emacs 22? Drew Adams
2005-09-26 19:44 ` Stefan Monnier
2005-09-26 20:28   ` Drew Adams
2005-09-26 20:50 ` Edward O'Connor

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).