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 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 in the current Emacs session, then this function may fail to include
the `click' modifier." the `click' modifier."
(unless (stringp event)
(let ((type event)) (let ((type event))
(if (listp type) (if (listp type)
(setq type (car type))) (setq type (car type)))
@ -1544,7 +1545,7 @@ the `click' modifier."
(push 'super list)) (push 'super list))
(or (zerop (logand type ?\A-\0)) (or (zerop (logand type ?\A-\0))
(push 'alt list)) (push 'alt list))
list)))) list)))))
(defun event-basic-type (event) (defun event-basic-type (event)
"Return the basic type of the given event (all modifiers removed). "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 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 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." in the current Emacs session, then this function may return nil."
(unless (stringp event)
(if (consp event) (if (consp event)
(setq event (car event))) (setq event (car event)))
(if (symbolp 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. ;; cause `downcase' to get an error.
(condition-case () (condition-case ()
(downcase uncontrolled) (downcase uncontrolled)
(error uncontrolled))))) (error uncontrolled))))))
(defsubst mouse-movement-p (object) (defsubst mouse-movement-p (object)
"Return non-nil if OBJECT is a mouse movement event." "Return non-nil if OBJECT is a mouse movement event."