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.devel Subject: Re: [External] : Re: A feature to go to last edit locations Date: Tue, 14 Feb 2023 00:21:47 +0300 Message-ID: References: <972bedcc-37c9-5180-ac41-90e25d854a63@yandex.ru> <87ilg5l32k.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=_stw1.rcdrun.com-10714-1676323405-0001-2" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27879"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.9+54 (af2080d) (2022-11-21) Cc: Drew Adams , Dmitry Gutov , Daniel =?utf-8?Q?Mart=C3=ADn?= , emacs-devel@gnu.org To: "Dr. Arne Babenhauserheide" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 13 22:23:56 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pRgIl-0006y7-Pj for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Feb 2023 22:23:55 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRgIH-0002Nc-AG; Mon, 13 Feb 2023 16:23:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRgIF-0002NO-EC for emacs-devel@gnu.org; Mon, 13 Feb 2023 16:23:23 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRgID-0004EL-SG for emacs-devel@gnu.org; Mon, 13 Feb 2023 16:23:23 -0500 Original-Received: from localhost ([::ffff:197.239.6.48]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000103A05.0000000063EAAA4C.000029DA; Mon, 13 Feb 2023 14:23:23 -0700 Mail-Followup-To: "Dr. Arne Babenhauserheide" , Drew Adams , Dmitry Gutov , Daniel =?utf-8?Q?Mart=C3=ADn?= , emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: <87ilg5l32k.fsf@web.de> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SBL=0.141, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303240 Archived-At: This is a MIME-formatted message. If you see this text it means that your E-mail software does not support MIME-formatted messages. --=_stw1.rcdrun.com-10714-1676323405-0001-2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Dr. Arne Babenhauserheide [2023-02-13 23:32]: > With C-x r f there=E2=80=99s something even more powerful: save the= full > frame configuration to a register (for example before starting a hunt > towards some reference or investigating something in depth). I need this. Back in time I have asked how can I capture that register so that I can save it, and load it, eval it, to restore it. This is for reason that I wish to capture it in the database. I have tried this way: (defun data-to-file (data file) "PRIN1 Emacs Lisp DATA to FILE" (string-to-file-force (prin1-to-string data) file)) (let ((hash (make-hash-table))) (data-to-file hash "~/my.hash")) =E2=9E=9C "~/my.hash" (defun data-from-file (file) "Reads and returns Emacs Lisp data from FILE" (condition-case nil (car (read-from-string (file-to-string file))) (error nil))) (let (hash) (setq hash (data-from-file "~/my.hash"))) =E2=9E=9C #s(hash-table size 65= test eql rehash-size 1.5 rehash-threshold 0.8125 data ()) So that works for hash well. But how do I save that window configuration register, so that I can load it? Once I figure that out, I could quickly switch from this to that window con= figuration. 1. C-x r w 1=20 2. (get-register ?1) =E2=9E=9C (# #) 3. (let ((window-configuration (get-register ?1))) (data-to-file window-configuration "~/my.register")) =E2=9E=9C "~/my.regi= ster" 4. (data-from-file "~/my.register") car: Invalid read syntax: "#" 5. And there is no information of what is really window configuration I wish to make it persistent, to be able to save it into file. --=20 Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/ --=_stw1.rcdrun.com-10714-1676323405-0001-2 Content-Type: application/pgp-signature; name="signature.asc" Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEv9/jXBKLXfDiHl8IErxRIkudxlwFAmPqqesACgkQErxRIkud xlxhIQf+PYYNMTA7irTr8oPUKYJHpVb93p3k7E/BLq6dNJIT58Gw6wYB+sq6xnQp KlFNREyzDNl94j2sp7/lXrlonpQv/gevohK6aR+bch2ht9yQNTte8nocf+r9FtCX 8sG96733uicuG35zE44ZhYTfOH4BCuPMJ8CZxl79APSh9dUEYyK0sQYk2Mb5dbTY 4Nleg8I1LeWVFF75LlpxKZBGJ27fVYq5txIamz1JItUpWMJS9BVr7BbP5Oh11Xyb UuCLVRZ56SyWW1hjPrZVb1mbD5+dQ1pU4fjp5Q/stvrURQnoOtiFdiuZichEUMKG mTB8N2hl2n3ZPw6X0RBlBO1DPimX8w== =eSs4 -----END PGP SIGNATURE----- --=_stw1.rcdrun.com-10714-1676323405-0001-2--