emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66192: closed (30.0.50; lisp/buttons.el (push-button) fails to handl


From: GNU bug Tracking System
Subject: bug#66192: closed (30.0.50; lisp/buttons.el (push-button) fails to handle the <return> action on gui emacs)
Date: Tue, 26 Sep 2023 11:39:02 +0000

Your message dated Tue, 26 Sep 2023 04:38:04 -0700
with message-id 
<CADwFkmnZzqSR3GTKQB+8rzoLqkSPFMHnpuZPa6NdE_2YsLut_g@mail.gmail.com>
and subject line Re: bug#66192: 30.0.50; lisp/buttons.el (push-button) fails to 
handle the <return> action on gui emacs
has caused the debbugs.gnu.org bug report #66192,
regarding 30.0.50; lisp/buttons.el (push-button) fails to handle the <return> 
action on gui emacs
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
66192: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66192
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 30.0.50; lisp/buttons.el (push-button) fails to handle the <return> action on gui emacs Date: Mon, 25 Sep 2023 20:40:20 +0530 (IST)
* commit a496509cedb17109d0e6297a74e2ff8ed526333c
|Commit:     Po Lu <luangruo@yahoo.com>
|CommitDate: Thu Jan 19 22:19:06 2023 +0800

Introduced a change to lisp/button.el:(push-button) which causes the
following recipe to fail. Consider a buffer with the following
contents:

```
;;text-button

(defvar-keymap my-button-map :parent button-map "<return>" 'push-button)
(setq $but (make-text-button 1 10
                             'action #'(lambda(b) (message "push-button %S" b))
                             'keymap my-button-map))
```

evaluating the buffer sets up a text button in the first line. In a gui
emacs Hitting RET on the button fails with an error:
        "push-button: Wrong type argument: listp, return".

The following patch fixes it for me but maybe there is some other issue?
>From e69be9cf0af72c5fcda8cda05b50a556741009b2 Mon Sep 17 00:00:00 2001
From: Madhu <enometh@net.meer>
Date: Mon, 25 Sep 2023 20:20:05 +0530
Subject: [PATCH] lisp/button.el: (push-button): handle kbd <return>

---
 lisp/button.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/button.el b/lisp/button.el
index b01595943fc..0e98ec722d9 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 (and (listp pos) (eq (car pos) 'touchscreen-down))
                   ;; If touch-screen-track tap returns nil, then the
                   ;; tap was cancelled.
                   (when (touch-screen-track-tap pos)
-- 
2.39.2.101.g768bb238c4


--- End Message ---
--- Begin Message --- Subject: Re: bug#66192: 30.0.50; lisp/buttons.el (push-button) fails to handle the <return> action on gui emacs Date: Tue, 26 Sep 2023 04:38:04 -0700
Madhu <enometh@meer.net> writes:

> Yes it's fixed, please close.

Done.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]