From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Ponce via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70682: 30.0.50; wrong-type-argument error on widget-button--check-and-call-button Date: Tue, 30 Apr 2024 21:18:05 +0200 Message-ID: Reply-To: David Ponce Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20243"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Po Lu To: 70682@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 30 21:19:12 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s1t0R-00054n-WB for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Apr 2024 21:19:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1t00-00019m-Fr; Tue, 30 Apr 2024 15:18:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1szx-00018o-VR for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2024 15:18:41 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1szx-0002cj-FL for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2024 15:18:41 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s1t0H-0007hi-Qm for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2024 15:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Ponce Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Apr 2024 19:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70682 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.171450473729602 (code B ref -1); Tue, 30 Apr 2024 19:19:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Apr 2024 19:18:57 +0000 Original-Received: from localhost ([127.0.0.1]:32792 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1t0B-0007hM-Ds for submit@debbugs.gnu.org; Tue, 30 Apr 2024 15:18:57 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:41574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1szv-0007gu-AR for submit@debbugs.gnu.org; Tue, 30 Apr 2024 15:18:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1szU-00013H-OG for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2024 15:18:12 -0400 Original-Received: from smtp-22.smtpout.orange.fr ([80.12.242.22] helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1szR-0002YZ-Um for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2024 15:18:12 -0400 Original-Received: from [192.168.1.15] ([2.7.71.181]) by smtp.orange.fr with ESMTPA id 1szNsGHZO9Rhy1szNs6MTY; Tue, 30 Apr 2024 21:18:06 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr; s=t20230301; t=1714504686; bh=XzpZlfFVFgNdynokzsfSH29fNsvPhup0gz5yZp9rYaw=; h=Message-ID:Date:MIME-Version:To:From:Subject; b=n23vL2y03t4Dx+sqHVpHDkjDTYPzwAUOZzwQpEsn5ZU+csbvl4obhTOOdHXmuN72K zmA/ZPUOCmNtHhLH3UwDJxVb7qkXqKMFmBGUTa/eKkhrsCPWJFXBLDFDY9jN9SmwvL eRtof1lKvNP+RlnL8VzA6EzNSdJhHDBkiQPXA7f1+MPHkZKxVCa0km0ssefRrn5jEq T+zFX0cYooDHJcT6wiTz0RVOfiEPIvW+ieNAuI5ikvk72PnBjn/FMKT7WetMtgBEbk zaLYDQ07vkNloT2EIxQEG+13CFRa9HtRoxwkcfzU3kyfQ/H2TagmhZL5E4dwHjYjer BZbZFPVYaqCiw== X-ME-Helo: [192.168.1.15] X-ME-Auth: ZGFfdmlkQHdhbmFkb28uZnI= X-ME-Date: Tue, 30 Apr 2024 21:18:06 +0200 X-ME-IP: 2.7.71.181 Content-Language: fr, en-US Received-SPF: pass client-ip=80.12.242.22; envelope-from=da_vid@orange.fr; helo=smtp.smtpout.orange.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284226 Archived-At: 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 (# 3 (29 . 11) 20874080 nil 3 (2 . 0) nil (5 . 11) (12 . 26))) (push-button :tag "TEST" :action test-widget-button-press :button-overlay # :from # :to #)) widget-button-click((down-mouse-1 (# 3 (29 . 11) 20874080 nil 3 (2 . 0) nil (5 . 11) (12 . 26)))) funcall-interactively(widget-button-click (down-mouse-1 (# 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 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