unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: bug#58799: Make winner key sequences repeatable in repeat-mode
       [not found]                     ` <CADwFkmmftfd1=qkM-tMorNWh2F5KsoQtKiqpKwB0tre1g_UJTg@mail.gmail.com>
@ 2022-10-31 15:09                       ` Robert Pluim
  2022-10-31 15:28                         ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Pluim @ 2022-10-31 15:09 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Lars Ingebrigtsen, emacs-devel

(redirecting to emacs-devel)
>>>>> On Mon, 31 Oct 2022 07:47:36 -0700, Stefan Kangas <stefankangas@gmail.com> said:

    Stefan> close 58799 29.1
    Stefan> thanks

    Stefan> Robert Pluim <rpluim@gmail.com> writes:

    >> In any case, I think we can close this particular bug.

    Stefan> Agreed.  Now done.

So the minimal change I think is this:

diff --git c/lisp/keymap.el i/lisp/keymap.el
index 107565590c..750095fab4 100644
--- c/lisp/keymap.el
+++ i/lisp/keymap.el
@@ -545,6 +545,10 @@ define-keymap
           (let ((def (pop definitions)))
             (if (eq key :menu)
                 (easy-menu-define nil keymap "" def)
+              (unless (key-valid-p key)
+                (error
+                 "Key '%s' in keymap '%s' is not `key-valid-p'"
+                 key keymap))
               (if (member key seen-keys)
                   (error "Duplicate definition for key: %S %s" key keymap)
                 (push key seen-keys))

which will give a run-time error for things like "[left]" and
'[left]', but thatʼs redundant with the compile time warning:

    make[3]: Entering directory '/home/rpluim/repos/emacs/lispʼ
      ELC      winner.elc

    In toplevel form:
    winner.el:314:15: Warning: Invalid ‘kbd’ syntax: "[left]"

Eli? Lars? Is this overkill for such a rare case?

Robert
-- 



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

* Re: bug#58799: Make winner key sequences repeatable in repeat-mode
  2022-10-31 15:09                       ` bug#58799: Make winner key sequences repeatable in repeat-mode Robert Pluim
@ 2022-10-31 15:28                         ` Eli Zaretskii
  2022-10-31 15:42                           ` Robert Pluim
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2022-10-31 15:28 UTC (permalink / raw)
  To: Robert Pluim; +Cc: stefankangas, larsi, emacs-devel

> From: Robert Pluim <rpluim@gmail.com>
> Cc: Lars Ingebrigtsen <larsi@gnus.org>,  emacs-devel@gnu.org
> Date: Mon, 31 Oct 2022 16:09:54 +0100
> 
> diff --git c/lisp/keymap.el i/lisp/keymap.el
> index 107565590c..750095fab4 100644
> --- c/lisp/keymap.el
> +++ i/lisp/keymap.el
> @@ -545,6 +545,10 @@ define-keymap
>            (let ((def (pop definitions)))
>              (if (eq key :menu)
>                  (easy-menu-define nil keymap "" def)
> +              (unless (key-valid-p key)
> +                (error
> +                 "Key '%s' in keymap '%s' is not `key-valid-p'"
> +                 key keymap))
>                (if (member key seen-keys)
>                    (error "Duplicate definition for key: %S %s" key keymap)
>                  (push key seen-keys))
> 
> which will give a run-time error for things like "[left]" and
> '[left]', but thatʼs redundant with the compile time warning:
> 
>     make[3]: Entering directory '/home/rpluim/repos/emacs/lispʼ
>       ELC      winner.elc
> 
>     In toplevel form:
>     winner.el:314:15: Warning: Invalid ‘kbd’ syntax: "[left]"
> 
> Eli? Lars? Is this overkill for such a rare case?

I don't know.  I guess it depends on how many people will be tripped
by this.  The change itself is small enough, I think.



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

* Re: bug#58799: Make winner key sequences repeatable in repeat-mode
  2022-10-31 15:28                         ` Eli Zaretskii
@ 2022-10-31 15:42                           ` Robert Pluim
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Pluim @ 2022-10-31 15:42 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: stefankangas, larsi, emacs-devel

>>>>> On Mon, 31 Oct 2022 17:28:18 +0200, Eli Zaretskii <eliz@gnu.org> said:
    >> make[3]: Entering directory '/home/rpluim/repos/emacs/lispʼ
    >> ELC      winner.elc
    >> 
    >> In toplevel form:
    >> winner.el:314:15: Warning: Invalid ‘kbd’ syntax: "[left]"
    >> 
    >> Eli? Lars? Is this overkill for such a rare case?

    Eli> I don't know.  I guess it depends on how many people will be tripped
    Eli> by this.  The change itself is small enough, I think.

0, it turns out, as thereʼs already a runtime check for this case 😀
Motto: test the existing code before proposing changes

Robert
-- 



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

end of thread, other threads:[~2022-10-31 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87y1t2zl1s.fsf@cassou.me>
     [not found] ` <CADwFkmmdOfeQ5ewESoZbXk6g=gXQGu9RBx=DjwUv1Mv74saTOw@mail.gmail.com>
     [not found]   ` <87fsf9vdr6.fsf@gmail.com>
     [not found]     ` <CADwFkmmR-dGnudqdMx=Sa6kC-5Xfi8fg8tr0jX232gMXJeNz0g@mail.gmail.com>
     [not found]       ` <87v8o5ts06.fsf@gmail.com>
     [not found]         ` <CADwFkmk63iJ-eg0xLKGSo3s_pMQNk7BxoaMS1xfrO9ez8+Cn1w@mail.gmail.com>
     [not found]           ` <87lep1tmie.fsf@gmail.com>
     [not found]             ` <CADwFkmkhxO+aKWR5PrCqcQtGC8LFFVgKSy0OvC2JYRdn3p-tMA@mail.gmail.com>
     [not found]               ` <871qqss31s.fsf@gmail.com>
     [not found]                 ` <CADwFkm=ws9xrL70khgjT4K_uqSBRgbb+GRY=PBfWX8YeOhgTMQ@mail.gmail.com>
     [not found]                   ` <87a65coytd.fsf@gmail.com>
     [not found]                     ` <CADwFkmmftfd1=qkM-tMorNWh2F5KsoQtKiqpKwB0tre1g_UJTg@mail.gmail.com>
2022-10-31 15:09                       ` bug#58799: Make winner key sequences repeatable in repeat-mode Robert Pluim
2022-10-31 15:28                         ` Eli Zaretskii
2022-10-31 15:42                           ` Robert Pluim

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