From: Eli Zaretskii <eliz@gnu.org>
To: Boruch Baum <boruch_baum@gmx.com>
Cc: 48328@debbugs.gnu.org
Subject: bug#48328: switch-buffer-other-window keep-focus [POC INCLUDED]
Date: Mon, 10 May 2021 16:28:50 +0300 [thread overview]
Message-ID: <838s4m7m5p.fsf@gnu.org> (raw)
In-Reply-To: <20210510053717.etp7pnybw6wjh2nj@E15-2016.optimum.net> (message from Boruch Baum on Mon, 10 May 2021 01:37:17 -0400)
> Date: Mon, 10 May 2021 01:37:17 -0400
> From: Boruch Baum <boruch_baum@gmx.com>
>
> I was going through my init file, and realized that something I thought
> was part of emacs-core was actually my simple wrapper function. IMO,
> it's sensible and I find it very convenient when dealing with buried
> buffers being used for reference (eg. occur, grep, help).
>
> All it does is add a prefix-arg control to function
> `switch-to-buffer-other-window' (C-x 4 b).
>
> For your consideration:
>
> (defcustom my-switch-to-buffer-other-window-keep-focus nil
> "Controls focus of buffer-switch to other window.
> When non-NIL, function `my-switch-to-buffer-other-window' keeps
> focus in the current window. This can be over-ridden at run-time
> by passing that function a PREFIX-ARG."
> :type 'boolean)
>
> (defun my-switch-to-buffer-other-window (buffer-or-name &optional norecord)
> "Wrapper to allow keeping focus in current window.
> Performs action of function `switch-to-buffer-other-window', but
> refers to variable `my-switch-to-buffer-other-window-keep-focus'
> to determine whether to change focus to the other window. You can
> over-ride that setting by calling this function with a
> PREFIX-ARG."
I use "C-x 4 C-o", which is built-in, for the same purpose. Doesn't
it do what you want here?
next prev parent reply other threads:[~2021-05-10 13:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-10 5:37 bug#48328: switch-buffer-other-window keep-focus [POC INCLUDED] Boruch Baum
2021-05-10 13:28 ` Eli Zaretskii [this message]
2021-05-10 15:36 ` Boruch Baum
2021-05-11 12:37 ` Lars Ingebrigtsen
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=838s4m7m5p.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=48328@debbugs.gnu.org \
--cc=boruch_baum@gmx.com \
/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).