From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eric Pement" Newsgroups: gmane.emacs.help Subject: Q: How can I swap buffers in two windows? Date: 22 Sep 2005 08:39:43 -0700 Organization: http://groups.google.com Message-ID: <1127403583.568067.179950@g43g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1127404420 3790 80.91.229.2 (22 Sep 2005 15:53:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 22 Sep 2005 15:53:40 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 22 17:53:39 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EITL8-0003xI-WA for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Sep 2005 17:50:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EITL8-0005zY-Bg for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Sep 2005 11:50:26 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!g43g2000cwa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Original-NNTP-Posting-Host: 66.185.249.65 Original-X-Trace: posting.google.com 1127403588 15254 127.0.0.1 (22 Sep 2005 15:39:48 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 22 Sep 2005 15:39:48 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g43g2000cwa.googlegroups.com; posting-host=66.185.249.65; posting-account=63lmNgwAAABqjm0XxoXi1UjvjQ6CohmC Original-Xref: shelby.stanford.edu gnu.emacs.help:134073 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:29636 Archived-At: This request has appeared several times on this newsgroup, worded in different ways, but has never been answered. I have already checked the FAQ, M-x apropos, and the Emacs info pages. Can someone please give help or direction here? I have an Emacs frame split into two windows, which may be split vertically or horizontally. I would like a single command to swap or exchange both windows, i.e., put buffer A into window B, and put buffer B into window A. If there are not exactly two windows in the frame, issue an error message. I know that I can do "C-x b", {B}, , "C-x o", "C-x b", {A}, , but I want to execute it with a single command without typing out the buffer names at all. Emacs already knows the names of the buffers in each window, so why should I have to type them? My elisp skills are not well-developed, so I'm asking for help. I have GNU Emacs version 21.3.50.8. Thanks in advance. -- Eric Pement