GNU bug report logs - #70682
30.0.50; wrong-type-argument error on widget-button--check-and-call-button

Previous Next

Package: emacs;

Reported by: David Ponce <da_vid <at> orange.fr>

Date: Tue, 30 Apr 2024 19:19:01 UTC

Severity: normal

Found in version 30.0.50

Done: Po Lu <luangruo <at> yahoo.com>

To reply to this bug, email your comments to 70682 AT debbugs.gnu.org.
There is no need to reopen the bug first.

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#70682; Package emacs. (Tue, 30 Apr 2024 19:19:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to David Ponce <da_vid <at> orange.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 30 Apr 2024 19:19:01 GMT) Full text and rfc822 format available.

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

From: David Ponce <da_vid <at> orange.fr>
To: bug-gnu-emacs <at> gnu.org
Cc: Po Lu <luangruo <at> yahoo.com>
Subject: 30.0.50; wrong-type-argument error on
 widget-button--check-and-call-button
Date: Tue, 30 Apr 2024 21:18:05 +0200
Hello,

I sometimes encounter the below error when I click on a push-button widget.
Here is an example.

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p t)
  widget-button--check-and-call-button((down-mouse-1 (#<window 16 on test-widget-button-click> 3 (29 . 11) 20874080 nil 3 (2 . 0) nil (5 . 11) (12 . 26))) (push-button :tag "TEST" :action test-widget-button-press :button-overlay #<overlay from 1 to 7 in test-widget-button-click> :from #<marker (moves after insertion) at 1 in test-widget-button-click> :to #<marker at 7 in test-widget-button-click>))
  widget-button-click((down-mouse-1 (#<window 16 on test-widget-button-click> 3 (29 . 11) 20874080 nil 3 (2 . 0) nil (5 . 11) (12 . 26))))
  funcall-interactively(widget-button-click (down-mouse-1 (#<window 16 on test-widget-button-click> 3 (29 . 11) 20874080 nil 3 (2 . 0) nil (5 . 11) (12 . 26))))
  call-interactively(widget-button-click nil nil)
  command-execute(widget-button-click)

It seems the problem is due to this commit:

author	Po Lu <luangruo <at> yahoo.com>	2024-04-16 15:38:53 +0800
commit	f5e0fb11dbf4d2cc5d7ceabcec7600556fb12843 (patch)

Fix touch screen hscroll when initiated from widgets
* lisp/wid-edit.el (widget-button--check-and-call-button):
Return to the position of point during the tracking loop if a
touch event is canceled.


The issue is that on some cases the below catch statement (line 1109),
whose value now set the variable newpoint, returns t instead of a valid
buffer position:

    (setq newpoint
          (catch 'button-press-cancelled
    ...
      
The culprit is at line 1156:

                              (while (not (widget-button-release-event-p event))
                                (setq event (read--potential-mouse-event))
                                (when (and mouse-1 (mouse-movement-p event))
                                  (push event unread-command-events)
                                  (setq event oevent)
                                  (throw 'button-press-cancelled t)) <<<<<<<<<

The below simple patch fixed the issue for me:

diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 2d82fbe7c89..3b467434d29 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -1153,7 +1153,7 @@ widget-button--check-and-call-button
                                 (when (and mouse-1 (mouse-movement-p event))
                                   (push event unread-command-events)
                                   (setq event oevent)
-                                  (throw 'button-press-cancelled t))
+                                  (throw 'button-press-cancelled nil))
                                 (unless (or (integerp event)
                                             (memq (car event)
                                                   '(switch-frame select-window))


Thanks!

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.41, cairo version 1.18.0) of 2024-04-30
Repository revision: b36fd07560fd12c5e819e808a6f0eb9579f77c25
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Fedora Linux 39 (KDE Plasma)

Configured using:
 'configure --prefix=/home/dponce --with-x-toolkit=gtk3 --with-cairo-xcb
 --with-native-compilation=no
 PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LC_TIME: fr_FR.utf8
  value of $LANG: fr_FR.UTF-8
  locale-coding-system: utf-8-unix




Reply sent to Po Lu <luangruo <at> yahoo.com>:
You have taken responsibility. (Wed, 01 May 2024 00:55:01 GMT) Full text and rfc822 format available.

Notification sent to David Ponce <da_vid <at> orange.fr>:
bug acknowledged by developer. (Wed, 01 May 2024 00:55:02 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: David Ponce <da_vid <at> orange.fr>
Cc: 70682-done <at> debbugs.gnu.org
Subject: Re: 30.0.50; wrong-type-argument error on
 widget-button--check-and-call-button
Date: Wed, 01 May 2024 08:53:24 +0800
David Ponce <da_vid <at> orange.fr> writes:

> Hello,
>
> I sometimes encounter the below error when I click on a push-button widget.
> Here is an example.

Thanks, fixed.  In future, please don't CC people directly in messages
to the bug tracker, but use the X-Debbugs-Cc header instead, so that the
bug tracker may deliver a properly adjusted message to all recipients.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70682; Package emacs. (Wed, 01 May 2024 07:07:02 GMT) Full text and rfc822 format available.

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

From: David Ponce <da_vid <at> orange.fr>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 70682-done <at> debbugs.gnu.org
Subject: Re: 30.0.50; wrong-type-argument error on
 widget-button--check-and-call-button
Date: Wed, 1 May 2024 09:06:26 +0200
On 01/05/2024 02:53, Po Lu wrote:
> David Ponce <da_vid <at> orange.fr> writes:
> 
>> Hello,
>>
>> I sometimes encounter the below error when I click on a push-button widget.
>> Here is an example.
> 
> Thanks, fixed.  In future, please don't CC people directly in messages
> to the bug tracker, but use the X-Debbugs-Cc header instead, so that the
> bug tracker may deliver a properly adjusted message to all recipients.

Sorry, I didn't know about the X-Debbugs-Cc header.  Do you know if possible
to use X-Debbugs-Cc header with Thunderbird?

Thank you!





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70682; Package emacs. (Wed, 01 May 2024 07:17:01 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: David Ponce <da_vid <at> orange.fr>
Cc: 70682-done <at> debbugs.gnu.org
Subject: Re: 30.0.50; wrong-type-argument error on
 widget-button--check-and-call-button
Date: Wed, 01 May 2024 15:15:53 +0800
David Ponce <da_vid <at> orange.fr> writes:

> Sorry, I didn't know about the X-Debbugs-Cc header.  Do you know if possible
> to use X-Debbugs-Cc header with Thunderbird?

I think so, by editing an option in about:config.  But not having used
Thunderbird in years, I can't speak as to whether Mozilla have decided
to remove this option in the meantime, nor as to its name.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70682; Package emacs. (Wed, 01 May 2024 08:11:01 GMT) Full text and rfc822 format available.

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

From: David Ponce <da_vid <at> orange.fr>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 70682-done <at> debbugs.gnu.org
Subject: Re: 30.0.50; wrong-type-argument error on
 widget-button--check-and-call-button
Date: Wed, 1 May 2024 10:09:55 +0200
On 01/05/2024 09:06, David Ponce wrote:
> On 01/05/2024 02:53, Po Lu wrote:
>> David Ponce <da_vid <at> orange.fr> writes:
>>
>>> Hello,
>>>
>>> I sometimes encounter the below error when I click on a push-button widget.
>>> Here is an example.
>>
>> Thanks, fixed.  In future, please don't CC people directly in messages
>> to the bug tracker, but use the X-Debbugs-Cc header instead, so that the
>> bug tracker may deliver a properly adjusted message to all recipients.
> 
> Sorry, I didn't know about the X-Debbugs-Cc header.  Do you know if possible
> to use X-Debbugs-Cc header with Thunderbird?
> 
> Thank you!
> 

Thank you!  I found how to do :-)

Thunderbird > Preferences > General > Config Editor

Search for 'mail.compose.other.header' and select it,
then add the string "X-Debbugs-CC" in the Enter string value dialog box
(separate multiple headers with commas).
   
When composing a message, select the double arrows (>>) in the address field,
then select the X-Debbugs-CC custom header and enter the CCd email addresses.




This bug report was last modified 17 days ago.

Previous Next


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