GNU bug report logs - #70594
30.0.50; Error when tabbing with only one active widget

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Stephen Berman <stephen.berman@HIDDEN>; dated Fri, 26 Apr 2024 12:45:09 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 70594 <at> debbugs.gnu.org:


Received: (at 70594) by debbugs.gnu.org; 9 May 2024 07:23:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 09 03:23:54 2024
Received: from localhost ([127.0.0.1]:53609 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s4y8A-00078K-0T
	for submit <at> debbugs.gnu.org; Thu, 09 May 2024 03:23:54 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:45414)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s4y88-00078E-7S
 for 70594 <at> debbugs.gnu.org; Thu, 09 May 2024 03:23:52 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1s4y7d-0007PX-17; Thu, 09 May 2024 03:23:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=Jy/XoAj/GUc3hpRk3QIJWubMDKeAflTA3NgQhNCvEwA=; b=oFV9IiaQXxzs
 hMTSJDlY6LMP1f6hMmRVyeq+giBOd1Ogi0cvgWhiaIUZ5gAZVnVandi7Ho2YGAk2gTLbDbshU1cht
 2CQ7MdKdUfRgR2Iz03Un5WDK6knMHoEyEBPSWbKnEZiTnxMQJ87H5s12D0jE55ogMmlZcx+To7kiO
 UfGXseP4TTR747xXytB37+WeVw2vfvgY1dIrH2vk0rRhkffS4xHZoX07qhf7UR5pqLStvGdrJEIie
 ulnL9542iurdjKJVaWUCq8FM2BN7lz0QQERRT2k84L99Zwkt2laiS5CUkz4QjnRFaNs50g2G9DZAK
 +lE+w2BRcEClf/GKGlLwNA==;
Date: Thu, 09 May 2024 10:23:13 +0300
Message-Id: <86y18j78ke.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: stephen.berman@HIDDEN, maurooaranda@HIDDEN
In-Reply-To: <86y190xj4a.fsf@HIDDEN> (message from Eli Zaretskii on Fri, 26
 Apr 2024 18:02:13 +0300)
Subject: Re: bug#70594: 30.0.50; Error when tabbing with only one active widget
References: <87r0esl2f5.fsf@HIDDEN> <86y190xj4a.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70594
Cc: 70594 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ping!

