unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: jan <rtm443x@googlemail.com>
To: 23131@debbugs.gnu.org
Subject: bug#23131: switch-to-buffer-other-frame problem
Date: Mon, 28 Mar 2016 00:37:30 +0100	[thread overview]
Message-ID: <CADJx9LdsqRPpAPvkf4vh2uC9dc2xqUSZRMfFb+9roWfPhGwKdQ@mail.gmail.com> (raw)

Running emacs 24.5.1 on windows.

Hi all,
switch-to-buffer-other-frame works but should prompt for the name of
the buffer to switch to. Per the help on that function "If called
interactively, prompt for the buffer name using the minibuffer". Well
it does but then refuses to recognise my buffer by name.

---------

e.g Start emacs, then drag a file (say sample.txt) onto it. File opens fine.

Type C-x 5 b

- minibuffer shows
"Switch to buffer in other frame (default *GNU Emacs*): "

I type "sam" [tab key for completion]

- minibuffer says
"Switch to buffer in other frame (default *GNU Emacs*): sam[No Match]"

odd. If I remove the "sam" I just typed then type '?' to show the
buffer list, it opens a 2nd buffer at the bottom and shows

Possible completions are:
*GNU Emacs*
*Messages*
*scratch*

which does not show sample.txt, which is definitly there as I can see
it open in the buffer at the top.

As a workaround, I enter a nonexistent buffer name, the 2nd frame
opens, blank, I then do
C-x b
sam            <- I type this in
[tab for completion]
sample.txt  <- emacs autocompletes this
RET  <- to accept

and sample.txt is now shown in the other frame as I want. But this is
a workaround.

----------------

Having raised this with Eli, he says this is expected behaviour: "Yes,
it's a feature: Emacs doesn't offer you a buffer that is already
displayed in an existing window.  This was introduced in Emacs 24."

Well, a) this is not documented (see below) and b) I can't see any
rationale for this behaviour. Hiding this option does not assist the
user in any way I can see.

Also, the behaviour is apparently broken if the current buffer/window is split:

a. open sample.txt
b. C-x 2   -- split window in 2, top and bottom
c. C-x 5 b  -- try to get 2nd frame
d. sample.txt   -- type in full filename in minibuffer
e. 2nd frame does *not* appear, cursor jumps to top of split window,
even if was originally in bottom.

can reproduce?

jan


I said this behaviour isn't documented that I can see. Here's the full
docs for this function. It says nothing about hiding the current
buffer name:

-------
switch-to-buffer-other-frame is an interactive compiled Lisp function
in `window.el'.

It is bound to C-x 5 b.

(switch-to-buffer-other-frame BUFFER-OR-NAME &optional NORECORD)

Switch to buffer BUFFER-OR-NAME in another frame.
BUFFER-OR-NAME may be a buffer, a string (a buffer name), or
nil.  Return the buffer switched to.

If called interactively, prompt for the buffer name using the
minibuffer.  The variable `confirm-nonexistent-file-or-buffer'
determines whether to request confirmation before creating a new
buffer.

If BUFFER-OR-NAME is a string and does not identify an existing
buffer, create a new buffer with that name.  If BUFFER-OR-NAME is
nil, switch to the buffer returned by `other-buffer'.

Optional second arg NORECORD non-nil means do not put this
buffer at the front of the list of recently selected ones.

This uses the function `display-buffer' as a subroutine; see its
documentation for additional customization information.
-------





             reply	other threads:[~2016-03-27 23:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-27 23:37 jan [this message]
2016-03-28 11:22 ` bug#23131: switch-to-buffer-other-frame problem martin rudalics
2016-03-29  8:38   ` jan
2016-03-29 15:13     ` martin rudalics
2016-04-01 19:49       ` Juri Linkov
2021-07-14 14:46         ` 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=CADJx9LdsqRPpAPvkf4vh2uC9dc2xqUSZRMfFb+9roWfPhGwKdQ@mail.gmail.com \
    --to=rtm443x@googlemail.com \
    --cc=23131@debbugs.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 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).