From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: How to persist registers across sessions? Date: Sat, 2 Jul 2022 20:19:51 +0300 Message-ID: References: <83bkuaf8e5.fsf@gnu.org> <83zghte5gl.fsf@gnu.org> <83v8she1vp.fsf@gnu.org> <83tu80cb54.fsf@gnu.org> <83bku7dgxl.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32218"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/+ () (2022-05-21) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 02 19:31:39 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7gy1-00089q-Ub for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 02 Jul 2022 19:31:38 +0200 Original-Received: from localhost ([::1]:40652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7gy0-0000nX-Pd for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 02 Jul 2022 13:31:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7gwp-0000nN-S2 for help-gnu-emacs@gnu.org; Sat, 02 Jul 2022 13:30:23 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:33049) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7gwk-0002Zs-TP; Sat, 02 Jul 2022 13:30:23 -0400 Original-Received: from localhost ([::ffff:102.87.107.124]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000087C50.0000000062C080A2.00006D79; Sat, 02 Jul 2022 10:30:09 -0700 Mail-Followup-To: Eli Zaretskii , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <83bku7dgxl.fsf@gnu.org> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:138257 Archived-At: * Eli Zaretskii [2022-07-02 12:05]: > > Date: Sat, 2 Jul 2022 11:46:49 +0300 > > From: Jean Louis > > 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/