GNU bug report logs - #66192
30.0.50; lisp/buttons.el (push-button) fails to handle the <return> action on gui emacs

Previous Next

Package: emacs;

Reported by: Madhu <enometh <at> meer.net>

Date: Mon, 25 Sep 2023 15:12:02 UTC

Severity: normal

Found in version 30.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 66192 in the body.
You can then email your comments to 66192 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#66192; Package emacs. (Mon, 25 Sep 2023 15:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Madhu <enometh <at> meer.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 25 Sep 2023 15:12:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Madhu <enometh <at> meer.net>
To: bug-gnu-emacs <at> gnu.org
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)
[Message part 1 (text/plain, inline)]
* commit a496509cedb17109d0e6297a74e2ff8ed526333c
|Commit:     Po Lu <luangruo <at> 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?
[0001-lisp-button.el-push-button-handle-kbd-return.patch (text/x-patch, inline)]
From e69be9cf0af72c5fcda8cda05b50a556741009b2 Mon Sep 17 00:00:00 2001
From: Madhu <enometh <at> 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


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66192; Package emacs. (Tue, 26 Sep 2023 00:52:01 GMT) Full text and rfc822 format available.

Message #8 received at 66192 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Madhu <enometh <at> meer.net>
Cc: 66192 <at> debbugs.gnu.org
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 08:50:28 +0800
Madhu <enometh <at> meer.net> writes:

> * commit a496509cedb17109d0e6297a74e2ff8ed526333c
> |Commit:     Po Lu <luangruo <at> 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 <at> 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)

Thanks, but I elected to fix this differently.  Please test.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66192; Package emacs. (Tue, 26 Sep 2023 00:53:02 GMT) Full text and rfc822 format available.

Message #11 received at 66192 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Madhu <enometh <at> meer.net>
Cc: 66192 <at> debbugs.gnu.org
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 08:52:16 +0800
Please disregard my previous response.  Your Emacs appears to be out of
date, given that this was fixed in August.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66192; Package emacs. (Tue, 26 Sep 2023 01:37:01 GMT) Full text and rfc822 format available.

Message #14 received at 66192 <at> debbugs.gnu.org (full text, mbox):

From: Madhu <enometh <at> meer.net>
To: luangruo <at> yahoo.com
Cc: 66192 <at> debbugs.gnu.org
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 07:05:41 +0530 (IST)
Yes it's fixed, please close.

I did do go through the motions of doing a "git fetch" and "git log
origin/master -- lisp/button.el" to see if it had been fixed before
posting the report, but bungled it up.






Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Tue, 26 Sep 2023 11:39:02 GMT) Full text and rfc822 format available.

Notification sent to Madhu <enometh <at> meer.net>:
bug acknowledged by developer. (Tue, 26 Sep 2023 11:39:02 GMT) Full text and rfc822 format available.

Message #19 received at 66192-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Madhu <enometh <at> meer.net>, luangruo <at> yahoo.com
Cc: 66192-done <at> debbugs.gnu.org
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 <at> meer.net> writes:

> Yes it's fixed, please close.

Done.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 25 Oct 2023 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 241 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.