help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to pickle split window?


From: Haines Brown
Subject: Re: How to pickle split window?
Date: Sat, 09 Mar 2013 08:15:33 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Lowell Gilbert <lgusenet@be-well.ilk.org> writes:

> Haines Brown <haines@histomat.net> 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" <with the prior buffers in each window>))

> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]