From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#5405: select-frame losing current-buffer Date: Sun, 17 Jan 2010 13:26:40 -0800 Message-ID: <6E0FDFA6388E41B2A6373E4D21D96387@us.oracle.com> References: <87my0c7b4k.fsf@stupidchicken.com> <19283.28996.281000.798673@gargle.gargle.HOWL> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1263764379 6930 80.91.229.12 (17 Jan 2010 21:39:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Jan 2010 21:39:39 +0000 (UTC) Cc: 5405@debbugs.gnu.org To: "'Uday S Reddy'" , "'Chong Yidong'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 17 22:39:30 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NWcqH-000296-28 for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Jan 2010 22:39:29 +0100 Original-Received: from localhost ([127.0.0.1]:37772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWcqI-0007mg-19 for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Jan 2010 16:39:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NWcqD-0007mb-RU for bug-gnu-emacs@gnu.org; Sun, 17 Jan 2010 16:39:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NWcq8-0007mP-4Z for bug-gnu-emacs@gnu.org; Sun, 17 Jan 2010 16:39:24 -0500 Original-Received: from [199.232.76.173] (port=34244 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWcq7-0007mM-TZ for bug-gnu-emacs@gnu.org; Sun, 17 Jan 2010 16:39:19 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58037) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NWcq7-00078b-Dx for bug-gnu-emacs@gnu.org; Sun, 17 Jan 2010 16:39:19 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NWcgA-0004pI-A3; Sun, 17 Jan 2010 16:29:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Jan 2010 21:29:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5405 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5405-submit@debbugs.gnu.org id=B5405.126376368918539 (code B ref 5405); Sun, 17 Jan 2010 21:29:02 +0000 Original-Received: (at 5405) by debbugs.gnu.org; 17 Jan 2010 21:28:09 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NWcfJ-0004oy-20 for submit@debbugs.gnu.org; Sun, 17 Jan 2010 16:28:09 -0500 Original-Received: from acsinet11.oracle.com ([141.146.126.233]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NWcfH-0004or-Cp for 5405@debbugs.gnu.org; Sun, 17 Jan 2010 16:28:07 -0500 Original-Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by acsinet11.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o0HLRtLw015243 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 17 Jan 2010 21:27:57 GMT Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o0HLDURO014772; Sun, 17 Jan 2010 21:27:55 GMT Original-Received: from abhmt001.oracle.com by acsmt356.oracle.com with ESMTP id 1345722251263763588; Sun, 17 Jan 2010 13:26:28 -0800 Original-Received: from dradamslap1 (/24.5.185.59) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 17 Jan 2010 13:26:28 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <19283.28996.281000.798673@gargle.gargle.HOWL> Thread-Index: AcqXtS1lgqmSCaURTxaoF8TcfbVZQwAAndsw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt354.oracle.com [141.146.40.154] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090206.4B5380DB.00DB:SCFMA4539814,ss=1,fgs=0 X-Spam-Score: -6.3 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -6.3 (------) Resent-Date: Sun, 17 Jan 2010 16:29:02 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:34432 Archived-At: > > > The documentation of make-frame says that current-buffer > > > continues to selected in the new frame. The > > > documentation of select-frame doesn't > > > say anything about the matter, but one would normally > > > expect that the current-buffer should still remain the same. ... > > > I presume that the space at the beginning of the buffer name is > > > a partial cause of this misbehaviour. > > > > This is deliberate behavior dating back about a decade > > (frame.c:392). Buffers whose names start with a space are > > considered "hidden buffers" that should not ordinarily be > > displayed (e.g. they don't show up in M-x list-buffers either). > > I'll update the documentation to mention this. > > Thanks very much for the quick response. But I am not convinced the > hidden buffer idea explains the behaviour I found. Before doing > select-frame, the "hidden buffer" is the current buffer. For whatever > reason, the user or the code chose it as the current buffer. I don't > believe that the buffer should be forcibly dumped and the focus placed > on some other random buffer that happens to be around. > > This behaviour was found in maintaining VM which, for some indepdent > reasons, chose a buffer name with a leading space, and some serious > buffer corruption resulted from it. This seems dangerous, undesirable > behaviour. > > I have now modified VM to avoid the leading space. So the issue > doesn't affect me any more. But it took me a day's labour to find the > problem. I hope there won't be others who will get simiarly burned. Without speaking directly to what `select-frame'/`make-frame' should do in this regard, let me say that speaking in terms of "normally expect" (Uday) and "should not ordinarily" (Yidong) simply begs the question. No such general rule can answer the question completely for this particular situation. By _default_, in many common situations, such buffers are hidden or ignored in some _particular sense_ - for example, as completion candidates. That does not mean that they must or should be ignored in all contexts, or that users should not have a way to override a default behavior that ignores them. The reason for such a general/default/common treatment is more important than the "rule" itself, as only it provides guidance. The reason is that not ignoring such buffers can distract or confuse users. Users _typically_ do not need to consider such buffers - they just get in the way. But the fact that users _can_ consider them if they want (including for completion) speaks to not casting such a generally helpful rule in concrete. IOW, the question was raised - for `select-frame'/`make-frame' in particular - and it is still raised (unanswered). The argument that such buffers must by definition be ignored is not a valid one. It begs the question to be answered - both generally, and in this particular case. Wrt `select-frame'/`make-frame': I'm not sure what the right behavior is. If, as Uday says, the "hidden" buffer was already chosen then, analogously to completion when the user explicitly types a pattern that chooses an otherwise hidden buffer, that choice should probably be respected. If the user types `foo.log' or ` *foo*' during completion, we don't refuse to give access to that buffer under the pretext that it is a hidden buffer. If a program or user has already chosen, then we should probably let it be. But there might be other considerations for this particular case, which would also need to be taken into account - dunno. Only attention to the details can help, not some general rule about a priori hiddenness.