diff lisp/cmdloop.el @ 5861:c87b776ab0e1

Create a new error for when a char is needed but event-to-character gives nil lisp/ChangeLog addition: 2015-03-14 Aidan Kehoe <kehoea@parhasard.net> * cmdloop.el (no-character-typed): New error, for those cases when a keystroke is to be treated as a character but has no character equivalent. * cmdloop.el (read-char-1): Use it. * keymap.el (synthesize-keysym): Use it. src/ChangeLog addition: 2015-03-14 Aidan Kehoe <kehoea@parhasard.net> * general-slots.h (Qno_character_typed): New error symbol. * event-stream.c (syms_of_event_stream): Define it. New error, for those cases when a keystroke is to be treated as a character in some context but has no character equivalent. * cmds.c (Fself_insert_command): Use it.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 14 Mar 2015 01:40:49 +0000
parents 0e9f791cc655
children f9e59cd39a9a
line wrap: on
line diff
--- a/lisp/cmdloop.el	Sat Mar 14 01:16:45 2015 +0000
+++ b/lisp/cmdloop.el	Sat Mar 14 01:40:49 2015 +0000
@@ -280,6 +280,10 @@
          (princ (gettext " not defined.") stream) ; doo dah, doo dah.
          ))
 
+(put 'no-character-typed 'display-error
+     #'(lambda (error-object stream)
+         (write-sequence "Not a character keystroke, " stream)
+         (write-sequence (key-description (cadr error-object)) stream)))
 
 (defcustom teach-extended-commands-p t
   "*If true, then `\\[execute-extended-command]' will teach you keybindings.
@@ -593,8 +597,7 @@
                                     (aref (cdr binding) (caar binding)))))))
                       (return-from read-char-1 character)))
                 (if errorp
-                    (error 'invalid-key-binding "Not a character keystroke"
-                           (aref events 0)))
+                    (error 'no-character-typed (aref events 0)))
                 ;; If we're not erroring, loop until we get a character
                 (setq events []))
            (if timeout (disable-timeout timeout))))))