From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70413: 30.0.50; FR: skip inactive widgets when tabbing Date: Tue, 16 Apr 2024 11:20:10 +0200 Message-ID: <87zfttpstx.fsf@gmx.net> Reply-To: Stephen Berman Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21383"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 70413@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 16 11:24:28 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 1rwf3E-0005P1-Kq for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Apr 2024 11:24:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwf0l-0005DE-Hk; Tue, 16 Apr 2024 05:21:55 -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 1rwezk-0003fY-3N for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2024 05:20:53 -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 1rwezj-00087D-QS for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2024 05:20:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rwezv-0006Q2-Le for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2024 05:21:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Apr 2024 09:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70413 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.171325925724626 (code B ref -1); Tue, 16 Apr 2024 09:21:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Apr 2024 09:20:57 +0000 Original-Received: from localhost ([127.0.0.1]:42750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwezo-0006P0-DW for submit@debbugs.gnu.org; Tue, 16 Apr 2024 05:20:57 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:48026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwezj-0006Nu-3y for submit@debbugs.gnu.org; Tue, 16 Apr 2024 05:20: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 1rwezD-00037k-SE for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2024 05:20:21 -0400 Original-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 ) id 1rwez9-0007yB-8v for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2024 05:20:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1713259211; x=1713864011; i=stephen.berman@gmx.net; bh=HwGwMeKpMSrKcfLIZ6+c55o2vuVUVZQ0dblMbWvPCDM=; 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=S8WfIjXByEj7xTv9lG1b+S7T8Gm90LEI5UDtRHRPtMRgq4aLKARsw/Lr8QSHlUim jbi4oukehJA2uOdZ2CuG89FV8e747StPdE0yqibNE+I6o0TTzsN3XKD4pVueBjXmn L65izpZaUNPiXgO8eyZlyVDH8ZrcNUmOPompu8alBOxm6o0DoTiXhj8bkrGysuGnW dCp5I2De3qDb/3f2ePjzSNJXcWrkHnLckcEVlwshUcm65LTQg4DpxmgsnMZhXmBdY WxACQ+Bd6MrTKL3HbyxO3qp2+dpuLhiwewepf9rSZruC+J4CSAbXv4Za0XfsEzosc eesA0WYK0dDzCCfnGQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfs ([88.130.48.38]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MfHEJ-1sP92u2wJf-00gpbk for ; Tue, 16 Apr 2024 11:20:11 +0200 X-Provags-ID: V03:K1:0Noh35BZ44THPNTrc8pruZo8F6Jn3BllA7yH3qRQxB8lA9rqe5l /pNEqhjv3w7SyRLfRe+v6I3jOEohkpdnRtzaGDGpcESSwalGh0kMjv3Wp/6KzqtiqFVfqHN V2+UnDmLC6L/lyBnfpSTWCnfZd/OL7Xy0I1Y6X1RlEiHp1KOmyJ8NNK7GKin0VDNMVFS62c hh8rbQdBSaZ61+LJBhyvg== UI-OutboundReport: notjunk:1;M01:P0:EiZrotqKi3w=;qdacXIZgYFlvVZTL+exKZyPiQoJ nemrCns6UqVLUh8Xk+qws7kXwtPwAuA2HgWKB0LSTcbKIf9LSmSCvPAbbW50KbKajFg/DpEct zkTilqvq+1PXSZQd0lqrjD8wcM+cw/WvpY0YUJiVRU5s+bZghFNC5/xznci7qXSHdfv3z51p0 F44VDeBhG+2yYU83FmFHNsAGikFsZD9pAGAtAwDfYwiURejtOuVARalkjk1y2vS68mN1/8fEC +Y9hKE9+h36qJ6i76wvX24i7Xhm0WJAL2DrDFTzPp7pK1QPZCcJQEECJlkGEwSFqHVZiMElnb UJn1FFvCH8xrUXe164QEgeInLfJlNdOPsDygpF25eGf1icFTYqGTYus1LpFIbihnw90OMrNNX TZByWoOe1/M+Qcek6SsmhwhMU/9ZqSxhxZpcxTUFCcgnG4zBXz4HFbp3WYuB4Un8BckoL1ubN vG56NohH+U6vt5kS/wY0vJTd8vf5fDqsfoDdO+mCAKqsZLChlbX/u8wgv41xWimTVKAV+aWxd eH7FAle2/7YURFztnD7BgMZi9kqo20Cpfe2LRHYkkI8yXP7BwTEC+f0Ybrx0iHMCD3BJyVd8k s2K9XOOdeEmijIHq0g6D6t23IS7vjJM2T6YczZcXfSo6yWXgraDZ3maaLNOF6NWWscxdv081A zh3eCOG3jLjnBJ9DC9JRwqpes0Fqm5dX3dC4C58haahKylaUiLmy1jyw6h+KUZUWSt/ykHPrv hq2s/tRF8hjrzdr5bajFU2DEokhYnJMsEU8jMHcMi82RJfLI5mpDKzfH/stpgjjAPHg4YmyL Received-SPF: pass client-ip=212.227.17.21; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:283411 Archived-At: --=-=-= Content-Type: text/plain In buffers containing widgets, such as the Customize buffers, the widgets can be either active or inactive: when you click (with the mouse or RET) on an active widget, its associated action is executed, and when you click on an inactive widget, this raises the error "Attempt to perform action on inactive widget". You can navigate among the widgets by pressing TAB or S-TAB to move point to the next or previous widget. I think it would be useful and convenient to skip over inactive widgets when tabbing; e.g. you then avoid accidentally tabbing to an inactive widget, typing RET and getting the error, and in a buffer with many active and inactive widgets, you can tab more quickly to the desired active widget by skipping over the inactive ones. The attached patch implements this behavior. Since tabbing to inactive widgets has always been the behavior in the widget library, skipping is conditioned on the value of a boolean defcustom, with the default being the current non-skipping. In GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0) of 2024-04-16 built on strobelfs Repository revision: b436f430e3897e1aa6dcb5a39564a3553bbf631f Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101013 System Description: Linux From Scratch r12.1-41 Configured using: 'configure 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/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: text/x-patch Content-Disposition: attachment Content-Description: skip inactive widgets patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 172da3db1e0..b40d4bf8898 100644 =2D-- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -1219,11 +1219,20 @@ widget-button-press (when (commandp command) (call-interactively command)))))) +(defcustom widget-skip-inactive nil + "If non-nil, skip inactive widgets when tabbing through buffer." + :version "30.1" + :group 'widgets + :type 'boolean) + (defun widget-tabable-at (&optional pos) "Return the tabable widget at POS, or nil. -POS defaults to the value of (point)." +POS defaults to the value of (point). If user option +`widget-skip-inactive' is non-nil, inactive widgets are not tabable." (let ((widget (widget-at pos))) - (if widget + (if (and widget (if widget-skip-inactive + (widget-apply widget :active) + t)) (let ((order (widget-get widget :tab-order))) (if order (if (>=3D order 0) --=-=-=--