all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: Don.Bashford@stjude.org, emacs-devel@gnu.org
Subject: Re: select-window doesn't always make that window's buffer current
Date: Thu, 03 Jun 2004 11:56:47 -0400	[thread overview]
Message-ID: <E1BVuaF-0001H4-5F@fencepost.gnu.org> (raw)
In-Reply-To: <1086193535.5548.7.camel@hc-dbashfor.stjude.org> (message from Don Bashford on 02 Jun 2004 11:25:33 -0500)

    (setq a (get-buffer-create "A"))
    (setq b (get-buffer-create "B"))

    ;; Now arrange the frame so A is in one window and B is in another
    ;; and select B.  Then M-: eval the following:

    (progn 
      (set-buffer a) 
      (select-window (get-buffer-window b))
      (current-buffer))

    ;; the result is #<buffer A>. But the documentation says

This result happens because the window you're trying to select
is already selected.  In that case, select-window doesn't really
do anything.

    ;; The initial (set-buffer a), which gets the current-buffer and the
    ;; selected-window out of sync seems to be needed to trigger this
    ;; effect.

Without that, select-window would still do nothing, but that would
not be surprising since the buffer in that window would already
be selected.

I could change selected-window so that it selects the specified
window's buffer even if that window is already selected.  However, I
think that might break some programs.  We could try it and see.
Perhaps it would be better to document the current behavior.

  reply	other threads:[~2004-06-03 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-02 16:25 select-window doesn't always make that window's buffer current Don Bashford
2004-06-03 15:56 ` Richard Stallman [this message]
2004-06-03 16:18   ` Don Bashford
2004-06-05 13:49     ` Richard Stallman

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=E1BVuaF-0001H4-5F@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=Don.Bashford@stjude.org \
    --cc=emacs-devel@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 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.