unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* emacs save/restore state?
@ 2012-04-07 16:01 Nelson H. F. Beebe
  2012-04-07 16:15 ` Andreas Schwab
  0 siblings, 1 reply; 13+ messages in thread
From: Nelson H. F. Beebe @ 2012-04-07 16:01 UTC (permalink / raw)
  To: emacs-devel; +Cc: beebe

Is anyone on this list aware of functions to save and restore emacs
state, including all buffers (both temporary and file-related),
command history, kill-ring, and loaded emacs libraries?

I frequently want the ability to switch from one emacs session to
another, sometimes after a version upgrade, and other times between
different machines.  Because my emacs sessions frequently run for many
months, the state is complex, and painful to reconstruct.  Computers
should work for people, not the other way around, so it would be nice
to do something like this:

	M-x save-state<RETurn>
	Filename: $HOME/emacs.state

	M-x restore-state<RETurn>
	Filename: $HOME/emacs.state

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe@math.utah.edu  -
- 155 S 1400 E RM 233                       beebe@acm.org  beebe@computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: emacs save/restore state?
  2012-04-07 16:01 emacs save/restore state? Nelson H. F. Beebe
@ 2012-04-07 16:15 ` Andreas Schwab
  2012-04-07 17:05   ` Nelson H. F. Beebe
  0 siblings, 1 reply; 13+ messages in thread
From: Andreas Schwab @ 2012-04-07 16:15 UTC (permalink / raw)
  To: Nelson H. F. Beebe; +Cc: emacs-devel

"Nelson H. F. Beebe" <beebe@math.utah.edu> writes:

> Is anyone on this list aware of functions to save and restore emacs
> state, including all buffers (both temporary and file-related),
> command history, kill-ring, and loaded emacs libraries?

Does desktop-save work?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: emacs save/restore state?
  2012-04-07 16:15 ` Andreas Schwab
@ 2012-04-07 17:05   ` Nelson H. F. Beebe
  2012-04-07 17:11     ` Drew Adams
  2012-04-16 18:04     ` Philipp Haselwarter
  0 siblings, 2 replies; 13+ messages in thread
From: Nelson H. F. Beebe @ 2012-04-07 17:05 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Nelson H. F. Beebe, emacs-devel

>> ...
>> > Is anyone on this list aware of functions to save and restore emacs
>> > state, including all buffers (both temporary and file-related),
>> > command history, kill-ring, and loaded emacs libraries?
>> 
>> Does desktop-save work?
>> ...

Thanks!  M-x desktop-save and M-x desktop-read get most of what I
want. 

Three things that I noted are missing are (1) a time-ordered list of
loaded libraries, (2) the kill ring, and (3) the command history.

The search history is saved, and that is certainly nice.

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe@math.utah.edu  -
- 155 S 1400 E RM 233                       beebe@acm.org  beebe@computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: emacs save/restore state?
  2012-04-07 17:05   ` Nelson H. F. Beebe
@ 2012-04-07 17:11     ` Drew Adams
  2012-04-09  2:27       ` Stefan Monnier
  2012-04-09 12:26       ` Dave Abrahams
  2012-04-16 18:04     ` Philipp Haselwarter
  1 sibling, 2 replies; 13+ messages in thread
From: Drew Adams @ 2012-04-07 17:11 UTC (permalink / raw)
  To: 'Nelson H. F. Beebe', 'Andreas Schwab'; +Cc: emacs-devel

> >> Does desktop-save work?
> 
> Thanks!  M-x desktop-save and M-x desktop-read get most of what I
> want. 
> 
> Three things that I noted are missing are (1) a time-ordered list of
> loaded libraries, (2) the kill ring, and (3) the command history.
> The search history is saved, and that is certainly nice.

See also `savehist.el' and option `save-additional-variables'.
Try vars `load-history', `kill-ring', and `command-history'.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: emacs save/restore state?
  2012-04-07 17:11     ` Drew Adams
@ 2012-04-09  2:27       ` Stefan Monnier
  2012-04-09  2:52         ` Drew Adams
  2012-04-09 12:26       ` Dave Abrahams
  1 sibling, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2012-04-09  2:27 UTC (permalink / raw)
  To: Drew Adams
  Cc: 'Andreas Schwab', 'Nelson H. F. Beebe',
	emacs-devel