> Cc: 70594 <at> debbugs.gnu.org
> Date: Fri, 26 Apr 2024 18:02:13 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> > Date: Fri, 26 Apr 2024 14:43:42 +0200
> > From:  Stephen Berman via "Bug reports for GNU Emacs,
> >  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> > 
> > Commit 91333dacfa1, which adds the feature of optionally skipping over
> > inactive widgets when tabbing (bug#70413), fails to handle buffers that
> > contain only one active widget; in that case, pressing TAB or S-TAB
> > raises the error "No buttons or fields found".  To reproduce:
> > 
> > 0. emacs -Q
> > 1. Load the attached file widget-test.el and then type `M-x
> >    my-widget-test'.
> > 2. In the buffer "*My Widget Test*" repeatedly press TAB and S-TAB and
> >    observe that point moves successively between the active radio
> >    buttons labelled "One" and "Two" and the active push button "Submit",
> >    but skips the inactive push button "Reset", since the user option
> >    widget-skip-inactive is enabled.
> > 3. Now press (via RET or mouse-click) the "Submit" button, which makes
> >    the radio buttons and the "Submit" button inactive and the "Reset"
> >    button active.
> > 4. Pressing TAB once moves point to the "Reset" button, then pressing
> >    TAB again moves point to BOB and raises the error "No buttons or
> >    fields found".  Likewise, pressing S-TAB once moves point to "Reset",
> >    then pressing S-TAB again moves to EOB and raises the same error.
> > 
> > The attached patched fixes this bug.  In addition, when only one widget
> > is active and point is on it, since pressing TAB or S-TAB does not move
> > point, the informational message "Only one tabable widget" is displayed.
> > 
> > The original code in widget-move contained separate loops to handle
> > forward and backward movement and this involved some code duplication.
> > The changes to this code to fix the bug would have required further
> > duplication, so I took the opportunity to parameterize the
> > directionality, allowing handling both directions in a single loop.
> > This shortens the code and IMO makes the similarities and differences in
> > the handling easier to see.
> 
> Adding Mauro to the discussion.
> 
> 
> 
> 




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70594; Package emacs. Full text available.

Message received at 70594 <at> debbugs.gnu.org:


Received: (at 70594) by debbugs.gnu.org; 26 Apr 2024 15:02:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 26 11:02:45 2024
Received: from localhost ([127.0.0.1]:38213 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s0N63-0004H6-4w
	for submit <at> debbugs.gnu.org; Fri, 26 Apr 2024 11:02:45 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:60848)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s0N60-0004FO-Fv
 for 70594 <at> debbugs.gnu.org; Fri, 26 Apr 2024 11:02:41 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1s0N5b-0003IQ-KV; Fri, 26 Apr 2024 11:02:15 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=J9/agLaTXBrhMNdwqjeO74LKzGqnI3T5HxX8ID0ffpA=; b=LGN+PHnMWU/r
 oXK1GN0LB3qsV0CK8GcyARkvsp3VOtfGgb3GlBP33v+dQSu8kcysuJjZ1/3Z1ezl8CpnDMN7SEU0A
 vNlPAlJi5SVNsMk9xVgN/4Pvg+OQkRxoKuj4UnAbWTemFVpOiMGuXEi0JQiE2sUmYAkwmCeqfozuZ
 F2Veyr/39pVDCB0NQ80igjrXfb4kWebpBmCtMnX7T9xY3FoLz7gdRhXaY3mDOVrCYgjoD05d5OWc+
 QVnDZnwVWgRp7l+iza4+76VJQhej1wzXwaX83JXMjX0YQ0T7wKfWb/0Cc69wFC80b9zr2zVKpgW+/
 GeB2M1uRJbN64kIkYy4pdA==;
Date: Fri, 26 Apr 2024 18:02:13 +0300
Message-Id: <86y190xj4a.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stephen Berman <stephen.berman@HIDDEN>,
 Mauro Aranda <maurooaranda@HIDDEN>
In-Reply-To: <87r0esl2f5.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#70594: 30.0.50; Error when tabbing with only one active widget
References: <87r0esl2f5.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70594
Cc: 70594 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Fri, 26 Apr 2024 14:43:42 +0200
> From:  Stephen Berman via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> Commit 91333dacfa1, which adds the feature of optionally skipping over
> inactive widgets when tabbing (bug#70413), fails to handle buffers that
> contain only one active widget; in that case, pressing TAB or S-TAB
> raises the error "No buttons or fields found".  To reproduce:
> 
> 0. emacs -Q
> 1. Load the attached file widget-test.el and then type `M-x
>    my-widget-test'.
> 2. In the buffer "*My Widget Test*" repeatedly press TAB and S-TAB and
>    observe that point moves successively between the active radio
>    buttons labelled "One" and "Two" and the active push button "Submit",
>    but skips the inactive push button "Reset", since the user option
>    widget-skip-inactive is enabled.
> 3. Now press (via RET or mouse-click) the "Submit" button, which makes
>    the radio buttons and the "Submit" button inactive and the "Reset"
>    button active.
> 4. Pressing TAB once moves point to the "Reset" button, then pressing
>    TAB again moves point to BOB and raises the error "No buttons or
>    fields found".  Likewise, pressing S-TAB once moves point to "Reset",
>    then pressing S-TAB again moves to EOB and raises the same error.
> 
> The attached patched fixes this bug.  In addition, when only one widget
> is active and point is on it, since pressing TAB or S-TAB does not move
> point, the informational message "Only one tabable widget" is displayed.
> 
> The original code in widget-move contained separate loops to handle
> forward and backward movement and this involved some code duplication.
> The changes to this code to fix the bug would have required further
> duplication, so I took the opportunity to parameterize the
> directionality, allowing handling both directions in a single loop.
> This shortens the code and IMO makes the similarities and differences in
> the handling easier to see.

Adding Mauro to the discussion.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70594; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 26 Apr 2024 12:44:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 26 08:44:35 2024
Received: from localhost ([127.0.0.1]:34287 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s0KwC-00026U-Sg
	for submit <at> debbugs.gnu.org; Fri, 26 Apr 2024 08:44:34 -0400
Received: from lists.gnu.org ([2001:470:142::17]:40106)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stephen.berman@HIDDEN>) id 1s0Kw3-00023T-Vz
 for submit <at> debbugs.gnu.org; Fri, 26 Apr 2024 08:44:21 -0400
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 <stephen.berman@HIDDEN>)
 id 1s0Kvc-00026i-LH
 for bug-gnu-emacs@HIDDEN; Fri, 26 Apr 2024 08:43:49 -0400
