all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* From  global-set-key to keymap-global-set
@ 2023-07-04 16:35 uzibalqa
  2023-07-04 16:44 ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: uzibalqa @ 2023-07-04 16:35 UTC (permalink / raw)
  To: uzibalqa via Users list for the GNU Emacs text editor


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)







^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: From  global-set-key to keymap-global-set
  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
                     ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Eli Zaretskii @ 2023-07-04 16:44 UTC (permalink / raw)
  To: help-gnu-emacs

> 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)



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: From  global-set-key to keymap-global-set
  2023-07-04 16:44 ` Eli Zaretskii
@ 2023-07-04 17:11   ` uzibalqa
  2023-07-04 17:31   ` uzibalqa
  2023-07-04 18:41   ` Emanuel Berg
  2 siblings, 0 replies; 22+ messages in thread
From: uzibalqa @ 2023-07-04 17:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

------- 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)

The change also affects the replacement of "define-key" towards "keymap-set".



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: From  global-set-key to keymap-global-set
  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
  2023-07-04 18:41   ` Emanuel Berg
  2 siblings, 1 reply; 22+ messages in thread
From: uzibalqa @ 2023-07-04 17:31 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs


------- 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-;"))




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: From  global-set-key to keymap-global-set
  2023-07-04 16:44 ` Eli Zaretskii
  2023-07-04 17:11   ` uzibalqa
  2023-07-04 17:31   ` uzibalqa
@ 2023-07-04 18:41   ` Emanuel Berg
  2 siblings, 0 replies; 22+ messages in thread
From: Emanuel Berg @ 2023-07-04 18:41 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii wrote:

>> The documentation states that "global-set-key" is a legacy
>> function; instructing
>> people that the recommended function to use is
>> "keymap-global-set" [..]
>
> Are you reading the documentation [...]

It would be even better if such legacy comments/redirection
could be expressed syntactically, it would not only look the
same everywhere in source and hold uniform data with no need
to hard-code anything, more importantly the data could then be
picked up from different sources for local adaptation for the
specific purpose.

The documentation (help) would be one such use case yes, but
another would be the byte-compiler, because now it remains
silent despite me compiling 79 cases of `global-set-key' ...

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: From  global-set-key to keymap-global-set
  2023-07-04 17:31   ` uzibalqa
@ 2023-07-04 19:40     ` uzibalqa
  2023-07-04 20:26       ` [External] : " Drew Adams
  0 siblings, 1 reply; 22+ messages in thread
From: uzibalqa @ 2023-07-04 19:40 UTC (permalink / raw)
  To: uzibalqa; +Cc: Eli Zaretskii, help-gnu-emacs


------- 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.




^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [External] : Re: From  global-set-key to keymap-global-set
  2023-07-04 19:40     ` uzibalqa
@ 2023-07-04 20:26       ` Drew Adams
  2023-07-04 20:39         ` uzibalqa
  0 siblings, 1 reply; 22+ messages in thread
From: Drew Adams @ 2023-07-04 20:26 UTC (permalink / raw)
  To: uzibalqa; +Cc: Eli Zaretskii, help-gnu-emacs@gnu.org

> > 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.

FWIW, that's quoting me, until your "I recommend...".

https://emacs.stackexchange.com/a/77865

Someone may correct me.  A quick look at the doc strings
and manuals indicated to me that some things aren't yet
specified clearly.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [External] : Re: From  global-set-key to keymap-global-set
  2023-07-04 20:26       ` [External] : " Drew Adams
@ 2023-07-04 20:39         ` uzibalqa
  2023-07-05  9:44           ` uzibalqa
  0 siblings, 1 reply; 22+ messages in thread
From: uzibalqa @ 2023-07-04 20:39 UTC (permalink / raw)
  To: Drew Adams; +Cc: Eli Zaretskii, help-gnu-emacs@gnu.org

------- Original Message -------
On Wednesday, July 5th, 2023 at 8:26 AM, Drew Adams <drew.adams@oracle.com> wrote:


> > > 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.
> 
> 
> FWIW, that's quoting me, until your "I recommend...".

Right.  Your suggestion made as direct request here.  
 
> https://emacs.stackexchange.com/a/77865
> 
> Someone may correct me. A quick look at the doc strings
> and manuals indicated to me that some things aren't yet
> specified clearly.



^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [External] : Re: From  global-set-key to keymap-global-set
  2023-07-04 20:39         ` uzibalqa
