From da82655a896c69ba5835cfdfec05a91b6731879c Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 11 Apr 2018 00:30:20 +0200 Subject: 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. --- w3m-session-backup.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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) -- cgit v1.2.3