Add helper function to convert vector to list

This commit is contained in:
Patrick Winter 2018-10-23 22:13:21 +02:00
parent df20f9d1c1
commit 24bf81685d

View file

@ -45,8 +45,9 @@
(defun taskwarrior-export (filter) (defun taskwarrior-export (filter)
"Export taskwarrior entries as JSON" "Export taskwarrior entries as JSON"
(vector-to-list
(json-read-from-string (json-read-from-string
(taskwarrior--shell-command "export" filter))) (taskwarrior--shell-command "export" filter))))
(defun taskwarrior-change-project (project) (defun taskwarrior-change-project (project)
(interactive "sProject: ") (interactive "sProject: ")
@ -91,6 +92,10 @@ the front and focus it. Otherwise, create one and load the data."
(while (not (equal (overlays-at (point)) nil)) (while (not (equal (overlays-at (point)) nil))
(forward-char))))) (forward-char)))))
(defun vector-to-list (vector)
"Convert a vector to a list"
(append vector nil))
(defun taskwarrior-write-entries () (defun taskwarrior-write-entries ()
(let ((entries (append (taskwarrior-export "1-1000") nil))) (let ((entries (append (taskwarrior-export "1-1000") nil)))
(dolist (entry entries) (dolist (entry entries)