From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70594: 30.0.50; Error when tabbing with only one active widget Date: Fri, 26 Apr 2024 18:02:13 +0300 Message-ID: <86y190xj4a.fsf@gnu.org> References: <87r0esl2f5.fsf@gmx.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5887"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70594@debbugs.gnu.org To: Stephen Berman , Mauro Aranda Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 26 17:03:16 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 1s0N6Z-0001ID-Nb for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Apr 2024 17:03:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0N6K-0005fM-N8; Fri, 26 Apr 2024 11:03:00 -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 1s0N6C-0005dR-OF for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2024 11:02:54 -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 1s0N6B-0003Os-A8 for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2024 11:02:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s0N6T-0004MK-CK for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2024 11:03:09 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Apr 2024 15:03:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70594 X-GNU-PR-Package: emacs Original-Received: via spool by 70594-submit@debbugs.gnu.org id=B70594.171414376616474 (code B ref 70594); Fri, 26 Apr 2024 15:03:08 +0000 Original-Received: (at 70594) by debbugs.gnu.org; 26 Apr 2024 15:02:46 +0000 Original-Received: from localhost ([127.0.0.1]:38213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0N63-0004H6-4w for submit@debbugs.gnu.org; Fri, 26 Apr 2024 11:02:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0N60-0004FO-Fv for 70594@debbugs.gnu.org; Fri, 26 Apr 2024 11:02:41 -0400 Original-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 ) 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==; In-Reply-To: <87r0esl2f5.fsf@gmx.net> (bug-gnu-emacs@gnu.org) 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:283996 Archived-At: > 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" > > 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.