[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Universal/prefix argument for "other window" redirection?
From: |
Arthur Miller |
Subject: |
Re: Universal/prefix argument for "other window" redirection? |
Date: |
Thu, 08 Apr 2021 17:58:37 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) |
Gregory Heytings <gregory@heytings.org> writes:
>>
>> Is there already a way to "automatically" modify interactive commands to
>> "auto-work" in other window instead of current window?
>>
>> I know I can scroll other window already and switch to some buffer in another
>> window with `switch-to-buffer-another-window`, I already use them.
>>
>> What I would like is to have all the cursor motion stuff, expression evals
>> etc, work on in other window so I don't need to switch back and forth two
>> buffers (I like to work with two buffers side-by-side). I wonder if there is
>> already something I could use; prefix command/universal prefix whatever, to
>> autmoatically modify behaviour of interactive commands involved or do I have
>> to write my own (if it's possible :))?
>>
>
> (defun next-command-in-other-window ()
> (interactive)
> (let ((key (read-key-sequence nil)))
> (let ((window (other-window-for-scrolling)))
> (with-selected-window window
> (execute-kbd-macro key)))))
ha! It was that simple :-). I had something else in mind, but good I
didn't wrote anything.
Seems to work very fine with some commands; not so good with others. For
example motion commands like forward char, word, line etc, seems to work
very good. C-x C-f does not work at all (for me it is
helm-find-files). I know there is C-x 4 C-f
I have put it on `ยง` as a shortcut and tested for a while today. I am
not sure if like my idea :). For "one-timers" quick commands it saves
switching to original buffer and feels overal lighter than switching to
other window and back. But some things felt slightly confusing since I
don't see the cursor, like evaling last expression.
Cool anyway, thanks!
Re: Universal/prefix argument for "other window" redirection?, Arthur Miller, 2021/04/08