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

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

Re: How to persist registers across sessions?


From: Eli Zaretskii
Subject: Re: How to persist registers across sessions?
Date: Fri, 01 Jul 2022 10:19:22 +0300

> Date: Fri, 1 Jul 2022 10:03:13 +0300
> From: Jean Louis <bugs@gnu.support>
> Cc: help-gnu-emacs@gnu.org
> 
> So I try this way:
> 
> (prin1-to-string (window-state-get (get-buffer-window))) ⇒ "(((min-height . 
> 4) (min-width . 10) (min-height-ignore . 3) (min-width-ignore . 6) 
> (min-height-safe . 1) (min-width-safe . 2) (min-pixel-height . 76) 
> (min-pixel-width . 100) (min-pixel-height-ignore . 57) 
> (min-pixel-width-ignore . 60) (min-pixel-height-safe . 19) 
> (min-pixel-width-safe . 20)) leaf (pixel-width . 1592) (pixel-height . 779) 
> (total-width . 159) (total-height . 41) (normal-height . 1.0) (normal-width . 
> 1.0) (parameters (clone-of . #<window 2515 on 
> mutt-protected-1001-4153-16793396821956371330>)) (buffer #<buffer 
> mutt-protected-1001-4153-16793396821956371330> (selected . t) (hscroll . 0) 
> (fringes 8 8 nil nil) (margins nil) (scroll-bars nil 2 t nil 0 t nil) 
> (vscroll . 0) (dedicated) (point . #<marker at 1892 in 
> mutt-protected-1001-4153-16793396821956371330>) (start . #<marker at 1065 in 
> mutt-protected-1001-4153-16793396821956371330>)) (prev-buffers (#<buffer 
> mutt-protected-1001-4153-16793396821956371330> #<marker at 1 in 
> mutt-protected-1001-4153-16793396821956371330> #<marker at 2287 in 
> mutt-protected-1001-4153-16793396821956371330>) (#<buffer Downloads> #<marker 
> at 1164 in Downloads> #<marker at 1715 in Downloads>)))"
> 
> But I cannot read it back:

I don't think you described what exactly you'd like to do with the
window config information.  So the answers you get don't satisfy your
needs, because you didn't describe those needs in sufficient detail.

> > Another possibility is to use frameset-save.  (Not surprisingly,
> > desktop.el already uses it.)
> 
> I have been testing, I see the output of below command, and it looks
> like it does what it says, saving frameset.
> 
> (frameset-save (frame-list)) 
> 
> It should be possible to "read" back from there:
> 
> (read-from-string (prin1-to-string (frameset-save (frame-list))))
> 
> However, I get this error:
> 
> eval: Invalid read syntax: "#" probably because somewhere inside I find this:

If you want to restore the configuration recorded by frameset-save,
you should use frameset-restore.

> However, frame set is not what I meant, as it also contains many
>  variables and what other not necessary information.
> 
> I meant window set, not a frame set.

Windows belong to frames.  Any window-configuration data is
meaningless without the corresponding frame data.



reply via email to

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