all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Uday S Reddy <u.s.reddy@cs.bham.ac.uk>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: 5405@debbugs.gnu.org, Uday S Reddy <u.s.reddy@cs.bham.ac.uk>
Subject: bug#5405: select-frame losing current-buffer
Date: Sun, 17 Jan 2010 20:21:24 +0000	[thread overview]
Message-ID: <19283.28996.281000.798673@gargle.gargle.HOWL> (raw)
In-Reply-To: <87my0c7b4k.fsf@stupidchicken.com>

Dear Chong,

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.

Cheers,
Uday



Chong Yidong writes:

> Uday S Reddy <u.s.reddy@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.
> 
> 






  reply	other threads:[~2010-01-17 20:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-17 18:26 bug#5405: select-frame losing current-buffer Uday S Reddy
2010-01-17 20:02 ` Chong Yidong
2010-01-17 20:21   ` Uday S Reddy [this message]
2010-01-17 21:26     ` Drew Adams
2010-01-18  8:11 ` martin rudalics
2010-01-18 15:32   ` Uday S Reddy
2011-09-18 11:45     ` Lars Magne 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19283.28996.281000.798673@gargle.gargle.HOWL \
    --to=u.s.reddy@cs.bham.ac.uk \
    --cc=5405@debbugs.gnu.org \
    --cc=cyd@stupidchicken.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.