From ebc1fdb1e763895b17801983b395ec2181548646 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 11 Apr 2018 02:08:54 +0200 Subject: Save YAML to the file * Change the temp file's extension to ".yml" * Remove blank line between pages * Output a YAML array of hashes containing the page titles and URLs in Copy URLs From All Tabs format --- w3m-session-backup.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/w3m-session-backup.el b/w3m-session-backup.el index edd93f0..ca7192f 100644 --- a/w3m-session-backup.el +++ b/w3m-session-backup.el @@ -29,15 +29,16 @@ (defun save-backup () "TODO" - (with-temp-file "~/tmp-w3m-session.txt" + (with-temp-file "~/tmp-w3m-session.yml" (insert (string-join (mapcar (lambda (page) - (format "%s\n%s" - (first page) - (first (last page)))) + (format "- page_title: %s + url: %s" + (first (last page)) + (first page))) (my-w3m-session-backup)) - "\n\n")))) + "\n")))) (save-backup) -- cgit v1.2.3