-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
org-gtd-process.el
66 lines (54 loc) · 2.15 KB
/
org-gtd-process.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
;;; org-gtd-process.el --- Code to process inbox -*- lexical-binding: t; coding: utf-8 -*-
;;
;; Copyright © 2019-2023 Aldric Giacomoni
;; Author: Aldric Giacomoni <[email protected]>
;; This file is not part of GNU Emacs.
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this file. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; Inbox processing management for org-gtd.
;;
;;; Code:
(require 'org-gtd-core)
(require 'org-gtd-agenda)
(require 'org-gtd-projects)
(require 'org-gtd-refile)
(require 'org-gtd-organize)
(defcustom org-gtd-process-item-hooks '(org-set-tags-command)
"Enhancements to add to each item as they get processed from the inbox.
This is a list of functions that modify an org element. The default value has
one function: setting org tags on the item. Some built-in examples are
provided as options here. You can create your own functions to enhance/decorate
the items once they have been processed and add them to that list."
:group 'org-gtd
:package-version '(org-gtd . "1.0.4")
:type 'hook
:options '(org-set-tags-command org-set-effort org-priority))
;;;###autoload
(defun org-gtd-process-inbox ()
"New stuff whodis"
(interactive)
(set-buffer (org-gtd--inbox-file))
(condition-case err
(progn
(goto-char (point-min))
(when (org-before-first-heading-p)
(outline-next-visible-heading 1))
(org-N-empty-lines-before-current 1)
(org-gtd-clarify-inbox-item))
(user-error (org-gtd-process--stop))))
(defun org-gtd-process--stop ()
"Stop processing the inbox."
(interactive)
(whitespace-cleanup))
(provide 'org-gtd-process)
;;; org-gtd-process.el ends here