Refactor Zim timestamp generator as a defun

This commit is contained in:
Gergely Polonkai 2015-07-30 13:43:13 +00:00
parent a3caedf27d
commit 4ca025000c

21
zim.el
View File

@ -1,6 +1,19 @@
(defun zim-timestamp ()
(with-temp-buffer
(insert (format-time-string "%Y-%m-%dT%H:%M:%S%z"))
(forward-char -2)
(insert ":")
(forward-char 2)))
(defun insert-zim-timestamp () (defun insert-zim-timestamp ()
(interactive) (interactive)
(insert (format-time-string "%Y-%m-%dT%H:%M:%S%z")) (insert (zim-timestamp)))
(forward-char -2)
(insert ":") (defun insert-zim-header ()
(forward-char 2)) (interactive)
(save-excursion
(goto-char (point-min))
(insert
(concat "Content-Type: text/x-zim-wiki\n"
"Wiki-Format: zim 0.4\n"
"Creation-Date: " (zim-timestamp) "\n\n"))))