GNU bug report logs - #23131
switch-to-buffer-other-frame problem

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: jan <rtm443x@HIDDEN>; dated Sun, 27 Mar 2016 23:38:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 23131 <at> debbugs.gnu.org:


Received: (at 23131) by debbugs.gnu.org; 28 Mar 2016 11:22:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 28 07:22:59 2016
Received: from localhost ([127.0.0.1]:40837 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1akVG6-0000l5-Vz
	for submit <at> debbugs.gnu.org; Mon, 28 Mar 2016 07:22:59 -0400
Received: from mout.gmx.net ([212.227.17.21]:49349)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1akVG5-0000ko-2d
 for 23131 <at> debbugs.gnu.org; Mon, 28 Mar 2016 07:22:57 -0400
Received: from [192.168.1.100] ([212.95.7.40]) by mail.gmx.com (mrgmx102) with
 ESMTPSA (Nemesis) id 0MaV3V-1aQVYx3QWv-00KAfe;
 Mon, 28 Mar 2016 13:22:50 +0200
Message-ID: <56F91406.2080304@HIDDEN>
Date: Mon, 28 Mar 2016 13:22:46 +0200
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: jan <rtm443x@HIDDEN>, 23131 <at> debbugs.gnu.org
Subject: Re: bug#23131: switch-to-buffer-other-frame problem
References: <CADJx9LdsqRPpAPvkf4vh2uC9dc2xqUSZRMfFb+9roWfPhGwKdQ@HIDDEN>
In-Reply-To: <CADJx9LdsqRPpAPvkf4vh2uC9dc2xqUSZRMfFb+9roWfPhGwKdQ@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K0:RwE0mmlma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D34JH4WGb14Ntp9A3IS3
 0sI+JvGkbRQtEg1i/KqN7GMpoFF/Q==
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: 23131
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

 > 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.

If, in this situation, you type C-x b, Emacs won't offer you sample.txt
as completion either.  Ditto for =E2=80=98switch-to-buffer-other-window=E2=
=80=99.  It's
difficult to say what the correct behavior should be.  I never use the
buffer switching commands, so I have no preference.  But I suppose that
some people would complain if C-x b offered them the buffer already
shown in the selected window as possible completion.  So where would you
draw the line?

Basically, to switch to a buffer already shown in a window W, I wouldn't
type C-x b but use C-x o to get there.  To show the buffer shown in W in
another window on the same frame, I'd type C-x 2 in W.  To show the
buffer shown in W in a window on another frame, I'd type C-x 5 2 in W.

 > 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?

Why don't you just use C-x 5 2 here?  Anyway, this happens because of
the last two forms in

(defvar display-buffer--other-frame-action
   '((display-buffer-reuse-window
      display-buffer-pop-up-frame)
     (reusable-frames . 0)
     (inhibit-same-window . t))

which OT1H inhibit using the selected window and OTOH, since we have no
value for =E2=80=98reusable-frames=E2=80=99 to exclude the selected frame=
 from the list
of reusable frames, allows reusing the window on the bottom.

If people think that it's worth fixing this, we would probably have to
invent a new alist entry like =E2=80=98inhibit-same-frame=E2=80=99.  That=
 change might
be obtrusive though, so I would not ardently recommend it for emacs-25.

martin





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23131; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 27 Mar 2016 23:37:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 27 19:37:42 2016
Received: from localhost ([127.0.0.1]:40516 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1akKFa-0000g2-7B
	for submit <at> debbugs.gnu.org; Sun, 27 Mar 2016 19:37:42 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41163)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rtm443x@HIDDEN>) id 1akKFY-0000fp-Ta
 for submit <at> debbugs.gnu.org; Sun, 27 Mar 2016 19:37:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rtm443x@HIDDEN>) id 1akKFS-0001ww-Gj
 for submit <at> debbugs.gnu.org; Sun, 27 Mar 2016 19:37:35 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:39446)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <rtm443x@HIDDEN>) id 1akKFS-0001wr-CW
 for submit <at> debbugs.gnu.org; Sun, 27 Mar 2016 19:37:34 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60322)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <rtm443x@HIDDEN>) id 1akKFR-0001nv-1k
 for bug-gnu-emacs@HIDDEN; Sun, 27 Mar 2016 19:37:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rtm443x@HIDDEN>) id 1akKFP-0001ve-Ug
 for bug-gnu-emacs@HIDDEN; Sun, 27 Mar 2016 19:37:32 -0400
