summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/display.texi3
-rw-r--r--etc/NEWS7
-rw-r--r--lisp/button.el4
3 files changed, 14 insertions, 0 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index d3adb62c1bd..e5494002ce8 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -6926,6 +6926,9 @@ such as @code{forward-button} and @code{backward-button} are
additionally available in the keymap stored in
@code{button-buffer-map}; a mode which uses buttons may want to use
@code{button-buffer-map} as a parent keymap for its keymap.
+Alternatively, the @code{button-mode} can be switched on for much the
+same effect: It's a minor mode that does nothing else than install
+@code{button-buffer-map} as a minor mode keymap.
If the button has a non-@code{nil} @code{follow-link} property, and
@code{mouse-1-click-follows-link} is set, a quick @key{mouse-1} click
diff --git a/etc/NEWS b/etc/NEWS
index 76f44f2ce67..350ea5633c7 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -958,6 +958,13 @@ window after starting). This variable defaults to nil.
** Miscellaneous
++++
+*** New minor mode 'button-mode'.
+This minor mode does nothing else than install 'button-buffer-map' as
+a minor mode map (which binds the TAB/S-TAB key bindings to navigate
+to buttons), and can be used in any view-mode-like buffer that has
+buttons in it.
+
---
*** 'icomplete-show-matches-on-no-input' behavior change.
Previously, choosing a different completion with commands like 'C-.'
diff --git a/lisp/button.el b/lisp/button.el
index 03ab59b109c..11317605cee 100644
--- a/lisp/button.el
+++ b/lisp/button.el
@@ -78,6 +78,10 @@
"Keymap useful for buffers containing buttons.
Mode-specific keymaps may want to use this as their parent keymap.")
+(define-minor-mode button-mode
+ "A minor mode for navigating to buttons with the TAB key."
+ :keymap button-buffer-map)
+
;; Default properties for buttons.
(put 'default-button 'face 'button)
(put 'default-button 'mouse-face 'highlight)