unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Robert Pluim <rpluim@gmail.com>, emacs-devel@gnu.org
Subject: Re: emacs-28 56026242e4: Explain how to bind keys to non-ASCII sequences
Date: Mon, 14 Nov 2022 19:40:35 -0800	[thread overview]
Message-ID: <CADwFkm=08U1HQ2+5xziwBWmqjs6tYKYJanczUck9ZHXFY1VPKg@mail.gmail.com> (raw)
In-Reply-To: <20221114161917.7FC8AC00AB5@vcs2.savannah.gnu.org>

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	other threads:[~2022-11-15  3:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <166844275725.4187.2343107623845911514@vcs2.savannah.gnu.org>
     [not found] ` <20221114161917.7FC8AC00AB5@vcs2.savannah.gnu.org>
2022-11-15  3:40   ` Stefan Kangas [this message]
2022-11-15  8:28     ` emacs-28 56026242e4: Explain how to bind keys to non-ASCII sequences Robert Pluim
2022-11-15  9:09       ` Stefan Kangas
2022-11-15  9:14         ` Robert Pluim
2022-11-16  7:44           ` Stefan Kangas
2022-11-16  8:50             ` Robert Pluim

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='CADwFkm=08U1HQ2+5xziwBWmqjs6tYKYJanczUck9ZHXFY1VPKg@mail.gmail.com' \
    --to=stefankangas@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=rpluim@gmail.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).