> See also `savehist.el' and option `save-additional-variables'.
> Try vars `load-history', `kill-ring', and `command-history'.

Nitpick: `load-history' is not a variable you should touch in this
way, tho (e.g. it won't magically load the corresponding libraries).
Also he may also want to use `desktop-globals-to-save' instead of
savehist.el.


        Stefan



^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: emacs save/restore state?
  2012-04-09  2:27       ` Stefan Monnier
@ 2012-04-09  2:52         ` Drew Adams
  0 siblings, 0 replies; 13+ messages in thread
From: Drew Adams @ 2012-04-09  2:52 UTC (permalink / raw)
  To: 'Stefan Monnier'
  Cc: 'Andreas Schwab', 'Nelson H. F. Beebe',
	emacs-devel

> > See also `savehist.el' and option `save-additional-variables'.
> > Try vars `load-history', `kill-ring', and `command-history'.
> 
> Nitpick: `load-history' is not a variable you should touch in this
> way, tho (e.g. it won't magically load the corresponding libraries).
> Also he may also want to use `desktop-globals-to-save' instead of
> savehist.el.

Agreed.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: emacs save/restore state?
  2012-04-07 17:11     ` Drew Adams
  2012-04-09  2:27       ` Stefan Monnier
@ 2012-04-09 12:26       ` Dave Abrahams
  1 sibling, 0 replies; 13+ messages in thread
From: Dave Abrahams @ 2012-04-09 12:26 UTC (permalink / raw)
  To: emacs-devel


on Sat Apr 07 2012, "Drew Adams" <drew.adams-AT-oracle.com> wrote:

>> >> Does desktop-save work?
>> 
>> Thanks!  M-x desktop-save and M-x desktop-read get most of what I
>> want. 
>> 
>> Three things that I noted are missing are (1) a time-ordered list of
>> loaded libraries, (2) the kill ring, and (3) the command history.
>> The search history is saved, and that is certainly nice.
>
> See also `savehist.el' and option `save-additional-variables'.
> Try vars `load-history', `kill-ring', and `command-history'.

I use session.el to get history saving.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: emacs save/restore state?
  2012-04-07 17:05   ` Nelson H. F. Beebe
  2012-04-07 17:11     ` Drew Adams
@ 2012-04-16 18:04     ` Philipp Haselwarter
  2012-05-15 21:11       ` Stefan Monnier
  1 sibling, 1 reply; 13+ messages in thread
From: Philipp Haselwarter @ 2012-04-16 18:04 UTC (permalink / raw)
  To: emacs-devel

A suggestion of variables I find useful:

--8<---------------cut here---------------start------------->8---
desktop-globals-to-save
(append
 '((extended-command-history . 128)
   (minibuffer-history       . 128)
   (org-clock-history        .  32)
   (query-replace-history    . 128)
   (read-expression-history  . 256)
   (regexp-history           . 128)
   (regexp-search-ring       . 128)
   (search-ring              . 128)
   (shell-command-history    . 128)
   compile-history
   desktop-buffer-args-list
   dired-regexp-history
   dired-shell-command-history
   find-args-history
   gnus-group-history
   grep-history
   gud-gdb-history
   jde-interactive-make-arg-history
   kill-ring
   log-edit-comment-ring
   magit-git-command-history
   my-xdg-history)
 desktop-globals-to-save)
--8<---------------cut here---------------end--------------->8---


-- 
Philipp Haselwarter




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: emacs save/restore state?
  2012-04-16 18:04     ` Philipp Haselwarter
@ 2012-05-15 21:11       ` Stefan Monnier
  2012-05-15 21:22         ` Drew Adams
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2012-05-15 21:11 UTC (permalink / raw)
  To: Philipp Haselwarter; +Cc: emacs-devel

> A suggestion of variables I find useful:

Any reason why you don't use savehist-mode?
This said, the redundancy between the two is a bit annoying, tho I'm not
sure how to get rid of it.


        Stefan



^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: emacs save/restore state?
  2012-05-15 21:11       ` Stefan Monnier
@ 2012-05-15 21:22         ` Drew Adams
  2012-05-16  2:30           ` Stefan Monnier
  0 siblings, 1 reply; 13+ messages in thread
