Subject: [PATCH] Allow starting with 'C-x O' for other-window
From: James Thomas <[email-masked]>
To: [email-masked]
Date: Mon, 16 Jun 2025 07:05:49 +0530
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch
Severity: wishlist

Is this a good idea? (I shall use it anyway :-))

In GNU Emacs 31.0.50 (build 6, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.18.0, Xaw scroll bars) of 2025-06-16 built on inspiron15
Repository revision: 9b80d2ea28826466b86e00631718a47a3f2fa2ee
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101014
System Description: Guix System

Configured using:
 'configure --with-x-toolkit=lucid --with-native-compilation=aot
 PKG_CONFIG_PATH=/gnu/store/j6rdgb6pk0274dfl0mdqxal89kpf18zj-profile/lib/pkgconfig:/gnu/store/j6rdgb6pk0274dfl0mdqxal89kpf18zj-profile/share/pkgconfig'

From 405f5a5b7c164cd22d73e7accb3d4e279f9dcce7 Mon Sep 17 00:00:00 2001
From: James Thomas <[email-masked]>
Date: Mon, 16 Jun 2025 01:20:31 +0530
Subject: [PATCH] Allow starting with 'C-x O' for other-window

This makes it consistent with its repeat-map.

* lisp/window.el (ctl-x-map): Add a new default binding with the
  definition from other-window-repeat-map.
---
 lisp/window.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/window.el b/lisp/window.el
index e372ef8b9bb..8a6359daa3f 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -11350,6 +11350,10 @@ ctl-x-map
 (define-key ctl-x-map "2" 'split-window-below)
 (define-key ctl-x-map "3" 'split-window-right)
 (define-key ctl-x-map "o" 'other-window)
+(define-key ctl-x-map "O" (lambda ()
+                            (interactive)
+                            (setq repeat-map 'other-window-repeat-map)
+                            (other-window -1)))
 (define-key ctl-x-map "^" 'enlarge-window)
 (define-key ctl-x-map "}" 'enlarge-window-horizontally)
 (define-key ctl-x-map "{" 'shrink-window-horizontally)
-- 
2.46.0