emacs-devel
[Top][All Lists]
Advanced

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

Re: POLL: make C-x o transient


From: Stefan Monnier
Subject: Re: POLL: make C-x o transient
Date: Mon, 25 Jan 2021 09:39:00 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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

I think the pattern is clear: `C-x <letter>` are good candidates ;-)

> (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))

It needs work, but I agree with the intention.


        Stefan




reply via email to

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