[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swsw 841345d5cf 120/146: Define 'swsw-select' as a remappi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swsw 841345d5cf 120/146: Define 'swsw-select' as a remapping of 'other-window' |
Date: |
Wed, 25 May 2022 02:59:53 -0400 (EDT) |
branch: elpa/swsw
commit 841345d5cfe7dc53c8869bb0c3771ebed10740fe
Author: Daniel Semyonov <daniel@dsemy.com>
Commit: Daniel Semyonov <daniel@dsemy.com>
Define 'swsw-select' as a remapping of 'other-window'
* swsw.el (swsw-mode): Define 'swsw-mode-map' as a keymap with a
single definition remapping 'other-window' to 'swsw-select'.
---
NEWS | 9 +++++++++
swsw.el | 10 +++++++---
swsw.texi | 5 +++--
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/NEWS b/NEWS
index 9a5cb43d55..600a1faf96 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,15 @@
swsw NEWS -- history of user-visible changes.
See the end of the file for an explanation of the versioning scheme.
+* 2.1.0
+
+** Remap 'other-window' to 'swsw-select' when 'swsw-mode' is active.
+By default this changes nothing since the default binding for
+'other-window' is 'C-x o'.
+This change has been made to add (simple) out-of-the-box compatibility
+with alternative key binding sets or different Emacs distributions
+(provided they bind 'other-window').
+
* 2.0.2
** No user visible changes.
diff --git a/swsw.el b/swsw.el
index 351fc1effb..9aa642cc69 100644
--- a/swsw.el
+++ b/swsw.el
@@ -46,6 +46,7 @@
;; function (see `swsw-display-function').
;; - Window IDs are assigned to all windows on all frames except for
;; the minibuffer(by default, see `swsw-scope').
+;; - `other-window' (C-x o by default) is remapped to `swsw-select'.
;;
;; C-x o ID switches focus to the window which corresponds to ID.
;;
@@ -332,15 +333,18 @@ selection.")
(define-minor-mode swsw-mode
"Minor mode for simple window management.
+When the mode is active, `other-window' is remapped to `swsw-select'.
+
The following key bindings are available after starting window
selection:
\\{swsw-command-map}"
:global t
- :lighter
- (:eval (when (eq swsw-display-function 'lighter)
+ :lighter (:eval (when (eq swsw-display-function 'lighter)
(swsw-format-id (selected-window))))
- :keymap '(keymap (?\C-x . (keymap (?o . swsw-select))))
+ :keymap (let ((map (make-sparse-keymap)))
+ (define-key map [remap other-window] #'swsw-select)
+ map)
(if swsw-mode
(progn
(swsw--update)
diff --git a/swsw.texi b/swsw.texi
index 3dbe1ed2e9..9781fb9510 100644
--- a/swsw.texi
+++ b/swsw.texi
@@ -136,8 +136,9 @@ In order to use any feature of the package,
@code{swsw-mode} must be enabled:
You can also add @code{(swsw-mode)} to your init file, instead.
@end table
-By default, window IDs will be shown as mode line lighters of the
-form @code{<ID>}.
+By default, window IDs are shown as mode line lighters of the
+form @code{<ID>} (@xref{Display functions}), and @code{other-window}
+(@kbd{C-x o}) is remapped to @code{swsw-select}.
@kindex C-x o
@cindex swsw-select
- [nongnu] elpa/swsw e43021aa7e 112/146: * swsw.el (swsw-format-id): Use 'format-spec' instead of 'format', (continued)
- [nongnu] elpa/swsw e43021aa7e 112/146: * swsw.el (swsw-format-id): Use 'format-spec' instead of 'format', ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw c864e6d524 144/146: ; Add change log for version 2.1.1, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw d7fe615c3f 049/146: ; Fix inconsistency between requirements in swsw.el and swsw-pkg.el, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 74124620af 048/146: ; Add brief usage information to the docstring of 'swsw-mode', ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 83eb90586a 051/146: ; Alter comments and docstrings to comply with Emacs' conventions, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 8fc0e7dfa7 046/146: ; Bump required emacs version to 26.1, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 095091cf33 057/146: Handle cases where there are less than three tracked windows better, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw cacbe44c08 058/146: ; Remove unnecessary ':group' keywords from 'defcustom' calls, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 0b67d7bc00 056/146: * swsw.el (swsw-display-function): Define early only when byte-compiling, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw ec011dc3b9 053/146: ; Fix inconsistency in URL between swsw.el and swsw-pkg.el, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 841345d5cf 120/146: Define 'swsw-select' as a remapping of 'other-window',
ELPA Syncer <=
- [nongnu] elpa/swsw e7646bf372 129/146: ; Bump to version 2.1, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw d195e574c0 066/146: ; Add latest changes to the news file, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 5b0f4657cc 052/146: ; Simplify build process, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw bc734b9937 003/146: Use 'read-char' instead of 'read-char-from-minibuffer' to read IDs, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 37ad725b1e 018/146: ; Update comment referencing single character IDs, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw b5b05358a3 035/146: ; Add a news file containing a detailed change log, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 8a8be23f1b 050/146: ; Include license information in created package archives, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 4b308b978a 113/146: ; Move a comment slightly, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw a0c339fbb4 118/146: ; Small documentation change, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 1c19d22100 108/146: ; Add links to relevant part of the manual to user options, ELPA Syncer, 2022/05/25