unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* keymap.el and its checks
@ 2022-10-03  0:39 T.V Raman
  2022-10-03  0:48 ` Stefan Monnier
  2022-10-03  6:58 ` Juri Linkov
  0 siblings, 2 replies; 9+ messages in thread
From: T.V Raman @ 2022-10-03  0:39 UTC (permalink / raw)
  To: emacs-devel

I saw this change from Stefan:
570a11052b * keymap.el: Ease up support for non-`kbd` formats.

and thought this would let me write 
(push repeat-exit-key unread-command-events)

but it still produces 
 KEY must be an integer, cons, symbol, or string
after update/recompile/restart?

-- 

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮



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

* Re: keymap.el and its checks
  2022-10-03  0:39 keymap.el and its checks T.V Raman
@ 2022-10-03  0:48 ` Stefan Monnier
  2022-10-03  1:10   ` T.V Raman
  2022-10-03  1:15   ` T.V Raman
  2022-10-03  6:58 ` Juri Linkov
  1 sibling, 2 replies; 9+ messages in thread
From: Stefan Monnier @ 2022-10-03  0:48 UTC (permalink / raw)
  To: T.V Raman; +Cc: emacs-devel

> I saw this change from Stefan:
> 570a11052b * keymap.el: Ease up support for non-`kbd` formats.
>
> and thought this would let me write 
> (push repeat-exit-key unread-command-events)

No relation.
As for your problem: `unread-command-events` is defined tpo hold a list
of events.  `repeat-exit-key` is supposed to contain a key-sequence
(more or less an array of keys).  Keys and events are somewhat similar
so you can use keys as events.  But a key *sequence* is definitely not
an events.

You can use `listify-key-sequence`to turn the key sequence into a
list of keys, and then use `append`.


        Stefan




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

* Re: keymap.el and its checks
  2022-10-03  0:48 ` Stefan Monnier
@ 2022-10-03  1:10   ` T.V Raman
  2022-10-03  1:15   ` T.V Raman
  1 sibling, 0 replies; 9+ messages in thread
From: T.V Raman @ 2022-10-03  1:10 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb18030, Size: 114 bytes --]

Thanks!

-- 

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
7©4 Id: kg:/m/0285kf1  •0Ü8



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

* Re: keymap.el and its checks
  2022-10-03  0:48 ` Stefan Monnier
  2022-10-03  1:10   ` T.V Raman
@ 2022-10-03  1:15   ` T.V Raman
  2022-10-03  2:52     ` Stefan Monnier
  1 sibling, 1 reply; 9+ messages in thread
From: T.V Raman @ 2022-10-03  1:15 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb18030, Size: 319 bytes --]

The append  of listify-key-sequence works without any lisp errors, but
sadly it appears to not exit the repeat whereas pushing a raw 7 (rather
than a '(7) ) appears to work with respect to disabling the repeat.

-- 

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
7©4 Id: kg:/m/0285kf1  •0Ü8



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

* Re: keymap.el and its checks
  2022-10-03  1:15   ` T.V Raman
@ 2022-10-03  2:52     ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2022-10-03  2:52 UTC (permalink / raw)
  To: T.V Raman; +Cc: emacs-devel

