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: Jean Louis
Subject: Re: How to persist registers across sessions?
Date: Sat, 2 Jul 2022 20:19:51 +0300
User-agent: Mutt/+ () (2022-05-21)

* Eli Zaretskii <eliz@gnu.org> [2022-07-02 12:05]:
> > Date: Sat, 2 Jul 2022 11:46:49 +0300
> > From: Jean Louis <bugs@gnu.support>
> > Cc: help-gnu-emacs@gnu.org
> > 
> > Purpose is to isolate that information and become able to store it on
> > file or inside of the database, so that I can use a key to set some of
> > preset window configurations from session to session and in quick
> > manner.
> 
> "Use" it how?  To do what with those "preset window configurations"?
> That was my question, and you didn't really answer it.

I would do:

1. Get string of Lisp data by using prin1-to-string

2. Store it in the database or file, but I do not prefer files.

3. In future, choose specific window configuration, or select it, and
   invoke it by loading it from database, or in case of other users from
   file.

It would enable me to have several buffers and workflow in such window
setup that is favorable for work.

> I pointed to frameset.el, which is a lower-level infrastructure used
> by desktop.el.  It should allow you to save and restore windows of a
> single frame, if that suits your needs better.

It looks similar, but I cannot know why it does not work. I get error:

Debugger entered--Lisp error: (error "Undefined color" "unspecified-bg")
  frameset--restore-frame(((minibuffer . t) (display-type . mono)
  (background-mode . dark) (cursor-color . "white")
  (scroll-bar-foreground) (scroll-bar-background)
  (hyperb:window-system) (vertical-scroll-bars) (foreground-color
  . "unspecified-fg") (background-color . "unspecified-bg") (font
  . "tty") (height . 24) (width . 80) (modeline . t) (unsplittable)
  (menu-bar-lines . 1) (tab-bar-lines . 0) (fullscreen . maximized)
  (hywconfig-ring 0 0 . [nil nil nil nil nil nil nil nil nil nil])
  (border-color . "#888a85") (tool-bar-lines . 1) (frameset--id
  . "CD5C-B723-3EA6-2157") (frameset--mini t) (nil)) (((min-height
  . 4) (min-width . 10) (min-height-ignore . 2) (min-width-ignore . 2)
  (min-height-safe . 1) (min-width-safe . 2) (min-pixel-height . 4)
  (min-pixel-width . 10) (min-pixel-height-ignore . 2)
  (min-pixel-width-ignore . 2) (min-pixel-height-safe . 1)
  (min-pixel-width-safe . 2)) leaf (pixel-width . 80) (pixel-height
  . 23) (total-width . 80) (total-height . 23) (normal-height . 1.0)
  (normal-width . 1.0) (buffer "*scratch*" (selected) (hscroll . 0)
  (fringes 0 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t
  nil) (vscroll . 0) (dedicated) (point . 1) (start . 1))) ((tabs
  . frameset-filter-tabs) (background-color
  . frameset-filter-sanitize-color) (bottom
  . frameset-filter-shelve-param) (buffer-list . :never)
  (buffer-predicate . :never) (buried-buffer-list . :never) (client
  . :never) (delete-before . :never) (font
  . frameset-filter-font-param) (font-backend . :never)
  (foreground-color . frameset-filter-sanitize-color)
  (frameset--text-pixel-height . :save) (frameset--text-pixel-width
  . :save) (fullscreen . frameset-filter-shelve-param) (GUI:bottom
  . frameset-filter-unshelve-param) (GUI:font
  . frameset-filter-unshelve-param) (GUI:fullscreen
  . frameset-filter-unshelve-param) (GUI:height
  . frameset-filter-unshelve-param) (GUI:left
  . frameset-filter-unshelve-param) (GUI:right
  . frameset-filter-unshelve-param) (GUI:top
  . frameset-filter-unshelve-param) (GUI:width
  . frameset-filter-unshelve-param) (height
  . frameset-filter-shelve-param) (left
  . frameset-filter-shelve-param) (parent-frame . :never)
  (mouse-wheel-frame . :never) (right . frameset-filter-shelve-param)
  (top . frameset-filter-shelve-param) (tty
  . frameset-filter-tty-to-GUI) (tty-type
  . frameset-filter-tty-to-GUI) (width . frameset-filter-shelve-param)
  (window-system . :never) (left . frameset-filter-iconified)
  (minibuffer . frameset-filter-minibuffer) (top
  . frameset-filter-iconified) (name . :never) (parent-id . :never)
  (window-id . :never) (outer-window-id . :never)) nil 0 0)


This test shall pass, then I know it may read what prin1-to-string
prints:

(read-from-string (prin1-to-string (frameset-save (frame-list))))

Then this is how I think, I may be wrong, how it shall restore itself:

(frameset-restore (car (read-from-string (prin1-to-string
(frameset-save (frame-list))))))

But then I get in same Emacs session this error, and I cannot know if
it is bug or not.

Debugger entered--Lisp error: (error "Undefined color"
"unspecified-bg")

What would be useful is not specification of colors, as I may change
theme and colors, but just window sizes and their buffers and
modes. More than that is only making it more complex and changes
issues.

> > If at least I get clue how to get the split parameters of a frame,
> > modes, its sizes of windows, as Lisp data, then I would be fine with
> > it, and then I can myself assign something to those buffers. My
> > buffers are too often buffers related to database, table, column and
> > ID and do not have files attached.
> 
> The clues, as you were told, are in frameset.el and in desktop.el.  If
> their high-level interfaces don't suit your needs, my suggestion would
> be to study their implementations, and derive your own code from what
> they do.

Then I may assume there is no window configuration Lisp data that may
exist.


Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/




reply via email to

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