From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Haines Brown Newsgroups: gmane.emacs.help Subject: Re: How to pickle split window? Date: Sat, 09 Mar 2013 08:15:33 -0500 Message-ID: <87mwucemtm.fsf@engels.HistoricalMaterialism.info> References: <87vc92dt4u.fsf@engels.HistoricalMaterialism.info> <87r4jpejyn.fsf@engels.HistoricalMaterialism.info> <44a9qd398u.fsf@lowell-desk.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1362847057 24326 80.91.229.3 (9 Mar 2013 16:37:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Mar 2013 16:37:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 09 17:38:02 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 1UEMmT-00034Q-64 for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Mar 2013 17:37:57 +0100 Original-Received: from localhost ([::1]:46494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEMm7-0001fg-6V for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Mar 2013 11:37:35 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Sat, 09 Mar 2013 07:15:33 -0600 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:Mab7ytxHxfmjNRk8wPOrcrgjArs= Original-Lines: 66 X-Usenet-Provider: http://www.giganews.com Original-X-Trace: sv3-c3n3pgVAHlEKbWhO/D5SY+DbsBKN+ZugwQiTIuF19rgBxIJVi4VF1aOU44y+YcYcyq2qVczAgmKJLbe!CvXwdFUMR9pEcKlW20kXFtjxx3cm8I2lKMNJ26odYaF3DghPpcKILytqC7FOkKRZmhC2qbhyDCMz!WRuZ Original-X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 4424 Original-Xref: usenet.stanford.edu gnu.emacs.help:197158 X-Mailman-Approved-At: Sat, 09 Mar 2013 11:36:49 -0500 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:89443 Archived-At: Lowell Gilbert writes: > Haines Brown writes: >> Sorry I was not clearer. I understand there are commands to restore >> previous window layout, but my interest was for it to be automatic, >> so that for example when I close gnus, emacs returns automatically to >> the prior windows layout. It would even be nice to return >> automatically to the the prior buffers displayed in those windows. Several well-meaning replies assume that I'm up to lisp encoding, but I'm a historian by trade and lack the skill. Earlier suggestions to pickle the layout in a variable and restore it by command are equivalent (in terms of number of key strokes required) to what I now do, which is simply to reload emacs. This recovers the split window. But the real problem is that I have also to take the further steps to recover the previous buffers to display them in the two windows, and that is an annoyance. > Your idea makes sense, but perhaps you should consider creating a > function to provide your preferred setup for what you consider your > normal state. That way, you could invoke it not just as a matter of > restoring state, but of configuring it in the first place. Ideally I would redefine the reload command to recall the most recent buffer that had been displayed in each window before running gnus, but don't know how to do it: (defun reload () "Reloads .emacs interactively." (interactive) (load "~/.emacs" )) > It sounds like you're not running with any 'window-system'. If you > were, the obvious answer would be to open a new window for your > temporary distractions. I run a window system (fluxbox), but no desktop environment (gnome, etc). As things are now I run a five applications constantly on virtual desktops, mutt, jabref, conkeror, and two instances of emacs, one for writing and other for research. Since I'm used to jumping from one virtual desktop to another I could simply run gnus permanently in yet another instance of emacs on a new virtual desktop. It had occurred to me to do this, but I was looking for a more lighweight solution. Another approach might be to run a dedicated instance of emacs that calls gnus automatically. For example, I presently have a fluxbox key command that employs a script to run a small simple instance of emacs in lieu of opening a terminal for running nano. This script has emacs create an empty temporary file in text mode rather than start with a scratch buffer in lisp mode. I need to improve this by a) running it as an emacs client, and b) have it act like scratch buffer in that it redefines C-x C-s command to "write-named-file" (I want to avoid saving the temporary file). Howevever, this line in init file returns error that the function definition is void: (global-set-key (kbd "C-x C-s") 'write-named-file) Perhaps I could have a key command start a script that starts an instance of emacs client that automatically runs gnus, but I don't know how to start emacs running a function rather than create/open a file. Am I fantasizing here? Haines