From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman" Newsgroups: gmane.emacs.help Subject: Re: Persistent Window Registers Date: Wed, 7 Jan 2009 23:26:39 +0100 Message-ID: References: <5c171af8-bc32-48cd-b114-4fdc599e9f03@o4g2000pra.googlegroups.com> <9e107126-498c-4b68-b354-427d2e1ce94b@u18g2000pro.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1231367233 23940 80.91.229.12 (7 Jan 2009 22:27:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Jan 2009 22:27:13 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Volkan YAZICI" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 07 23:28:22 2009 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 1LKgsv-0003LT-8l for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Jan 2009 23:28:21 +0100 Original-Received: from localhost ([127.0.0.1]:58231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKgrf-0000dJ-FN for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Jan 2009 17:27:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKgrL-0000d4-H7 for help-gnu-emacs@gnu.org; Wed, 07 Jan 2009 17:26:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKgrJ-0000cs-Cq for help-gnu-emacs@gnu.org; Wed, 07 Jan 2009 17:26:42 -0500 Original-Received: from [199.232.76.173] (port=58918 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKgrJ-0000cp-91 for help-gnu-emacs@gnu.org; Wed, 07 Jan 2009 17:26:41 -0500 Original-Received: from yx-out-1718.google.com ([74.125.44.154]:36592) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LKgrI-0001Qk-VS for help-gnu-emacs@gnu.org; Wed, 07 Jan 2009 17:26:41 -0500 Original-Received: by yx-out-1718.google.com with SMTP id 34so2884859yxf.66 for ; Wed, 07 Jan 2009 14:26:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=FIcDISU7amqZi7v2sF1xgYrjBVIFmZaVXZKdhApiU7U=; b=moG7uhPrTJJT4OgOVnCNndWtnlACFAobBzZEtVMOGHEFB4GdpPCqvEMOEXfUSBZUW5 gRFgSg52Irdl4DUL0pZ6WjiEcpiYaQ3BI+vRi7u4jmWBI04Ie+S51X6ah1DrU4BxoGOW kpP1vAZH+8QfB0ufykRfUVSjCDZGI8V6asa0Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=aO0Uv0/3iHtMTAhgD2LtT85aw6/Z5WJIeFysWJ5bBOEXPprPlxNaX9GlRvoA0jCB9y AZsarrAa9yC5uvGRdwhOETjLRtPtGenAkSlyUWKvBWcCTwVL2oKPVacAIm904MvbGAiP 0NrmnB3UyWDps40hyPb1+0JLcHr9TAjuSMJxE= Original-Received: by 10.151.42.10 with SMTP id u10mr671042ybj.155.1231367200267; Wed, 07 Jan 2009 14:26:40 -0800 (PST) Original-Received: by 10.151.117.1 with HTTP; Wed, 7 Jan 2009 14:26:39 -0800 (PST) In-Reply-To: <9e107126-498c-4b68-b354-427d2e1ce94b@u18g2000pro.googlegroups.com> Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:61166 Archived-At: On Wed, Jan 7, 2009 at 2:03 PM, Volkan YAZICI wrote: > On Jan 5, 12:50 pm, "Lennart Borgman" > wrote: >> See winsav.el in nXhtml > > After spending some time, I found out that there is no easy way to > save window configurations. Instead, as nXhtml, people Hi Volkan, I am not sure what you mean and it is a long time since I wrote winsav.el. Are the things you need missing in winsav.el? > 1. Walk through available window configurations they are interested > in, > > 2. Copy attributes (buffer name, buffer start/end position, etc.) of > the walked windows, > > And in later sessions, using saved window attributes > > 3. Open same buffers one by one in specific windows, > > 4. Then resize opened windows according to the saved attributes. > > On Jan 4, 6:10 pm, Volkan YAZICI wrote: >> - C-x r j 1 (*Group*) >> - C-x r j 2 (#postgresql and #lisp buffers divided vertically) > > To summarize, here is the solution I came up with: > > (defun erc-register-window-configuration () > "Register vertically split `#postgresql' and `#lisp' channel windows > into > configuration 2." > (let ((psql-buf (get-buffer "#postgresql")) > (lisp-buf (get-buffer "#lisp"))) > (cond ((and psql-buf lisp-buf) > (switch-to-buffer psql-buf) > (delete-other-windows) > (recenter) > (select-window (split-window-horizontally)) > (switch-to-buffer lisp-buf) > (recenter) > (window-configuration-to-register ?2)) > (t (warn "Couldn't find buffers `#postgresql' and `#lisp'."))))) > > (add-hook 'erc-join-hook 'erc-register-window-configuration) > > (defun gnus-register-window-configuration () > "Register a whole `*Group*' buffer window into configuration 1." > (let ((group-buf (get-buffer "*Group*"))) > (when group-buf > (switch-to-buffer group-buf) > (delete-other-windows) > (beginning-of-buffer) > (window-configuration-to-register ?1)))) > > (add-hook 'gnus-started-hook 'gnus-register-window-configuration) > > > Regards. >