From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex =?utf-8?Q?Benn=C3=A9e?= Newsgroups: gmane.emacs.help Subject: Re: Saving the frame layout between frames Date: Mon, 28 Oct 2013 12:50:29 +0000 Message-ID: <87wqkxbluy.fsf@bennee.com> References: <87ob6a5y46.fsf@linaro.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1382964952 20034 80.91.229.3 (28 Oct 2013 12:55:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Oct 2013 12:55:52 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 28 13:55:56 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VamMO-0006XL-Dw for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Oct 2013 13:55:56 +0100 Original-Received: from localhost ([::1]:41300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VamMN-0001HZ-Um for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Oct 2013 08:55:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VamM2-0001FZ-9U for help-gnu-emacs@gnu.org; Mon, 28 Oct 2013 08:55:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VamLy-00070J-1V for help-gnu-emacs@gnu.org; Mon, 28 Oct 2013 08:55:34 -0400 Original-Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:44234 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VamLx-0006zW-Kx for help-gnu-emacs@gnu.org; Mon, 28 Oct 2013 08:55:29 -0400 Original-Received: from localhost ([127.0.0.1]) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1VamNn-0004Ng-D2; Mon, 28 Oct 2013 13:57:23 +0100 User-agent: mu4e 0.9.9.6pre2; emacs 24.3.1 X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: kernel-hacker@bennee.com X-SA-Exim-Scanned: No (on socrates.bennee.com); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 88.198.71.155 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94229 Archived-At: In-reply-to: monnier@iro.umontreal.ca writes: >> (setq crmbk-previous-frame-config (current-window-configuration)) > > window-configurations can't be transferred between frames. > In recent Emacsen, a new data-structure was introduced which can be used > between frames, called `window-state'. > > You can use window-state-get and then window-state-put. That almost works. I've certainly got a structure that I can use to reset the frame configuration manually now. However if I call it in the new frame handler: (defun crmbk-new-frame-handler (frame) "Do any appropriate set-up on new frame creation. This is intended to be called during after-make-frame-functions" (when (frame-parameter frame 'display) (set-frame-parameter frame 'fullscreen 'fullboth) (setq crmbk-current-frame frame) (when crmbk-previous-frame-config (window-state-put crmbk-previous-frame-config)) (crmbk-frame-mode t))) The new frame hangs until I C-g at which point *Messages* reads: window-state-put: Window # too small to accommodate state Quit Error in post-command-hook (winner-save-old-configurations): (error "Window is on a different frame") Should I restore the frame configuration on a later hook? -- Alex Bennée