From: Drew Adams @ 2012-05-15 21:22 UTC (permalink / raw)
  To: 'Stefan Monnier', 'Philipp Haselwarter'; +Cc: emacs-devel

> > A suggestion of variables I find useful:
> 
> Any reason why you don't use savehist-mode?
> This said, the redundancy between the two is a bit annoying, 
> tho I'm not sure how to get rid of it.

FYI, this was discussed in a fair amount of length on emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2007-12/msg00583.html




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: emacs save/restore state?
  2012-05-15 21:22         ` Drew Adams
@ 2012-05-16  2:30           ` Stefan Monnier
  2012-05-16 13:24             ` Drew Adams
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2012-05-16  2:30 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-devel, 'Philipp Haselwarter'

>> > A suggestion of variables I find useful:
>> Any reason why you don't use savehist-mode?
>> This said, the redundancy between the two is a bit annoying, 
>> tho I'm not sure how to get rid of it.
> FYI, this was discussed in a fair amount of length on emacs-devel:
> http://lists.gnu.org/archive/html/emacs-devel/2007-12/msg00583.html

The problem was discussed, but not the (potential) solution.


        Stefan



^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: emacs save/restore state?
  2012-05-16  2:30           ` Stefan Monnier
@ 2012-05-16 13:24             ` Drew Adams
  2012-05-16 14:38               ` Stefan Monnier
  0 siblings, 1 reply; 13+ messages in thread
From: Drew Adams @ 2012-05-16 13:24 UTC (permalink / raw)
  To: 'Stefan Monnier'; +Cc: emacs-devel, 'Philipp Haselwarter'

> >> This said, the redundancy between the two is a bit annoying, 
> >> tho I'm not sure how to get rid of it.
> > FYI, this was discussed in a fair amount of length on emacs-devel:
> > http://lists.gnu.org/archive/html/emacs-devel/2007-12/msg00583.html
> The problem was discussed, but not the (potential) solution.

True.  This wishlist occurs to me, to keep in mind when looking for a solution:

1. Factoring out some code commonality would be good (modulo other wishes).

2. Users should be able to save histories without necessarily saving all the
other desktop stuff.

3. Users should be able to save other desktop stuff without necessarily saving
histories.

4. Users can save multiple desktops, which should be able to have different
saved histories.  IOW, a given history variable, e.g., `file-name-history',
could have a different saved value in different desktops.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: emacs save/restore state?
  2012-05-16 13:24             ` Drew Adams
@ 2012-05-16 14:38               ` Stefan Monnier
  0 siblings, 0 replies; 13+ messages in thread
From: Stefan Monnier @ 2012-05-16 14:38 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-devel, 'Philipp Haselwarter'

> True.  This wishlist occurs to me, to keep in mind when looking for
> a solution:
> 1. Factoring out some code commonality would be good (modulo other wishes).
> 2. Users should be able to save histories without necessarily saving
>    all the other desktop stuff.
> 3. Users should be able to save other desktop stuff without
>    necessarily saving histories.
> 4. Users can save multiple desktops, which should be able to have
>    different saved histories.  IOW, a given history variable, e.g.,
>    `file-name-history', could have a different saved value in
>    different desktops.

Agreed.  I think the way forward is to restructure the code so
desktop.el can use savehist-mode (e.g. so it can tell it where/when to
save the history).

There's a similar issue with saveplace.el (again, with slightly
different semantic but no good reason why saveplace.el can't provide the
needed flexibility for desktop.el to use it and let the user choose
between the usual desktop.el semantics or the usual saveplace.el
semantics).


        Stefan



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-05-16 14:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-07 16:01 emacs save/restore state? Nelson H. F. Beebe
2012-04-07 16:15 ` Andreas Schwab
2012-04-07 17:05   ` Nelson H. F. Beebe
2012-04-07 17:11     ` Drew Adams
2012-04-09  2:27       ` Stefan Monnier
2012-04-09  2:52         ` Drew Adams
2012-04-09 12:26       ` Dave Abrahams
2012-04-16 18:04     ` Philipp Haselwarter
2012-05-15 21:11       ` Stefan Monnier
2012-05-15 21:22         ` Drew Adams
2012-05-16  2:30           ` Stefan Monnier
2012-05-16 13:24             ` Drew Adams
2012-05-16 14:38               ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).