Fix "C-h k" and "C-h c" with Paste from Kill Menu

* lisp/subr.el (event-basic-type, event-modifiers): Return nil if
EVENT is a string.  (Bug#62626)
This commit is contained in:
Eli Zaretskii 2023-04-08 15:36:44 +03:00
parent b36c21e27d
commit b63a9eda01

View file

@ -1520,6 +1520,7 @@ EVENT may be an event or an event type. If EVENT is a symbol
that has never been used in an event that has been read as input
in the current Emacs session, then this function may fail to include
the `click' modifier."
(unless (stringp event)
(let ((type event))
(if (listp type)
(setq type (car type)))
@ -1544,7 +1545,7 @@ the `click' modifier."
(push 'super list))
(or (zerop (logand type ?\A-\0))
(push 'alt list))
list))))
list)))))
(defun event-basic-type (event)
"Return the basic type of the given event (all modifiers removed).
@ -1552,6 +1553,7 @@ The value is a printing character (not upper case) or a symbol.
EVENT may be an event or an event type. If EVENT is a symbol
that has never been used in an event that has been read as input
in the current Emacs session, then this function may return nil."
(unless (stringp event)
(if (consp event)
(setq event (car event)))
(if (symbolp event)
@ -1562,7 +1564,7 @@ in the current Emacs session, then this function may return nil."
;; cause `downcase' to get an error.
(condition-case ()
(downcase uncontrolled)
(error uncontrolled)))))
(error uncontrolled))))))
(defsubst mouse-movement-p (object)
"Return non-nil if OBJECT is a mouse movement event."