help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: [External] : Re: From global-set-key to keymap-global-set


From: uzibalqa
Subject: Re: [External] : Re: From global-set-key to keymap-global-set
Date: Thu, 06 Jul 2023 12:07:02 +0000

------- Original Message -------
On Thursday, July 6th, 2023 at 8:45 PM, Eli Zaretskii <eliz@gnu.org> wrote:


> > Date: Wed, 05 Jul 2023 14:01:51 +0000
> > From: uzibalqa uzibalqa@proton.me
> > Cc: help-gnu-emacs@gnu.org
> > 
> > ------- Original Message -------
> > On Thursday, July 6th, 2023 at 1:30 AM, Eli Zaretskii eliz@gnu.org wrote:
> > 
> > > > Date: Wed, 05 Jul 2023 12:02:54 +0000
> > > > From: uzibalqa uzibalqa@proton.me
> > > > Cc: help-gnu-emacs@gnu.org
> > > > 
> > > > ------- Original Message -------
> > > > On Wednesday, July 5th, 2023 at 11:34 PM, Eli Zaretskii eliz@gnu.org 
> > > > wrote:
> > > > 
> > > > > > Eli, are we meant to use keymap-global-set this way in order
> > > > > > to make an alternative keymap ?
> > > > > > 
> > > > > > (keymap-global-set "C-;" "C-x C-;")
> > > > > 
> > > > > I don't think I understand the question. What do you mean by "make an
> > > > > alternative map"?
> > > > 
> > > > Following up on Drew's "What's a command and its purported replacement",
> > > > are "keymap-set" and "keymap-global-set" supposed to accept the 
> > > > declarations
> > > > where command is actually a keymap like so
> > > > 
> > > > (keymap-set "C-;" "C-x C-;")
> > > > (keymap-global-set "C-;" "C-x C-;")
> > > > 
> > > > Which is intended to add the keymap "C-;" as an equivalence to "C-x 
> > > > C-;",'and
> > > > thusly having "C-;" as an alternative keymap to using "C-x C-;".
> > > 
> > > Except that "C-x C-;" is not a keymap, so I still don't understand
> > > what are you asking about when you say "alternative keymap".
> > 
> > Drew has corrected me about the terminology.
> > 
> > I am quite confused with the following
> > 
> > (global-set-key KEY COMMAND)
> > (keymap-global-set KEY COMMAND)
> > 
> > (define-key KEYMAP KEY DEF &optional REMOVE)
> > (keymap-set KEYMAP KEY DEFINITION)
> > 
> > Previously one was able to add a Key Sequence KSQ as equivalent to a
> > previously defined Key Sequence KSQ-ORIGINAL. How would we do this
> > now with "keymap-set" and "keymap-global-set" ?
> 
> 
> The same. In non-interactive usage keymap-global-set accepts strings
> as COMMAND.

And thus all these are perfectly fine

(global-set-key "C-;" "C-x C-;")
(keymap-global-set "C-;" "C-x C-;")
 
(define-key KEYMAP "C-;" "C-x C-;")
(keymap-set KEYMAP "C-;" "C-x C-;")
 
Drew mentioned some areas for improvement.  Could some of them be completed.

Regards





reply via email to

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