unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: uzibalqa <uzibalqa@proton.me>
To: uzibalqa <uzibalqa@proton.me>
Cc: Eli Zaretskii <eliz@gnu.org>, help-gnu-emacs@gnu.org
Subject: Re: From  global-set-key to keymap-global-set
Date: Tue, 04 Jul 2023 19:40:57 +0000	[thread overview]
Message-ID: <foXtQIoaeq00sBST5yjuXptT6hZkSf2DYfPM7m1yFU2vbD2xU_xw7ZFxBKGsmpFaDrld4z4VT5-dBPhzwI3IDbBdXR-IlDxHZwmKp4EkJcI=@proton.me> (raw)
In-Reply-To: <iplszQJUEwPdIxQXOy-5hXPt0scxlHvAtM78mpueyl_UbL95EUID9Hp8WGdfDuRI36kR8jW_eYayyYJcZcwmcOwNfin6DEPKU59Su2I98-Y=@proton.me>


------- Original Message -------
On Wednesday, July 5th, 2023 at 5:31 AM, uzibalqa <uzibalqa@proton.me> wrote:


> ------- Original Message -------
> On Wednesday, July 5th, 2023 at 4:44 AM, Eli Zaretskii eliz@gnu.org wrote:
> 
> 
> 
> > > Date: Tue, 04 Jul 2023 16:35:34 +0000
> > > From: uzibalqa uzibalqa@proton.me
> > > 
> > > Have been using "global-set-key" in this way
> > > 
> > > (global-set-key (kbd "H-e") #'eval-expression)
> > > 
> > > The documentation states that "global-set-key" is a legacy function; instructing
> > > people that the recommended function to use is "keymap-global-set".
> > > 
> > > The problem is that one cannot use "keymap-global-set" in the same way
> > > 
> > > (keymap-global-set (kbd "H-e") #'eval-expression)
> > 
> > Are you reading the documentation of the function before you start
> > using it? If not, I highly recommend to do so.
> > 
> > In this particular case, you need to get rid of 'kbd' -- this was the
> > main reason for providing these new replacements.
> > 
> > (keymap-global-set "H-e" #'eval-expression)
> 
> 
> What does one do to replace
> 
> (global-set-key (kbd "C-;") (kbd "C-x C-;"))


I tried 

(keymap-global-set "C-;" "C-x C-;")

and it sets C-; to the command that's bound to C-x C-;

The doc string of keymap-global-set doesn't say clearly that argument COMMAND 
can be a key description (what kbd returns) of a key sequence bound to some 
command.  I recommend an improved description.




  reply	other threads:[~2023-07-04 19:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-04 16:35 From global-set-key to keymap-global-set uzibalqa
2023-07-04 16:44 ` Eli Zaretskii
2023-07-04 17:11   ` uzibalqa
2023-07-04 17:31   ` uzibalqa
2023-07-04 19:40     ` uzibalqa [this message]
2023-07-04 20:26       ` [External] : " Drew Adams
2023-07-04 20:39         ` uzibalqa
2023-07-05  9:44           ` uzibalqa
2023-07-05 11:34             ` Eli Zaretskii
2023-07-05 12:02               ` uzibalqa
2023-07-05 12:46                 ` uzibalqa
2023-07-05 12:56                 ` Drew Adams
2023-07-05 13:20                   ` uzibalqa
2023-07-05 13:30                 ` Eli Zaretskii
2023-07-05 14:01                   ` uzibalqa
2023-07-06  8:45                     ` Eli Zaretskii
2023-07-06 12:07                       ` uzibalqa
2023-07-06 13:53                         ` Eli Zaretskii
2023-07-06 14:24                           ` uzibalqa
2023-07-06 14:49                             ` Eli Zaretskii
2023-07-06 16:01                           ` uzibalqa
2023-07-04 18:41   ` Emanuel Berg

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='foXtQIoaeq00sBST5yjuXptT6hZkSf2DYfPM7m1yFU2vbD2xU_xw7ZFxBKGsmpFaDrld4z4VT5-dBPhzwI3IDbBdXR-IlDxHZwmKp4EkJcI=@proton.me' \
    --to=uzibalqa@proton.me \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.
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).