emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 1ee7673 1/2: Make the button navigation commands available via a


From: Lars Ingebrigtsen
Subject: master 1ee7673 1/2: Make the button navigation commands available via a minor mode
Date: Wed, 9 Sep 2020 06:59:42 -0400 (EDT)

branch: master
commit 1ee76735a2b52088f483134155e0826e8aa96d38
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make the button navigation commands available via a minor mode
    
    * lisp/button.el (button-mode): New minor mode.
    
    * doc/lispref/display.texi (Button Buffer Commands): Mention it.
---
 doc/lispref/display.texi | 3 +++
 etc/NEWS                 | 7 +++++++
 lisp/button.el           | 4 ++++
 3 files changed, 14 insertions(+)

diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index d3adb62..e549400 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 76f44f2..350ea56 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 03ab59b..1131760 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]