Add auto completion to project selection
This commit is contained in:
parent
092fdc75a8
commit
606bab8584
1 changed files with 12 additions and 6 deletions
|
@ -84,7 +84,7 @@
|
|||
(define-key taskwarrior-mode-map (kbd "r") 'taskwarrior-reset-filter)
|
||||
(define-key taskwarrior-mode-map (kbd "t") 'taskwarrior-edit-tags)
|
||||
(define-key taskwarrior-mode-map (kbd "RET") 'taskwarrior-info)
|
||||
(define-key taskwarrior-mode-map (kbd "P") 'taskwarrior-change-project))
|
||||
(define-key taskwarrior-mode-map (kbd "P") 'taskwarrior-edit-project))
|
||||
|
||||
|
||||
(defun test ()
|
||||
|
@ -242,6 +242,17 @@
|
|||
(set-difference old new :test #'string-equal) " ")))
|
||||
(taskwarrior--mutable-shell-command "modify" id (concat added-tags " " removed-tags))))
|
||||
|
||||
|
||||
(defun taskwarrior-edit-project ()
|
||||
"Change the project of a task"
|
||||
(interactive)
|
||||
(let* ((id (taskwarrior-id-at-point))
|
||||
(task (taskwarrior-export-task id))
|
||||
(options (split-string (shell-command-to-string "task _projects") "\n"))
|
||||
(old (alist-get 'project task))
|
||||
(new (completing-read "Project: " options nil nil old)))
|
||||
(taskwarrior--mutable-shell-command "modify" id (concat "project:" new))))
|
||||
|
||||
(defun taskwarrior-change-description ()
|
||||
"Change the description of a task"
|
||||
(interactive)
|
||||
|
@ -252,11 +263,6 @@
|
|||
(interactive)
|
||||
(taskwarrior--change-attribute "priority"))
|
||||
|
||||
(defun taskwarrior-change-project ()
|
||||
"Change the project of a task"
|
||||
(interactive)
|
||||
(taskwarrior--change-attribute "project"))
|
||||
|
||||
(defun taskwarrior-add (description)
|
||||
(interactive "sDescription: ")
|
||||
(taskwarrior--mutable-shell-command "add" "" description))
|
||||
|
|
Loading…
Reference in a new issue