- (if (= (aref (this-command-keys) 0) ?\M-x)
- (princ "You have invoked the disabled command ")
- (princ "You have typed ")
- (princ (key-description (this-command-keys)))
- (princ ", invoking disabled command "))
+ (let ((keys (this-command-keys)))
+ (if (or (eq (aref keys 0)
+ (if (stringp keys)
+ (aref "\M-x" 0)
+ ?\M-x))
+ (and (>= (length keys) 2)
+ (eq (aref keys 0) meta-prefix-char)
+ (eq (aref keys 1) ?x)))
+ (princ "You have invoked the disabled command ")
+ (princ "You have typed ")
+ (princ (key-description keys))
+ (princ ", invoking disabled command ")))