all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to persist registers across sessions?
Date: Sat, 2 Jul 2022 20:19:51 +0300	[thread overview]
Message-ID: <YsB+N7QOD4kITFbj@protected.localdomain> (raw)
In-Reply-To: <83bku7dgxl.fsf@gnu.org>

* 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	other threads:[~2022-07-02 17:19 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27  3:24 How to persist registers across sessions? Pankaj Jangid
2022-06-27 12:01 ` Michael Heerdegen
2022-06-28 18:03 ` Jean Louis
2022-06-29 15:35 ` Visuwesh
2022-06-30 12:50   ` Jean Louis
2022-06-30 13:55     ` Michael Heerdegen
2022-06-30 14:00     ` Eli Zaretskii
2022-06-30 14:23       ` Michael Heerdegen
2022-06-30 15:50         ` Eli Zaretskii
2022-06-30 14:33       ` Jean Louis
2022-06-30 16:01         ` Eli Zaretskii
2022-06-30 21:55           ` Jean Louis
2022-07-01  6:02             ` Eli Zaretskii
2022-07-01  7:03               ` Jean Louis
2022-07-01  7:19                 ` Eli Zaretskii
2022-07-01 12:27                   ` Jean Louis
2022-07-02  5:54                     ` Eli Zaretskii
2022-07-02  8:46                       ` Jean Louis
2022-07-02  9:04                         ` Eli Zaretskii
2022-07-02 17:19                           ` Jean Louis [this message]
2022-07-02 17:40                             ` Eli Zaretskii
2022-07-02 18:03                               ` Jean Louis
2022-07-02 18:42                                 ` Eli Zaretskii
2022-07-02 18:52                                   ` Jean Louis
2022-07-03  5:02                                     ` Eli Zaretskii
2022-07-01 14:29                 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-07-01 16:07                 ` [External] : " Drew Adams
2022-07-02 11:00       ` Pankaj Jangid
2022-07-02 11:48         ` Eli Zaretskii
2022-07-04  3:26           ` Pankaj Jangid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YsB+N7QOD4kITFbj@protected.localdomain \
    --to=bugs@gnu.support \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.