From 8924a9d277ae8bd52ac9c9b47f8b27c8f40bed4d Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 11 Apr 2018 02:41:46 +0200 Subject: Replace hard-coded filename with a generated one Generate a filename using the current date and time. Still saves to the home directory. That's the next step, we'll need to find a way to customise the save directory. --- w3m-session-backup.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/w3m-session-backup.el b/w3m-session-backup.el index 47710d5..2f8fda4 100644 --- a/w3m-session-backup.el +++ b/w3m-session-backup.el @@ -38,7 +38,7 @@ (defun save-backup () "TODO" - (with-temp-file "~/tmp-w3m-session.yml" + (with-temp-file (concat "~/" (filename)) (insert (string-join (mapcar @@ -50,4 +50,9 @@ (my-w3m-session-backup)) "\n")))) +(defun filename () + "Generates a default filename using the current date & time." + (format "w3m-tabs-%s.yml" + (format-time-string "%Y%m%d-%Hh%M"))) + (save-backup) -- cgit v1.2.3