@ 2023-07-05  9:44           ` uzibalqa
  2023-07-05 11:34             ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: uzibalqa @ 2023-07-05  9:44 UTC (permalink / raw)
  To: uzibalqa; +Cc: Drew Adams, Eli Zaretskii, help-gnu-emacs@gnu.org


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


> ------- Original Message -------
> On Wednesday, July 5th, 2023 at 8:26 AM, Drew Adams drew.adams@oracle.com wrote:
> 
> 
> 
> > > > 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.
> > 
> > FWIW, that's quoting me, until your "I recommend...".
> 
> 
> Right. Your suggestion made as direct request here.
> 
> > https://emacs.stackexchange.com/a/77865
> > 
> > Someone may correct me. A quick look at the doc strings
> > and manuals indicated to me that some things aren't yet
> > specified clearly.

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-;")





^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [External] : Re: From  global-set-key to keymap-global-set
  2023-07-05  9:44           ` uzibalqa
@ 2023-07-05 11:34             ` Eli Zaretskii
  2023-07-05 12:02               ` uzibalqa
  0 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2023-07-05 11:34 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Wed, 05 Jul 2023 09:44:41 +0000
> From: uzibalqa <uzibalqa@proton.me>
> Cc: Drew Adams <drew.adams@oracle.com>, Eli Zaretskii <eliz@gnu.org>, "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
> 
> 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"?



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [External] : Re: From  global-set-key to keymap-global-set
  2023-07-05 11:34             ` Eli Zaretskii
@ 2023-07-05 12:02               ` uzibalqa
  2023-07-05 12:46                 ` uzibalqa
                                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: uzibalqa @ 2023-07-05 12:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

------- Original Message -------
On Wednesday, July 5th, 2023 at 11:34 PM, Eli Zaretskii <eliz@gnu.org> wrote:


> > Date: Wed, 05 Jul 2023 09:44:41 +0000
> > From: uzibalqa uzibalqa@proton.me
> > Cc: Drew Adams drew.adams@oracle.com, Eli Zaretskii eliz@gnu.org, "help-gnu-emacs@gnu.org" help-gnu-emacs@gnu.org
> > 
> > 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-;".




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [External] : Re: From  global-set-key to keymap-global-set
  2023-07-05 12:02               ` uzibalqa
@ 2023-07-05 12:46                 ` uzibalqa
  2023-07-05 12:56                 ` Drew Adams
  2023-07-05 13:30                 ` Eli Zaretskii
  2 siblings, 0 replies; 22+ messages in thread
From: uzibalqa @ 2023-07-05 12:46 UTC (permalink / raw)
  To: uzibalqa; +Cc: Eli Zaretskii, help-gnu-emacs


------- Original Message -------
On Thursday, July 6th, 2023 at 12:02 AM, uzibalqa <uzibalqa@proton.me> wrote:


> ------- Original Message -------
> On Wednesday, July 5th, 2023 at 11:34 PM, Eli Zaretskii eliz@gnu.org wrote:
> 
> 
> 
> > > Date: Wed, 05 Jul 2023 09:44:41 +0000
> > > From: uzibalqa uzibalqa@proton.me
> > > Cc: Drew Adams drew.adams@oracle.com, Eli Zaretskii eliz@gnu.org, "help-gnu-emacs@gnu.org" help-gnu-emacs@gnu.org
> > > 
> > > 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-;".

It makes sense to use (keymap-set "C-;" (kbd "C-x C-;")) 
because (kbd "C-x C-;") looks as a command.




^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [External] : Re: From  global-set-key to keymap-global-set
  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
  2 siblings, 1 reply; 22+ messages in thread
From: Drew Adams @ 2023-07-05 12:56 UTC (permalink / raw)
  To: uzibalqa, Eli Zaretskii; +Cc: help-gnu-emacs@gnu.org

> 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-;".

What you're calling a "keymap" here is a
description of a key sequence.  It's what
is acceptable as an argument to `kbd'.


^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [External] : Re: From  global-set-key to keymap-global-set
  2023-07-05 12:56                 ` Drew Adams
@ 2023-07-05 13:20                   ` uzibalqa
  0 siblings, 0 replies; 22+ messages in thread
From: uzibalqa @ 2023-07-05 13:20 UTC (permalink / raw)
  To: Drew Adams; +Cc: Eli Zaretskii, help-gnu-emacs@gnu.org


------- Original Message -------
On Thursday, July 6th, 2023 at 12:56 AM, Drew Adams <drew.adams@oracle.com> wrote:


> > 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-;".
> 
> 
> What you're calling a "keymap" here is a
> description of a key sequence. It's what
> is acceptable as an argument to `kbd'.

You are quite right on the correct terminology.




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [External] : Re: From  global-set-key to keymap-global-set
  2023-07-05 12:02               ` uzibalqa
  2023-07-05 12:46                 ` uzibalqa
  2023-07-05 12:56                 ` Drew Adams
@ 2023-07-05 13:30                 ` Eli Zaretskii
  2023-07-05 14:01                   ` uzibalqa
  2 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2023-07-05 13:30 UTC (permalink / raw)
  To: help-gnu-emacs

