Refactor Zim timestamp generator as a defun
This commit is contained in:
parent
a3caedf27d
commit
4ca025000c
19
zim.el
19
zim.el
@ -1,6 +1,19 @@
|
|||||||
(defun insert-zim-timestamp ()
|
(defun zim-timestamp ()
|
||||||
(interactive)
|
(with-temp-buffer
|
||||||
(insert (format-time-string "%Y-%m-%dT%H:%M:%S%z"))
|
(insert (format-time-string "%Y-%m-%dT%H:%M:%S%z"))
|
||||||
(forward-char -2)
|
(forward-char -2)
|
||||||
(insert ":")
|
(insert ":")
|
||||||
(forward-char 2))
|
(forward-char 2)))
|
||||||
|
|
||||||
|
(defun insert-zim-timestamp ()
|
||||||
|
(interactive)
|
||||||
|
(insert (zim-timestamp)))
|
||||||
|
|
||||||
|
(defun insert-zim-header ()
|
||||||
|
(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"))))
|
||||||
|
Loading…
Reference in New Issue
Block a user