GNU bug report logs -
#48328
switch-buffer-other-window keep-focus [POC INCLUDED]
Previous Next
Reported by: Boruch Baum <boruch_baum <at> gmx.com>
Date: Mon, 10 May 2021 05:38:02 UTC
Severity: normal
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 48328 <at> debbugs.gnu.org (full text, mbox):
> Date: Mon, 10 May 2021 01:37:17 -0400
> From: Boruch Baum <boruch_baum <at> 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?
This bug report was last modified 4 years and 70 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.