Exit macro definition on undefined keys

* lisp/subr.el (undefined): Error out of kmacro definition, if any.
(Bug#28008)

Copyright-paperwork-exempt: yes
This commit is contained in:
Allen Li 2017-09-30 16:46:48 +03:00 committed by Eli Zaretskii
parent 289fe6c0d1
commit f172894595

View file

@ -785,8 +785,9 @@ This is the same format used for saving keyboard macros (see
"Beep to tell the user this binding is undefined." "Beep to tell the user this binding is undefined."
(interactive) (interactive)
(ding) (ding)
(message "%s is undefined" (key-description (this-single-command-keys))) (if defining-kbd-macro
(setq defining-kbd-macro nil) (error "%s is undefined" (key-description (this-single-command-keys)))
(message "%s is undefined" (key-description (this-single-command-keys))))
(force-mode-line-update) (force-mode-line-update)
;; If this is a down-mouse event, don't reset prefix-arg; ;; If this is a down-mouse event, don't reset prefix-arg;
;; pass it to the command run by the up event. ;; pass it to the command run by the up event.