emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs-28 56026242e4: Explain how to bind keys to non-ASCII sequences


From: Stefan Kangas
Subject: Re: emacs-28 56026242e4: Explain how to bind keys to non-ASCII sequences
Date: Mon, 14 Nov 2022 19:40:35 -0800

Robert Pluim <rpluim@gmail.com> writes:

> branch: emacs-28
> commit 56026242e462e8834337f118baaa9c49e2411f7d
> Author: Robert Pluim <rpluim@gmail.com>
> Commit: Robert Pluim <rpluim@gmail.com>
>
>     Explain how to bind keys to non-ASCII sequences
>
>     * doc/emacs/custom.texi (Init Rebinding): Explain how to use `kbd'
>     when binding keys to non-ASCII sequences.
> ---
>  doc/emacs/custom.texi | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
> index 2bc1d3820d..65970ce412 100644
> --- a/doc/emacs/custom.texi
> +++ b/doc/emacs/custom.texi
> @@ -1868,6 +1868,22 @@ characters.  For example, here's how to bind @kbd{C-x 
> M-l} to
>
>  @example
>  (global-set-key "\C-x\M-l" 'make-symbolic-link)
> +@end example
> +
> +  Similarly, a key sequence can be bound to a Lisp string or a vector
> +instead of a command.  A vector is only required if the intended
> +result contains non-@acronym{ASCII} characters, and @code{kbd} can
> +again be used to create that vector.  For example, to bind @kbd{C-c h}
> +to the string @samp{hello}:
> +
> +@example
> +(global-set-key (kbd "C-c h") "hello")
> +@end example
> +
> +  But to bind it to the string @samp{olá} instead:
> +
> +@example
> +(global-set-key (kbd "C-c h") (kbd "olá"))
>  @end example
>
>    To bind a key sequence including @key{TAB}, @key{RET}, @key{ESC}, or

This section has changed quite a bit on master, including using
`keymap-global-set' instead.  Unfortunately, I'm not sure what if
anything needs adding to the text already on master.  Could you please
look into it, or even help merge it?

Thanks in advance.



reply via email to

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