Received: from mail-qk0-x235.google.com ([2607:f8b0:400d:c09::235]:33338)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <rtm443x@HIDDEN>) id 1akKFP-0001vW-Oq
 for bug-gnu-emacs@HIDDEN; Sun, 27 Mar 2016 19:37:31 -0400
Received: by mail-qk0-x235.google.com with SMTP id s5so90891838qkd.0
 for <bug-gnu-emacs@HIDDEN>; Sun, 27 Mar 2016 16:37:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=googlemail.com; s=20120113;
 h=mime-version:date:message-id:subject:from:to;
 bh=gzwF54hwPYCvYlyBFUeWFCpRpgqZtHi8KOrEHfPH2Ds=;
 b=E+rtmzxzmt1t5z/xZEg1+yqCztTLf/u+9XEof8UklVQW3VyFP5QlZgwyhjJoeotjbR
 QMufuboDnCQuNvOT1o17osOOHAqOsHMCwEt8tjJY9mO1+yValiKQZqpD/BHmVbigFEOI
 xDrw+92pdWLv7moTFZFfd7wqZQyuXKgq8ECukAyMJaD+EwDAOm180ESjyuYHMPVDEAIu
 w2wHIu1JzD8K2jDpcf6mH+lHWyZE6UeaOFFVhggD2nRd0d7WdELMutZ/5J1dCg2Vc/RW
 VHyk9p7/wfXJ1jueZbWBQXrxGwxNOPsq3Nk2TF6vR0PmBfePVwJFUXgj149i2cgJO0lD
 38Xg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:date:message-id:subject:from:to;
 bh=gzwF54hwPYCvYlyBFUeWFCpRpgqZtHi8KOrEHfPH2Ds=;
 b=KIDtuaMq7a/l11vm37WmGBaFqy60rdgTIg3+i0f6A6gpuM/kcJaXpc+c+czBd/+1PY
 mSHJtkZE0eRtJgIJhAhqqEOg1UzRBP/D//HJq476zJf9zvrdQWqLH3gkdBVZGAbtxSuF
 z2hbt8Y9qlU2S5qXd9T0EeOn0Ekm2fHe5XtzNNsy50luPu1gaQ/JgJnWqZNA0o/GrACl
 cYEXnpastqkad2to6bXYFxO78nkOo4nJQOtkIcyfvwn7iiiLjGWZuRXg3jeZ7zYMeXPU
 AR55+7XznNcmKQC2fLNdAJPLlh9BbRgQiGHRZUgMj3v3P8I2a3O8t3E5mw43+7NCqByK
 HKqA==
X-Gm-Message-State: AD7BkJJsokNLvDl7sOTZchyrfFmBQWSIywgJHgYkHFbeXr2mn/SP4yNS5YvizttXoSlNRJlldXttivHNIHk07A==
MIME-Version: 1.0
X-Received: by 10.37.230.73 with SMTP id d70mr3008999ybh.138.1459121851023;
 Sun, 27 Mar 2016 16:37:31 -0700 (PDT)
Received: by 10.37.65.195 with HTTP; Sun, 27 Mar 2016 16:37:30 -0700 (PDT)
Date: Mon, 28 Mar 2016 00:37:30 +0100
Message-ID: <CADJx9LdsqRPpAPvkf4vh2uC9dc2xqUSZRMfFb+9roWfPhGwKdQ@HIDDEN>
Subject: switch-to-buffer-other-frame problem
From: jan <rtm443x@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

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.
-------




Acknowledgement sent to jan <rtm443x@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#23131; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 28 Mar 2016 11:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.