[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: confusion with defining keys

From: Stefan Monnier
Subject: Re: confusion with defining keys
Date: Wed, 11 Jun 2014 07:53:27 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

> (global-set-key "\C-ä" 'undo)

This should ideally signal an error, because "\C-ä" is an invalid string
(a string can only contains chars and C-ä is not a char but
a "char combined with a modifier").  For historical reasons this doesn't
signal an error, but it doesn't do what you want.  Use either (kbd
"C-ä") or [?\C-ä].
In general, I recommend never to use the plain "..." notation for key
sequences: it made sense back in the Emacs-18 days when it was
introduced, but it's been a "legacy" since Emacs-19.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]