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)