emacs-31 d48977dea85: src/keyboard.c (Finsert_special_event): Don't ignore unknown events

Stefan Monnier via Mailing list for Emacs changes <[email protected]>
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: emacs-31
commit d48977dea8521aacaead07503047c63f3a17e542
Author: Stefan Monnier <[email protected]>
Commit: Stefan Monnier <[email protected]>

    src/keyboard.c (Finsert_special_event): Don't ignore unknown events
---
 src/keyboard.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/keyboard.c b/src/keyboard.c
index 6f0b5fbb2ec..0c6c36319b3 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -12100,7 +12100,11 @@ Only 'input_event' slots KIND and ARG are set.  */)
   CHECK_CONS (event);
   if (NILP (access_keymap
 	    (get_keymap (Vspecial_event_map, 0, 1), event, 0, 0, 1)))
-    signal_error ("Invalid event kind", XCAR (event));
+    /* FIXME: Remove this check.  Since `special-event-map` may change
+       between now and the moment we process the event, this check is
+       unreliable, and it's redundant anyway since we check below
+       if EVENT is one of the supported ones.  */
+    signal_error ("Invalid special event kind", XCAR (event));
 
   /* Construct an input event.  */
   struct input_event ie;
@@ -12137,7 +12141,7 @@ Only 'input_event' slots KIND and ARG are set.  */)
      : EQ (XCAR (event), Qfocus_out) ? FOCUS_OUT_EVENT
      : EQ (XCAR (event), Qmove_frame) ? MOVE_FRAME_EVENT
      : EQ (XCAR (event), Qsleep_event) ? SLEEP_EVENT
-     : NO_EVENT);
+     : (signal_error ("Invalid special event kind", XCAR (event)), NO_EVENT));
   ie.frame_or_window = Qnil;
   ie.arg = CDR (event);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.