From 34a5a07d96f3fba6ef49ff9289cb488104766279 Mon Sep 17 00:00:00 2001 From: Patrick Winter Date: Tue, 13 Nov 2018 20:31:06 +0100 Subject: [PATCH] Fix extraction of old-value --- taskwarrior.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/taskwarrior.el b/taskwarrior.el index 851b729..b1335e2 100644 --- a/taskwarrior.el +++ b/taskwarrior.el @@ -3,6 +3,8 @@ ;; TODO: Implement modeline indicator for deadline and entries ;; TODO: Update buffer if command modifies the state ;; TODO: Extract "1-1000" id filter into variable +;; TODO: Figure out the difference between assoc and assoc-string +;; (and why alist-get does not work with strings) (require 'json) @@ -81,11 +83,10 @@ (defun taskwarrior--change-attribute (attribute) "Change an attribute of a task" - (let* ((prefix (concat (upcase attribute) ": ")) + (let* ((prefix (concat attribute ": ")) (id (taskwarrior-id-at-point)) (task (taskwarrior-export-task id)) - (key (make-symbol attribute)) - (old-value (alist-get key task)) + (old-value (cdr (assoc-string attribute task))) (new-value (read-from-minibuffer prefix old-value))) (taskwarrior--shell-command "modify" id new-value) (taskwarrior-update-buffer)))