emacs-devel
[Top][All Lists]
Advanced

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

POLL: make C-x o transient


From: Zhiwei Chen
Subject: POLL: make C-x o transient
Date: Sun, 24 Jan 2021 06:12:09 +0000

Which will make `C-x o` invoke a transient version of `other-window' like `text-scale-adjust’ does.

What benefits from this change:
1. Fewer keystrokes for multi windows navigation
2. Reduce the probability of RSI
3. Able to navigate windows backwards 

POC follows:

(defcustom transient-other-window nil)

(defun other-window-backward ()
  (interactive)
  (other-window -1))

(defun transient-other-window ()
  (interactive)
  (let ((echo-keystrokes nil))
    (other-window 1)
    (set-transient-map
     (let ((map (make-sparse-keymap)))
       (define-key map "o" #'other-window)
       (define-key map "O" #'other-window-backward)
       map)
     t)))

(if transient-other-window
    (global-set-key (kbd "C-x o") #'transient-other-window)
  (global-set-key (kbd "C-x o") #'other-window))

--
Zhiwei Chen



reply via email to

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