From: Stefan Monnier Date: Wed, 26 Oct 2016 19:29:02 +0000 (-0400) Subject: * lisp/subr.el (set-transient-map): Exit for unbound events (bug#24755). X-Git-Tag: emacs-25.1.90~75 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9c1cb8d;p=emacs.git * lisp/subr.el (set-transient-map): Exit for unbound events (bug#24755). --- diff --git a/lisp/subr.el b/lisp/subr.el index 573f238f743..07909b894f5 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4507,8 +4507,10 @@ to deactivate this transient map, regardless of KEEP-PRED." ;; exit C-u. t) ((eq t keep-pred) - (eq this-command - (lookup-key map (this-command-keys-vector)))) + (let ((mc (lookup-key map (this-command-keys-vector)))) + ;; If the key is unbound `this-command` is + ;; nil and so is `mc`. + (and mc (eq this-command mc)))) (t (funcall keep-pred))) (funcall exitfun))))) (add-hook 'pre-command-hook clearfun)