emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/window-commander 617903f9ac: Add a command for selectin


From: ELPA Syncer
Subject: [elpa] externals/window-commander 617903f9ac: Add a command for selecting the most recently used window
Date: Sun, 11 Feb 2024 21:59:09 -0500 (EST)

branch: externals/window-commander
commit 617903f9acb2426a6dc5abf633c899f92a953714
Author: Daniel Semyonov <daniel@dsemy.com>
Commit: Daniel Semyonov <daniel@dsemy.com>

    Add a command for selecting the most recently used window
    
    * window-commander.el (wincom-select-most-recently-used): New command.
    (wincom-command-map): Bind 'wincom-select-most-recently-used'.
---
 window-commander.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/window-commander.el b/window-commander.el
index b11ad8d91d..4ae01dd822 100644
--- a/window-commander.el
+++ b/window-commander.el
@@ -468,6 +468,13 @@ indirectly called by the latter."
   (select-window (or (active-minibuffer-window)
                      (user-error "There is no active minibuffer window"))))
 
+(defun wincom-select-most-recently-used ()
+  "Select the most recently used window."
+  (declare (modes wincom-mode))
+  (interactive)
+  (when-let ((w (get-mru-window (wincom--get-scope) t t)))
+    (select-window w)))
+
 (defvar wincom-command-map
   (let ((map (make-sparse-keymap)))
     (define-key map [?o] #'wincom-select)
@@ -479,6 +486,7 @@ indirectly called by the latter."
       (define-key map [?4] #'wincom-selected-window-prefix))
     (define-key map [?t] #'wincom-swap)
     (define-key map [?m] #'wincom-select-minibuffer)
+    (define-key map [?r] #'wincom-select-most-recently-used)
     map)
   "Key map for window commands.
 This key map is set as the parent of `wincom--id-map' during ID



reply via email to

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