GNU bug report logs - #5405
select-frame losing current-buffer

Previous Next

Package: emacs;

Reported by: Uday S Reddy <u.s.reddy <at> cs.bham.ac.uk>

Date: Sun, 17 Jan 2010 18:28:01 UTC

Severity: normal

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Uday S Reddy <u.s.reddy <at> cs.bham.ac.uk>
Cc: 5405 <at> debbugs.gnu.org
Subject: bug#5405: select-frame losing current-buffer
Date: Sun, 17 Jan 2010 15:02:51 -0500
Uday S Reddy <u.s.reddy <at> cs.bham.ac.uk> writes:

> 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.  However, the following
> example shows that select-frame loses the current-buffer:
>
> (defun testing ()
>   (interactive)
>   (let ((new-buffer (get-buffer-create " testing")))
>     (set-buffer new-buffer)
>     (select-frame (make-frame nil))
>     (if (not (equal (current-buffer) new-buffer))
> 	(debug))))
>
> 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.




This bug report was last modified 13 years and 252 days ago.

Previous Next


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