Only store link of org-mode link not description

This commit is contained in:
Patrick Winter 2019-09-04 21:27:05 +02:00
parent d5baaacda9
commit 188692cd8d

View file

@ -145,10 +145,15 @@
(when (string-match "^.*Created task \\([0-9]+\\)\\.*$" output) (when (string-match "^.*Created task \\([0-9]+\\)\\.*$" output)
(message (match-string 1 output)))) (message (match-string 1 output))))
(defun taskwarrior--parse-org-link (link)
(string-match org-bracket-link-regexp link)
(list
(match-string 1 link)
(match-string 3 link)))
(defun taskwarrior-capture (arg) (defun taskwarrior-capture (arg)
(interactive "P") (interactive "P")
(let* ((link (org-store-link arg)) (let* ((link (car (cdr (taskwarrior--parse-org-link (org-store-link arg)))))
(description (read-from-minibuffer "Description: ")) (description (read-from-minibuffer "Description: "))
(id (taskwarrior--parse-created-task-id (id (taskwarrior--parse-created-task-id
(shell-command-to-string (format "task add %s" description))))) (shell-command-to-string (format "task add %s" description)))))