all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: `other-window-prefix' command, running anything in the other window
Date: Mon, 22 Jan 2024 09:29:47 +0100	[thread overview]
Message-ID: <874jf5lqis.fsf@dataswamp.org> (raw)
In-Reply-To: CADQMGASFXdYfPUVKfavXDayCeekwTR_jsv-+zizWmAfoW8RBpA@mail.gmail.com

Psionic K wrote:

> One of my TODO's is to compress all of the `*-other-window`
> commands into a prefix command that will make `find-file` do
> what `find-file-other-window` does for example.

One of my favorite commands look like this, I have it bound to
M-o globally.

(defun other-window-or-split ()
  (interactive)
  (when (one-window-p)
    (split-window-below) )
  (other-window 1) )

Maybe it will be spared from your compression since it is in
fact a `other-window-*' command, not a `*-other-window' one?

https://dataswamp.org/~incal/emacs-init/window-incal.el

Some more fun code:

(defmacro with-other-window (&rest body)
  `(with-selected-window (next-window)
     ,@body))

(defun apply-in-other-window (fn &rest args)
  (with-other-window
    (apply fn args) ))

https://dataswamp.org/~incal/emacs-init/window-other.el

-- 
underground experts united
https://dataswamp.org/~incal




  reply	other threads:[~2024-01-22  8:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22  8:09 `other-window-prefix' command, running anything in the other window Psionic K
2024-01-22  8:29 ` Emanuel Berg [this message]
2024-01-22 21:06 ` Dmitry Gutov
2024-01-22 21:50   ` Psionic K
2024-01-22 22:21     ` Psionic K
2024-01-22 23:39       ` Dmitry Gutov

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

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

  git send-email \
    --in-reply-to=874jf5lqis.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@gnu.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.