Subject: [PATCH] ; Fix push-button when triggered by a single keypress
From: Steven Allen <[email-masked]>
To: [email-masked]
Date: Fri, 25 Aug 2023 10:48:01 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

The following code was broken in the recent android merge:

    (keymap-set button-map "<return>" 'push-button)

The attached patch fixes this.

From c6270b325e322d5fc2c2eafba2661d7bc82ad47f Mon Sep 17 00:00:00 2001
From: Steven Allen <[email-masked]>
Date: Fri, 25 Aug 2023 10:43:43 -0700
Subject: [PATCH] ; Fix push-button when triggered by a single keypress

* lisp/button.el (push-button): don't assume the event is a list, it may
be a single key.
---
 lisp/button.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/button.el b/lisp/button.el
index b01595943fc..bfe6ccc8d1f 100644
--- a/lisp/button.el
+++ b/lisp/button.el
@@ -492,7 +492,7 @@ push-button
 	    (if str-button
 	        ;; mode-line, header-line, or display string event.
 	        (button-activate str t)
-              (if (eq (car pos) 'touchscreen-down)
+              (if (eq (car-safe pos) 'touchscreen-down)
                   ;; If touch-screen-track tap returns nil, then the
                   ;; tap was cancelled.
                   (when (touch-screen-track-tap pos)
-- 
2.42.0