Don't print shell command results to minibuffer

The message function interprets it's input as a format string. So if the output
of the shell command contains a % will result into an error...
This commit is contained in:
Patrick Winter 2019-04-09 13:38:15 +02:00
parent 60810eb2b7
commit e92708ae9a

View file

@ -157,7 +157,7 @@
(defun taskwarrior-add (description) (defun taskwarrior-add (description)
(interactive "sDescription: ") (interactive "sDescription: ")
(message (taskwarrior--shell-command "add" "" description)) (taskwarrior--shell-command "add" "" description)
(when (eq (buffer-name) taskwarrior-buffer-name) (when (eq (buffer-name) taskwarrior-buffer-name)
(taskwarrior-update-buffer))) (taskwarrior-update-buffer)))
@ -167,7 +167,7 @@
(let ((id (taskwarrior-id-at-point)) (let ((id (taskwarrior-id-at-point))
(confirmation (read-from-minibuffer "Done [y/n]?: "))) (confirmation (read-from-minibuffer "Done [y/n]?: ")))
(when (string= confirmation "y") (when (string= confirmation "y")
(message (taskwarrior--shell-command "done" id)) (taskwarrior--shell-command "done" id)
(taskwarrior-update-buffer)))) (taskwarrior-update-buffer))))
(defun taskwarrior-delete () (defun taskwarrior-delete ()
@ -176,7 +176,7 @@
(let ((id (taskwarrior-id-at-point)) (let ((id (taskwarrior-id-at-point))
(confirmation (read-from-minibuffer "Delete [y/n]?: "))) (confirmation (read-from-minibuffer "Delete [y/n]?: ")))
(when (string= confirmation "y") (when (string= confirmation "y")
(message (taskwarrior--shell-command "delete" id "" "" "yes")) (taskwarrior--shell-command "delete" id "" "" "yes")
(taskwarrior-update-buffer)))) (taskwarrior-update-buffer))))
;; Setup a major mode for taskwarrior ;; Setup a major mode for taskwarrior