From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: How to persist registers across sessions? Date: Fri, 01 Jul 2022 10:19:22 +0300 Message-ID: <83v8she1vp.fsf@gnu.org> References: <87leti6b6e.fsf@codeisgreat.org> <871qv7a3ey.fsf@gmail.com> <83y1xe45ga.fsf@gnu.org> <83bkuaf8e5.fsf@gnu.org> <83zghte5gl.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26675"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 01 09:20:25 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 1o7Awz-0006oJ-3i for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 01 Jul 2022 09:20:25 +0200 Original-Received: from localhost ([::1]:33132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7Awx-00047D-Rf for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 01 Jul 2022 03:20:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7Avt-00045p-9V for help-gnu-emacs@gnu.org; Fri, 01 Jul 2022 03:19:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43568) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7Avr-0002Vd-Qz for help-gnu-emacs@gnu.org; Fri, 01 Jul 2022 03:19:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=PZVYLSIH7Ax18F4nILY+avNdnew2gDiSDv7vrtR8boo=; b=kXDJ6T2juD5npfbDYZMf 124MsBfr0Fu9xmMlSKGGjomobZgfWzrae+ypcVHmU0pbrRACqZyTI7yAfypvNDyJAsB6OJSXfJo8G EzV8c6PAwNMcIIdNzUJ6wnRUifV/xZxxWR8Af0mumcEnAyTJ72k1MDXFAXSXw6kMi3YHpinJg6P// G3kJwC/gX1h2io/kqhbFdiuNnNv+b/n4BTmwT1kANX9W+V9KCmzYSm3cLjOyZOT42Tr7wWgteYt11 ybAtD5L0knBZ7xduFK590Ijkb2AETrZ56Y4bmmfLH0FSmh4S5Wozvc/xHGQJ8pUokQ9xgjNAY9Nh7 d0BCJKyQ/vpI7A==; Original-Received: from [87.69.77.57] (port=4228 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7Avn-0007yS-RI for help-gnu-emacs@gnu.org; Fri, 01 Jul 2022 03:19:12 -0400 In-Reply-To: (message from Jean Louis on Fri, 1 Jul 2022 10:03:13 +0300) 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:138247 Archived-At: > Date: Fri, 1 Jul 2022 10:03:13 +0300 > From: Jean Louis > 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 . #)) (buffer # (selected . t) (hscroll . 0) (fringes 8 8 nil nil) (margins nil) (scroll-bars nil 2 t nil 0 t nil) (vscroll . 0) (dedicated) (point . #) (start . #)) (prev-buffers (# # #) (# # #)))" > > 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.