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

It worked under Emacs-20, but returned the same as "\C-a", i.e. probably not
what you intended.  In Emacs-21 this was fixed to return an error rather
than silently turning it into somwething else.

> 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'd expect it doesn't really work.  It won't signal an error, but it won't
cause my-cmd to be run when you hit control and !.  You probably meant to
use (define-key my-map [?\C-!] 'my-cmd) which should work.  I'd recommend

    (define-key my-map [(control ?!)] 'my-cmd)

which will also work under XEmacs.


        Stefan


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to