Merge branch 'master' of github.com:winpat/taskwarrior.el

This commit is contained in:
Patrick Winter 2019-06-25 13:03:56 +02:00
commit 214ad5cab3
No known key found for this signature in database
GPG key ID: 6799552170AB19E5

View file

@ -75,7 +75,7 @@
(define-key taskwarrior-mode-map (kbd "j") 'taskwarrior-next-task) (define-key taskwarrior-mode-map (kbd "j") 'taskwarrior-next-task)
(define-key taskwarrior-mode-map (kbd "q") 'quit-window) (define-key taskwarrior-mode-map (kbd "q") 'quit-window)
(define-key taskwarrior-mode-map (kbd "e") 'taskwarrior-change-description) (define-key taskwarrior-mode-map (kbd "e") 'taskwarrior-change-description)
(define-key taskwarrior-mode-map (kbd "U") 'taskwarrior-change-priority) (define-key taskwarrior-mode-map (kbd "U") 'taskwarrior-edit-priority)
(define-key taskwarrior-mode-map (kbd "g") 'taskwarrior-update-buffer) (define-key taskwarrior-mode-map (kbd "g") 'taskwarrior-update-buffer)
(define-key taskwarrior-mode-map (kbd "a") 'taskwarrior-add) (define-key taskwarrior-mode-map (kbd "a") 'taskwarrior-add)
(define-key taskwarrior-mode-map (kbd "d") 'taskwarrior-done) (define-key taskwarrior-mode-map (kbd "d") 'taskwarrior-done)
@ -88,7 +88,7 @@
(define-key taskwarrior-mode-map (kbd "r") 'taskwarrior-reset-filter) (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 "t") 'taskwarrior-edit-tags)
(define-key taskwarrior-mode-map (kbd "RET") 'taskwarrior-info) (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 () (defun test ()
@ -256,20 +256,29 @@
(set-difference old new :test #'string-equal) " "))) (set-difference old new :test #'string-equal) " ")))
(taskwarrior--mutable-shell-command "modify" id (concat added-tags " " removed-tags)))) (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 () (defun taskwarrior-change-description ()
"Change the description of a task" "Change the description of a task"
(interactive) (interactive)
(taskwarrior--change-attribute "description")) (taskwarrior--change-attribute "description"))
(defun taskwarrior-change-priority () (defun taskwarrior-edit-priority ()
"Change the priority of a task" "Change the priority of a task"
(interactive) (interactive)
(taskwarrior--change-attribute "priority")) (let* ((id (taskwarrior-id-at-point))
(options '("" "H" "M" "L"))
(defun taskwarrior-change-project () (new (completing-read "Priority: " options)))
"Change the project of a task" (taskwarrior--mutable-shell-command "modify" id (concat "priority:" new))))
(interactive)
(taskwarrior--change-attribute "project"))
(defun taskwarrior-add (description) (defun taskwarrior-add (description)
(interactive "sDescription: ") (interactive "sDescription: ")