T.V Raman [2022-10-02 18:15:50] wrote:
> The append  of listify-key-sequence works without any lisp errors, but
> sadly it appears to not exit the repeat whereas pushing a raw 7 (rather
> than a '(7) ) appears to work with respect to disabling the repeat.

I think you still haven't understood that `unread-command-events`
contains a list of events.  Not a list of list of keys.
You have to use `append` (together with `setq`, presumably) *instead of*
`push`.


        Stefan




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

* Re: keymap.el and its checks
  2022-10-03  0:39 keymap.el and its checks T.V Raman
  2022-10-03  0:48 ` Stefan Monnier
@ 2022-10-03  6:58 ` Juri Linkov
  2022-10-03 12:50   ` Stefan Monnier
  1 sibling, 1 reply; 9+ messages in thread
From: Juri Linkov @ 2022-10-03  6:58 UTC (permalink / raw)
  To: T.V Raman; +Cc: emacs-devel

> I saw this change from Stefan:
> 570a11052b * keymap.el: Ease up support for non-`kbd` formats.
>
> and thought this would let me write
> (push repeat-exit-key unread-command-events)

BTW, repeat-exit-key could support `kbd` format as well after changing
its customization type to:

  :type '(choice (const :tag "No special key to exit repeating sequence" nil)
                 (string :tag "Kbd string that exits repeating sequence")
                 (key-sequence :tag "Key that exits repeating sequence"))

This assumes that `key-sequence` can't be a string.

After that you could use (key-parse repeat-exit-key) to append it
to unread-command-events.



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

* Re: keymap.el and its checks
  2022-10-03  6:58 ` Juri Linkov
@ 2022-10-03 12:50   ` Stefan Monnier
  2022-10-03 19:57     ` Juri Linkov
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2022-10-03 12:50 UTC (permalink / raw)
  To: Juri Linkov; +Cc: T.V Raman, emacs-devel

Juri Linkov [2022-10-03 09:58:56] wrote:

>> I saw this change from Stefan:
>> 570a11052b * keymap.el: Ease up support for non-`kbd` formats.
>>
>> and thought this would let me write
>> (push repeat-exit-key unread-command-events)
>
> BTW, repeat-exit-key could support `kbd` format as well after changing
> its customization type to:
>
>   :type '(choice (const :tag "No special key to exit repeating sequence" nil)
>                  (string :tag "Kbd string that exits repeating sequence")
>                  (key-sequence :tag "Key that exits repeating sequence"))
>
> This assumes that `key-sequence` can't be a string.

`key-sequence` can definitely be a string.

> After that you could use (key-parse repeat-exit-key) to append it
> to unread-command-events.

`key-parse` returns a ... key-sequence, so it's of no help to Raman's
"problem".


        Stefan




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

* Re: keymap.el and its checks
  2022-10-03 12:50   ` Stefan Monnier
@ 2022-10-03 19:57     ` Juri Linkov
  2022-10-03 20:48       ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Juri Linkov @ 2022-10-03 19:57 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: T.V Raman, emacs-devel

>> BTW, repeat-exit-key could support `kbd` format as well after changing
>> its customization type to:
>>
>>   :type '(choice (const :tag "No special key to exit repeating sequence" nil)
>>                  (string :tag "Kbd string that exits repeating sequence")
>>                  (key-sequence :tag "Key that exits repeating sequence"))
>>
>> This assumes that `key-sequence` can't be a string.
>
> `key-sequence` can definitely be a string.

This means they can be used together.  So I just replaced
`key-sequence` with `key`, and added backward-compatibility code.

>> After that you could use (key-parse repeat-exit-key) to append it
>> to unread-command-events.
>
> `key-parse` returns a ... key-sequence, so it's of no help to Raman's
> "problem".

I believe the new function repeat-exit will help Raman in another way.



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

* Re: keymap.el and its checks
  2022-10-03 19:57     ` Juri Linkov
@ 2022-10-03 20:48       ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2022-10-03 20:48 UTC (permalink / raw)
  To: Juri Linkov; +Cc: T.V Raman, emacs-devel

>>> After that you could use (key-parse repeat-exit-key) to append it
>>> to unread-command-events.
>>
>> `key-parse` returns a ... key-sequence, so it's of no help to Raman's
>> "problem".
>
> I believe the new function repeat-exit will help Raman in another way.

Yes, that looks like a more straightforward solution that messing around
with `unread-command-events` or changing timers's deadlines.


        Stefan




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

end of thread, other threads:[~2022-10-03 20:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-03  0:39 keymap.el and its checks T.V Raman
2022-10-03  0:48 ` Stefan Monnier
2022-10-03  1:10   ` T.V Raman
2022-10-03  1:15   ` T.V Raman
2022-10-03  2:52     ` Stefan Monnier
2022-10-03  6:58 ` Juri Linkov
2022-10-03 12:50   ` Stefan Monnier
2022-10-03 19:57     ` Juri Linkov
2022-10-03 20:48       ` Stefan Monnier

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