diff options
author | Teddy Wing | 2018-04-11 00:30:20 +0200 |
---|---|---|
committer | Teddy Wing | 2018-04-11 00:30:20 +0200 |
commit | da82655a896c69ba5835cfdfec05a91b6731879c (patch) | |
tree | 21ee070cc0f4b2fb31d240e3d5e2c50b19f99a5c | |
parent | 446248ea28e5bbae4d1801a8e92d85e14f8bac43 (diff) | |
download | w3m-session-backup-da82655a896c69ba5835cfdfec05a91b6731879c.tar.bz2 |
Write the session backup to a file
Use a temporary hard-coded file.
Construct a string with each page turning into a URL and page title on
separate lines, and a blank line between pages.
Doesn't quite work just yet, but the general idea is there.
-rw-r--r-- | w3m-session-backup.el | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/w3m-session-backup.el b/w3m-session-backup.el index ef0f272..62e5b65 100644 --- a/w3m-session-backup.el +++ b/w3m-session-backup.el @@ -21,3 +21,25 @@ ;; (w3m-load-list w3m-session-file)))) (my-w3m-session-backup) + +;; Write to file + ;; https://stackoverflow.com/questions/2321904/elisp-how-to-save-data-in-a-file#2322164 +;; Format some YAML text to write to the file +;; Configurable dynamic filename based on date-time + +(defun save-backup () + "TODO" + (with-temp-file "tmp-w3m-session.txt" + (string-join + (mapcar + (lambda (page) + (format "%s\n%s" + (first page) + (first (last page)))) + (my-w3m-session-backup)) + "\n\n"))) + ; (format + ; "%s\n%s\n\n" + ; ))) + +(save-backup) |