emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [External] : Re: A feature to go to last edit locations


From: Jean Louis
Subject: Re: [External] : Re: A feature to go to last edit locations
Date: Tue, 14 Feb 2023 00:21:47 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

* Dr. Arne Babenhauserheide <arne_bab@web.de> [2023-02-13 23:32]:
> With C-x r f <KEY> there’s 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")) ➜ "~/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"))) ➜ #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 
configuration.

1. C-x r w 1 

2. (get-register ?1) ➜ (#<window-configuration> #<marker at 1208 in 
mutt-protected-1001-9339-1093665526192511358>)

3. (let ((window-configuration (get-register ?1)))
  (data-to-file window-configuration "~/my.register")) ➜ "~/my.register"

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.

-- 
Jean

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

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

Attachment: signature.asc
Description: PGP signature


reply via email to

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