unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Gregory Heytings <gregory@heytings.org>
Cc: emacs-devel@gnu.org
Subject: Re: Universal/prefix argument for "other window" redirection?
Date: Thu, 08 Apr 2021 17:58:37 +0200	[thread overview]
Message-ID: <AM9PR09MB497730125297A524D8A8B72B96749@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <9ff81b52facc50337ed6@heytings.org> (Gregory Heytings's message of "Thu, 08 Apr 2021 12:16:57 +0000")

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!



  reply	other threads:[~2021-04-08 15:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08  9:37 Universal/prefix argument for "other window" redirection? Arthur Miller
2021-04-08 12:16 ` Gregory Heytings
2021-04-08 15:58   ` Arthur Miller [this message]
2021-04-08 14:56 ` Stefan Monnier
2021-04-08 16:11   ` Arthur Miller
2021-04-08 17:01     ` Yuri Khan
2021-04-08 17:42       ` Arthur Miller
2021-04-08 17:57         ` Stefan Monnier
2021-04-08 18:26           ` Arthur Miller
2021-04-09  4:18     ` Eric Abrahamsen
2021-04-09  7:58       ` Arthur Miller
2021-04-08 22:59   ` Arthur Miller
2021-04-08 23:03     ` Stefan Monnier
2021-04-08 19:04 ` Sean Whitton
2021-04-08 21:14   ` Arthur Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM9PR09MB497730125297A524D8A8B72B96749@AM9PR09MB4977.eurprd09.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=emacs-devel@gnu.org \
    --cc=gregory@heytings.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).