From: Po Lu Date: Thu, 17 Aug 2023 07:27:14 +0000 (+0000) Subject: Fix earlier change in subr.el X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c1a45041d66fc479f9b7b94475236d1c2d5001fe;p=emacs.git Fix earlier change in subr.el * lisp/subr.el (event-start, event-end): Don't take the car of EVENT if it's not an event with parameters. --- diff --git a/lisp/subr.el b/lisp/subr.el index f6bf7988e9d..51545fb5f11 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1676,8 +1676,9 @@ nil or (STRING . POSITION)'. For more information, see Info node `(elisp)Click Events'." (declare (side-effect-free t)) - (if (or (eq (car event) 'touchscreen-begin) - (eq (car event) 'touchscreen-end)) + (if (and (consp event) + (or (eq (car event) 'touchscreen-begin) + (eq (car event) 'touchscreen-end))) ;; Touch screen begin and end events save their information in a ;; different format, where the mouse position list is the cdr of ;; (nth 1 event). @@ -1695,8 +1696,9 @@ EVENT should be a click, drag, touch screen, or key press event. See `event-start' for a description of the value returned." (declare (side-effect-free t)) - (if (or (eq (car event) 'touchscreen-begin) - (eq (car event) 'touchscreen-end)) + (if (and (consp event) + (or (eq (car event) 'touchscreen-begin) + (eq (car event) 'touchscreen-end))) (cdadr event) (or (and (consp event) (not (eq (car event) 'touchscreen-update))