From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Volkan YAZICI Newsgroups: gmane.emacs.help Subject: Re: Persistent Window Registers Date: Wed, 7 Jan 2009 05:03:48 -0800 (PST) Organization: http://groups.google.com Message-ID: <9e107126-498c-4b68-b354-427d2e1ce94b@u18g2000pro.googlegroups.com> References: <5c171af8-bc32-48cd-b114-4fdc599e9f03@o4g2000pra.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1231335653 28923 80.91.229.12 (7 Jan 2009 13:40:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Jan 2009 13:40:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 07 14:42:04 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 1LKYfX-0007fY-Kl for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Jan 2009 14:41:59 +0100 Original-Received: from localhost ([127.0.0.1]:60133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKYeH-0000h2-T6 for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Jan 2009 08:40:41 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!u18g2000pro.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 56 Original-NNTP-Posting-Host: 85.235.85.86 Original-X-Trace: posting.google.com 1231333428 27020 127.0.0.1 (7 Jan 2009 13:03:48 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 7 Jan 2009 13:03:48 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u18g2000pro.googlegroups.com; posting-host=85.235.85.86; posting-account=xozGQQoAAAD99EQH9srmwM1ajggyokYW User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.18) Gecko/20081030 Iceweasel/2.0.0.18 (Debian-2.0.0.18-0etch1), gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:165827 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:61161 Archived-At: 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 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.