aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-04-11 02:08:54 +0200
committerTeddy Wing2018-04-11 02:08:54 +0200
commitebc1fdb1e763895b17801983b395ec2181548646 (patch)
tree4277b72ee5eb32be2e09baf9e6409919385f39eb
parent2cd955e7faf2fe06acba32943fd5d27b2f5c1fa9 (diff)
downloadw3m-session-backup-ebc1fdb1e763895b17801983b395ec2181548646.tar.bz2
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
-rw-r--r--w3m-session-backup.el11
1 files 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)