From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.help Subject: Re: MY window tree! Date: Sat, 13 Jan 2007 02:24:20 +0100 Message-ID: <45A834C4.10602@gmail.com> References: <87fyafsru9.fsf@lrde.org> <45A828DF.5080507@gmail.com> <87bql3sqi0.fsf@lrde.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1168651488 797 80.91.229.12 (13 Jan 2007 01:24:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 13 Jan 2007 01:24:48 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 13 02:24:46 2007 Return-path: Envelope-to: geh-help-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 1H5XdO-0006Jb-GG for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Jan 2007 02:24:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H5XdO-0005pZ-2r for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Jan 2007 20:24:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H5Xd7-0005pN-V9 for help-gnu-emacs@gnu.org; Fri, 12 Jan 2007 20:24:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H5Xd7-0005p4-Li for help-gnu-emacs@gnu.org; Fri, 12 Jan 2007 20:24:21 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H5Xd7-0005ox-Ba for help-gnu-emacs@gnu.org; Fri, 12 Jan 2007 20:24:21 -0500 Original-Received: from [80.76.149.212] (helo=ch-smtp01.sth.basefarm.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H5Xd6-00043Y-PN for help-gnu-emacs@gnu.org; Fri, 12 Jan 2007 20:24:21 -0500 Original-Received: from c83-254-145-24.bredband.comhem.se ([83.254.145.24]:65375 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1H5Xd4-0004Wt-5t; Sat, 13 Jan 2007 02:24:19 +0100 User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) Original-To: =?ISO-8859-1?Q?Micha=EBl_Cadilhac?= In-Reply-To: <87bql3sqi0.fsf@lrde.org> X-Antivirus: avast! (VPS 0702-1, 2007-01-11), Outbound message X-Antivirus-Status: Clean X-Scan-Result: No virus found in message 1H5Xd4-0004Wt-5t. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1H5Xd4-0004Wt-5t c749f109eaaad3e94ba13ada36849569 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:40274 Archived-At: Michaël Cadilhac wrote: > "Lennart Borgman (gmail)" writes: > >> Michaël Cadilhac wrote: >>> Hi! >>> >>> I've been playing around with window-tree to do the following : >>> - On M-x foo, a window is created on the extreme left of the frame, >>> containing a buffer called *Bar*, >>> - On M-x foo again, with the buffer *Bar* on the left, this window is >>> removed. >>> >>> Problem is, this can't be done with a simple split. So my first idea >>> was to reduce the frame to one window, split it: left would be *Bar* >>> and restore the window-tree in the right part. >>> >>> Of course, this can't work, because if I use delete-other-windows, the >>> windows are ... deleted. So, can't be restored. >>> >>> I can't find a way to do this simply, and I wonder if there is :-) >>> >>> How would you do? >> Using something like >> >> (window-buffer (nth 2 (car (window-tree)))) >> >> perhaps? > > Yeah, that's what I'm thinking about when I talk about « not > simple ways » :-) > > This implies to parse the window-tree, and for each leaves of the > tree, which is a window, get its buffer and its size; then store it in > another tree to restore it. > > Damn, I just want to create another root, this can't be that complex, > is it ? > > Thanks for you advice, however :-) A little bit more simple way out might be to look for the uppermost left window and see if that is *Bar*.