all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#70413: 30.0.50; FR: skip inactive widgets when tabbing
@ 2024-04-16  9:20 Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-04-16 12:53 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-04-16  9:20 UTC (permalink / raw)
  To: 70413

[-- Attachment #1: Type: text/plain, Size: 1705 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: skip inactive widgets patch --]
[-- Type: text/x-patch, Size: 954 bytes --]

diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 172da3db1e0..b40d4bf8898 100644
--- 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 (>= order 0)

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-04-17 17:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-16  9:20 bug#70413: 30.0.50; FR: skip inactive widgets when tabbing Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-16 12:53 ` Eli Zaretskii
2024-04-16 21:56   ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-16 22:04     ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-17 12:04       ` Eli Zaretskii
2024-04-17 13:57         ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-17 15:42           ` Eli Zaretskii
2024-04-17 17:36             ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-17 17:37               ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.