Fix extraction of old-value
This commit is contained in:
parent
b24d019882
commit
34a5a07d96
1 changed files with 4 additions and 3 deletions
|
@ -3,6 +3,8 @@
|
||||||
;; TODO: Implement modeline indicator for deadline and entries
|
;; TODO: Implement modeline indicator for deadline and entries
|
||||||
;; TODO: Update buffer if command modifies the state
|
;; TODO: Update buffer if command modifies the state
|
||||||
;; TODO: Extract "1-1000" id filter into variable
|
;; 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)
|
(require 'json)
|
||||||
|
|
||||||
|
@ -81,11 +83,10 @@
|
||||||
|
|
||||||
(defun taskwarrior--change-attribute (attribute)
|
(defun taskwarrior--change-attribute (attribute)
|
||||||
"Change an attribute of a task"
|
"Change an attribute of a task"
|
||||||
(let* ((prefix (concat (upcase attribute) ": "))
|
(let* ((prefix (concat attribute ": "))
|
||||||
(id (taskwarrior-id-at-point))
|
(id (taskwarrior-id-at-point))
|
||||||
(task (taskwarrior-export-task id))
|
(task (taskwarrior-export-task id))
|
||||||
(key (make-symbol attribute))
|
(old-value (cdr (assoc-string attribute task)))
|
||||||
(old-value (alist-get key task))
|
|
||||||
(new-value (read-from-minibuffer prefix old-value)))
|
(new-value (read-from-minibuffer prefix old-value)))
|
||||||
(taskwarrior--shell-command "modify" id new-value)
|
(taskwarrior--shell-command "modify" id new-value)
|
||||||
(taskwarrior-update-buffer)))
|
(taskwarrior-update-buffer)))
|
||||||
|
|
Loading…
Reference in a new issue