> 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".



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [External] : Re: From  global-set-key to keymap-global-set
  2023-07-05 13:30                 ` Eli Zaretskii
@ 2023-07-05 14:01                   ` uzibalqa
  2023-07-06  8:45                     ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: uzibalqa @ 2023-07-05 14:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

------- 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" ? 







^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [External] : Re: From  global-set-key to keymap-global-set
  2023-07-05 14:01                   ` uzibalqa
@ 2023-07-06  8:45                     ` Eli Zaretskii
  2023-07-06 12:07                       ` uzibalqa
  0 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2023-07-06  8:45 UTC (permalink / raw)
  To: help-gnu-emacs

> 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.



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [External] : Re: From  global-set-key to keymap-global-set
  2023-07-06  8:45                     ` Eli Zaretskii
@ 2023-07-06 12:07                       ` uzibalqa
  2023-07-06 13:53                         ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: uzibalqa @ 2023-07-06 12:07 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs


------- 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





^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [External] : Re: From  global-set-key to keymap-global-set
  2023-07-06 12:07                       ` uzibalqa
@ 2023-07-06 13:53                         ` Eli Zaretskii
  2023-07-06 14:24                           ` uzibalqa
  2023-07-06 16:01                           ` uzibalqa
  0 siblings, 2 replies; 22+ messages in thread
From: Eli Zaretskii @ 2023-07-06 13:53 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 06 Jul 2023 12:07:02 +0000
> From: uzibalqa <uzibalqa@proton.me>
> Cc: help-gnu-emacs@gnu.org
> 
> Drew mentioned some areas for improvement.  Could some of them be completed.

How do you know they weren't already?



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [External] : Re: From  global-set-key to keymap-global-set
  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
  1 sibling, 1 reply; 22+ messages in thread
From: uzibalqa @ 2023-07-06 14:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

------- Original Message -------
On Friday, July 7th, 2023 at 1:53 AM, Eli Zaretskii <eliz@gnu.org> wrote:


> > Date: Thu, 06 Jul 2023 12:07:02 +0000
> > From: uzibalqa uzibalqa@proton.me
> > Cc: help-gnu-emacs@gnu.org
> > 
> > Drew mentioned some areas for improvement. Could some of them be completed.
> 
> 
> How do you know they weren't already?

He knows much more than I do.  I find that because of lack of examples, things
a bit difficult to figure out.  There has been such discussions before.  The manuals
are not intended to have examples unless absolutely necessary.  But having some
way to see some examples by running some emacs commands would be helpful.  I am
not aware of such a help feature in emacs.



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [External] : Re: From  global-set-key to keymap-global-set
  2023-07-06 14:24                           ` uzibalqa
@ 2023-07-06 14:49                             ` Eli Zaretskii
  0 siblings, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2023-07-06 14:49 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 06 Jul 2023 14:24:04 +0000
> From: uzibalqa <uzibalqa@proton.me>
> Cc: help-gnu-emacs@gnu.org
> 
> > > Drew mentioned some areas for improvement. Could some of them be completed.
> > 
> > 
> > How do you know they weren't already?
> 
> He knows much more than I do.

A couple of days passed since Drew's comments, things could have
changed since then, no?

> I find that because of lack of examples, things
> a bit difficult to figure out.  There has been such discussions before.  The manuals
> are not intended to have examples unless absolutely necessary.  But having some
> way to see some examples by running some emacs commands would be helpful.  I am
> not aware of such a help feature in emacs.

Try shortdoc.



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [External] : Re: From  global-set-key to keymap-global-set
  2023-07-06 13:53                         ` Eli Zaretskii
  2023-07-06 14:24                           ` uzibalqa
@ 2023-07-06 16:01                           ` uzibalqa
  1 sibling, 0 replies; 22+ messages in thread
From: uzibalqa @ 2023-07-06 16:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs






Sent with Proton Mail secure email.

------- Original Message -------
On Friday, July 7th, 2023 at 1:53 AM, Eli Zaretskii <eliz@gnu.org> wrote:


> > Date: Thu, 06 Jul 2023 12:07:02 +0000
> > From: uzibalqa uzibalqa@proton.me
> > Cc: help-gnu-emacs@gnu.org
> > 
> > Drew mentioned some areas for improvement. Could some of them be completed.
> 
> 
> How do you know they weren't already?
>
> A couple of days passed since Drew's comments, things could have
> changed since then, no?

Much appreciated

>> I find that because of lack of examples, things
>> a bit difficult to figure out. There has been such discussions before. The manuals
>> are not intended to have examples unless absolutely necessary. But having some
>> way to see some examples by running some emacs commands would be helpful. I am
>> not aware of such a help feature in emacs.

> Try shortdoc.

Will check it out





^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2023-07-06 16:01 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.