Received: from mout.gmx.net ([212.227.17.21])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <stephen.berman@HIDDEN>)
 id 1s0Kva-00019U-Hq
 for bug-gnu-emacs@HIDDEN; Fri, 26 Apr 2024 08:43:48 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net;
 s=s31663417; t=1714135423; x=1714740223; i=stephen.berman@HIDDEN;
 bh=BEdgv7fx58enB9EUtCxHBkiZrWYP6sCrKsmmfTS7+a0=;
 h=X-UI-Sender-Class:From:To:Subject:Date:Message-ID:MIME-Version:
 Content-Type:cc:content-transfer-encoding:content-type:date:from:
 message-id:mime-version:reply-to:subject:to;
 b=Tmp9Tp0Rp4NJ9N1QGW1gar2XidSvml4jLUEjiMGbultJHdFr8kak0DryeE2yQQVf
 0UGCcN4ov26w6eBt5C2u0e5AFgRt8kTdCFPYQjROMquBbVit/YgfSh7V/Fk1EI8aF
 F+Za1pRMDJsWksryEXn9i/Ro0jxEa50PULFMF8oBWau1C0rM7HEUz+r9yyLxA5m8T
 mCWq3X0mx74usuEqi2NhIBu2KsoyLk9tedyA1cXGNTz42h6hW6LwMlZztCs/nRl+4
 Ga1VBOOY4hyE/Ij970Dp3s205zNVJJzv2Dndsa5f1bVcx020knkGWXRjRsf+Oe8BI
 el6UTPfy3O5l8ewY8Q==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from strobelfs ([94.134.94.5]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MUGeB-1s8LW80aSB-00RJdN for
 <bug-gnu-emacs@HIDDEN>; Fri, 26 Apr 2024 14:43:43 +0200
From: Stephen Berman <stephen.berman@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.0.50; Error when tabbing with only one active widget
X-Debbugs-Cc: 
Date: Fri, 26 Apr 2024 14:43:42 +0200
Message-ID: <87r0esl2f5.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Provags-ID: V03:K1:FiuTLSCd20owfLxmbq4i65DJ/ASTbEc4MaOZSuEhIv8r2Ief3/D
 Eo2WRd8ot47HDxwZax4fsFcF8/EexoihdXD0DgvtwAF+FlhZqO+jpQPMQWh01aqUnSX0H5K
 Az2/oW9noUXqXMuhI/dYXeG4oifYqi6OGy04EDCvW9auA4rEuT3Pt2OosCFT9MdTVDoRtQJ
 mI9EFDvOx0vrmgQVcM4cQ==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:xJJMHECmHe0=;XDNQmkXkpL/iEGTBDFy3S9pZkg5
 4JooTvo+zt4qUrrMfvRdgNvioZmi6EgBjOnaeM/iOX1czjUpqz9RZuekLeTsdSA9k6HVqA0Y8
 2g9WnE8iLZgAyz4evl0GWyK/9M5o5BBq2t0Vm8K8Qgz+Tgqjsse6l2HvoLzQFfTzLTitCg9q8
 6eH/tCkCr+fl7Baf0IkOEl8EKfk2YvdqH9oB6OqDJeWpbi6bweN27cEdUCUZY3TDVuYe8QBHx
 EOaAk8290J05f0u370uAELRN2IG6C3dnOJme+DH917woPPBMAKo7CAQPYRQZ0b2GzVrI0uPk9
 OjFZ8Cs5eegKB4Oh+XnZ+nG1/Tt2QWJB+AWCGHdsnYeI4RE3Hw1Jmmuo8AessUP51qywpzzcW
 WXkop+oNrH0VqW8FVkw40BDJvjpwUUTUDjeIoTJgBjbQSv9rvyT+ZB2A/LJunaoLPmgs8BBgT
 +h4XRLCj8+71w6Uslccp8c1wU9qJqkEjJ8amrfImMjgwRt3JoQ1yFXYGh9tYebB2oqcMzQIFm
 3F3ZHU6tpAqBJX4ftiPNtMCKyeTVWng4r4SmmWkHX1+cFpOvl35lDmRvZBB3w18Ba7R2arI6R
 kfxSXQaxSNd0Hu3YCDcafPVCGazRx/m0fjjrOk5mNvfMwr4z2uMsMdm3iaQJjcAGuXqaK11i0
 +PM/eTDP+D2OO1TWRhifzw813syceOWuTYf5TKSotnpPAGOzRegp5BTChw4omivvD/z+c9ux7
 3Mlt+5DfSTFU/H1CO8gPFlX2dg6xCc2ttvE+d+WbKC9WM4iUFabYBg/+WOcwO4WaPkynkkxsl
 ifFSShrx+SHJGV3vD3+k+rlPhGCg7C3nNTdu6GGKWtL9Y=
Received-SPF: pass client-ip=212.227.17.21;
 envelope-from=stephen.berman@HIDDEN; helo=mout.gmx.net
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Commit 91333dacfa1, which adds the feature of optionally skipping over
inactive widgets when tabbing (bug#70413), fails to handle buffers that
contain only one active widget; in that case, pressing TAB or S-TAB
raises the error "No buttons or fields found".  To reproduce:

0. emacs -Q
1. Load the attached file widget-test.el and then type `M-x
   my-widget-test'.
2. In the buffer "*My Widget Test*" repeatedly press TAB and S-TAB and
   observe that point moves successively between the active radio
   buttons labelled "One" and "Two" and the active push button "Submit",
   but skips the inactive push button "Reset", since the user option
   widget-skip-inactive is enabled.
3. Now press (via RET or mouse-click) the "Submit" button, which makes
   the radio buttons and the "Submit" button inactive and the "Reset"
   button active.
4. Pressing TAB once moves point to the "Reset" button, then pressing
   TAB again moves point to BOB and raises the error "No buttons or
   fields found".  Likewise, pressing S-TAB once moves point to "Reset",
   then pressing S-TAB again moves to EOB and raises the same error.

The attached patched fixes this bug.  In addition, when only one widget
is active and point is on it, since pressing TAB or S-TAB does not move
point, the informational message "Only one tabable widget" is displayed.

The original code in widget-move contained separate loops to handle
forward and backward movement and this involved some code duplication.
The changes to this code to fix the bug would have required further
duplication, so I took the opportunity to parameterize the
directionality, allowing handling both directions in a single loop.
This shortens the code and IMO makes the similarities and differences in
the handling easier to see.


Configured using:
 'configure 'CFLAGS=3D-Og -g3' PKG_CONFIG_PATH=3D/opt/qt5/lib/pkgconfig'

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


--=-=-=
Content-Type: application/emacs-lisp
Content-Disposition: attachment; filename=widget-test.el
Content-Transfer-Encoding: quoted-printable

(custom-set-variables  '(widget-skip-inactive t))

(defun my-widget-test ()
  (interactive)
  (switch-to-buffer "*My Widget Test*")
  (kill-all-local-variables)
  (let ((inhibit-read-only t))
    (erase-buffer))
  (remove-overlays)
  (setq my-radio-widget
	(widget-create 'radio-button-choice
		       '(item "One") '(item "Two")))
  (setq my-submit-button
	(widget-create 'push-button
		       :notify (lambda (widget &rest _)
				 (widget-apply my-radio-widget :deactivate)
				 (widget-apply my-reset-button :activate)
				 (widget-apply widget :deactivate))
		       "Submit"))
  (setq my-reset-button
	(widget-create 'push-button
		       :notify (lambda (widget &rest _)
				 (when (widget-value my-radio-widget)
				   (widget-value-set my-radio-widget nil))
				 (widget-apply my-radio-widget :activate)
				 (widget-apply my-submit-button :activate)
				 (widget-apply widget :deactivate))
		       "Reset"))
  (widget-apply my-reset-button :deactivate)
  (use-local-map widget-keymap)
  (widget-setup))

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment
Content-Description: widget-move patch

diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index dc481d4d0a5..407309c3429 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -1263,42 +1263,40 @@ widget-move
 ARG may be negative to move backward.
 When the second optional argument is non-nil,
 nothing is shown in the echo area."
-  (let ((wrapped 0)
-	(number arg)
-	(old (widget-tabable-at)))
-    ;; Forward.
-    (while (> arg 0)
-      (cond ((eobp)
-	     (goto-char (point-min))
-	     (setq wrapped (1+ wrapped)))
-	    (widget-use-overlay-change
-	     (goto-char (next-overlay-change (point))))
-	    (t
-	     (forward-char 1)))
-      (and (= wrapped 2)
-	   (eq arg number)
-	   (error "No buttons or fields found"))
-      (let ((new (widget-tabable-at)))
-	(when new
-	  (unless (eq new old)
-	    (setq arg (1- arg))
-	    (setq old new)))))
-    ;; Backward.
-    (while (< arg 0)
-      (cond ((bobp)
-	     (goto-char (point-max))
-	     (setq wrapped (1+ wrapped)))
-	    (widget-use-overlay-change
-	     (goto-char (previous-overlay-change (point))))
-	    (t
-	     (backward-char 1)))
-      (and (= wrapped 2)
-	   (eq arg number)
-	   (error "No buttons or fields found"))
-      (let ((new (widget-tabable-at)))
-	(when new
-	  (unless (eq new old)
-	    (setq arg (1+ arg))))))
+  (let* ((wrapped 0)
+	 (number arg)
+         (fwd (> arg 0))                ; widget-forward is caller.
+         (bwd (< arg 0))                ; widget-backward is caller.
+	 (old (widget-tabable-at))
+         (tabable (if old 1 0))
+         pos)
+    (catch 'one
+      (while (> (abs arg) 0)
+        (cond ((or (and fwd (eobp)) (and bwd (bobp)))
+	       (goto-char (cond (fwd (point-min))
+                                (bwd (point-max))))
+	       (setq wrapped (1+ wrapped)))
+	      (widget-use-overlay-change
+	       (goto-char (cond (fwd (next-overlay-change (point)))
+                                (bwd (previous-overlay-change (point))))))
+	      (t
+	       (cond (fwd (forward-char 1))
+                     (bwd (backward-char 1)))))
+        (and (= wrapped 2)
+	     (eq arg number)
+             (if (= tabable 1)
+                 (progn
+                   (goto-char pos)
+                   (throw 'one (message "Only one tabable widget")))
+	       (error "No buttons or fields found")))
+        (let ((new (widget-tabable-at)))
+	  (when new
+	    (if (eq new old)
+                (setq pos (point))
+              (cl-incf tabable)
+	      (setq arg (cond (fwd (1- arg))
+                              (bwd (1+ arg))))
+	      (setq old new))))))
     (let ((new (widget-tabable-at)))
       (while (and (eq (widget-tabable-at) new) (not (bobp)))
 	(backward-char)))

--=-=-=--




Acknowledgement sent to Stephen Berman <stephen.berman@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#70594; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 9 May 2024 07:30:02 UTC

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