Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Org GTD 3.0 mega-PR #124

Merged
merged 90 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
1f6ac48
fix: run org-gtd--decorate-item in org-gtd-inbox-processing
mbeutelspacher Feb 26, 2023
5731418
Update test.yml
Trevoke Mar 1, 2023
17fd20f
fix: decorate all elements in a project
DerBeutlin Feb 26, 2023
2966f28
fix: mapping in correct order
mbeutelspacher Mar 6, 2023
865068e
Merge pull request #116 from DerBeutlin/fix/decorate-items
Trevoke Mar 8, 2023
fdc13dc
fix cond statement in custom agenda prefix
Trevoke Mar 8, 2023
9f73c69
Factor out inbox/default file initialization
cdlm Feb 13, 2023
89a0cf2
Ensure inbox file exists
cdlm Feb 13, 2023
2c87dae
Convert to full-fledged capture templates
cdlm Feb 13, 2023
9efbe52
Missing dependency
cdlm Feb 14, 2023
a026471
Avoid org-gtd-customize depending on org-gtd-files
cdlm Feb 14, 2023
d5d54c3
Cleanup uses of org-gtd--inbox-file
cdlm Feb 15, 2023
69c6689
Simplify overkill refactoring
cdlm Feb 19, 2023
770d399
Surface one-off organizing actions
Trevoke Feb 28, 2023
4266bad
fix missing line of code in inbox processing action
Trevoke Mar 1, 2023
19e3bd8
inbox-processing -> process
Trevoke Mar 6, 2023
dda6e13
tests pass again, which I hear matters
Trevoke Mar 8, 2023
2cd194d
refactor - move customize options
Trevoke Mar 10, 2023
3037ee6
Sketched new flow using temp processing buffer
Trevoke Mar 14, 2023
e9a00fe
adjust fixture file
Trevoke Mar 23, 2023
c23b96d
possibly more idiomatic buffer name template
Trevoke Mar 23, 2023
3319251
move defcustom declarations closer to the code
Trevoke Mar 23, 2023
196be5e
update agenda prototypes with dynamic date search
Trevoke Mar 24, 2023
f0d7f1b
wip - upgrading processing code
Trevoke Mar 24, 2023
00055d9
paving the way for clean single and batch clarifying
Trevoke Mar 27, 2023
09344fd
down to 6 failing tests
Trevoke Apr 1, 2023
197064d
down to fixing error flow
Trevoke Apr 3, 2023
240045b
last failing test, the big one
Trevoke Apr 3, 2023
b1d5f90
stupid blank lines in wip buffer
Trevoke Apr 3, 2023
cd07226
WIP (I hate myself)
Trevoke Apr 3, 2023
e2da90c
error display works as intended
Trevoke Apr 3, 2023
beda5cc
update documentation todo
Trevoke Apr 3, 2023
a9f1361
Merge branch 'org-gtd-3' into more-flexible-organization
Trevoke Apr 3, 2023
1de5c58
append org-gtd-directory to org-agenda-files
Trevoke Apr 3, 2023
ae3ff3d
add a forgotten test file
Trevoke Apr 3, 2023
b009301
refactor to allow todo-keywords to be dynamic
Trevoke Apr 7, 2023
75e5d48
can customize TODO/NEXT/etc. keywords
Trevoke Apr 7, 2023
644c258
add backward compatibility for ensure-list
Trevoke Apr 7, 2023
88406c4
some linting
Trevoke Apr 7, 2023
5fb5e04
declare this as 3.0 version; fix autoload issue
Trevoke Apr 9, 2023
2073131
support emacs 27 better
Trevoke Apr 9, 2023
1300c21
fix package autoloading, use new calendar implementation
Trevoke Apr 10, 2023
2d97101
hopefully fix 27.2 test failure
Trevoke Apr 11, 2023
bf191f6
First pass of function to upgrade calendar items to v3
Trevoke Apr 11, 2023
abc074a
Show horizons buffer on clarify if option is true
Trevoke Apr 11, 2023
04e0db9
respect option to show or not the horizons buffer
Trevoke Apr 11, 2023
b1d7605
compatibility with emacs 27.2
Trevoke Apr 12, 2023
b94085f
Incubate no longer uses SCHEDULED
Trevoke Apr 12, 2023
27032e5
Move delegated items away from SCHEDULED property
Trevoke Apr 12, 2023
430e6aa
ensure clarifying "knowledge" works
Trevoke Apr 17, 2023
8336595
sometimes I wonder how my tests work locally at all
Trevoke Apr 17, 2023
c97fa93
clean up kbd macros in processing test
Trevoke Apr 17, 2023
4b8e683
extract "capture-and-process" and "clarify" as functions
Trevoke Apr 17, 2023
5fbe386
if you don't commit new files, you're gonna have a bad time
Trevoke Apr 17, 2023
aad6d09
clean up helper code a little
Trevoke Apr 17, 2023
58dd0b7
add test for trash processing
Trevoke Apr 17, 2023
a6f159e
New decoration hook for choosing areas of focus
Trevoke Apr 17, 2023
d1f78ce
Update README.org
Trevoke Apr 19, 2023
c189cb7
Add sample doom config
chookity-pokk Apr 19, 2023
b98a8e6
Bring sample doom config into documentation / info file
Trevoke Apr 20, 2023
a6aca52
Merge branch 'chookity-pokk-update-readme'
Trevoke Apr 20, 2023
4fc2a0f
Merge branch 'master' into more-flexible-organization
Trevoke Apr 20, 2023
4603129
put sponsor request in README
Trevoke Apr 20, 2023
ffeacde
Merge branch 'master' into more-flexible-organization
Trevoke Apr 20, 2023
e175979
simplify logic: only one transient prefix now
Trevoke Apr 20, 2023
2c5104d
heavy linting effort
Trevoke Apr 21, 2023
f5cc056
more linting, start area of focus review agenda
Trevoke Apr 22, 2023
f6a5bba
signal error if area not in list
Trevoke Apr 22, 2023
b4e0c8c
try to use buttercup's :var tool
Trevoke Apr 23, 2023
45b6a0d
Prepare agenda for area of focus review
Trevoke Apr 24, 2023
17787cb
Toggle horizons buffer
Trevoke Apr 24, 2023
e2ddaed
Make flow for organizing a habit
Trevoke Apr 24, 2023
8b95c25
fix broken test
Trevoke Apr 25, 2023
e643350
Insert project templates while clarifying
Trevoke Apr 25, 2023
19658de
add functions to programmatically add GTD tasks
Trevoke Apr 25, 2023
3dd2b27
lint and rename hooks to org-gtd-organize-hooks
Trevoke Apr 26, 2023
6566106
move some functions from agenda namespace to GTD namespaces
Trevoke Apr 27, 2023
168f042
Update organize-hooks, allow easy customization
Trevoke Apr 28, 2023
3e73c10
discriminate more about when area of focus gets set
Trevoke Apr 28, 2023
dce739d
engage with all NEXT, by @-context
Trevoke Apr 30, 2023
b42a7bd
clean up logic for TODO/NEXT keywords on project tasks
Trevoke Apr 30, 2023
d4b03f2
keep track of implementation details
Trevoke May 1, 2023
a9630b1
Simplify file/refile target management
Trevoke May 1, 2023
e06d310
better data organization
Trevoke May 1, 2023
b613ed1
move habits to their own tree
Trevoke May 1, 2023
88015dd
implement 'review stuck bits' commands
Trevoke May 2, 2023
8b1778e
remove obsolete call; at this point, a drop in the sea
Trevoke May 2, 2023
7e448e8
Add org-gtd-oops to see missed events
Trevoke May 4, 2023
0814252
And this is why we have tests
Trevoke May 4, 2023
53a258e
add warning for 3.0.0beta
Trevoke May 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Show horizons buffer on clarify if option is true
Work on #126
  • Loading branch information
Trevoke committed Apr 11, 2023
commit abc074a21ef8ae4879489f6477715deb8dc63ac2
30 changes: 29 additions & 1 deletion org-gtd-clarify.el
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@

(require 'org-gtd-id)

(defgroup org-gtd-clarify nil
"Customize the behavior when clarifying an item."
:package-version '(org-gtd . "3.0")
:group 'org-gtd)

(defcustom org-gtd-clarify-show-horizons nil
"When t, show a side buffer with the higher horizons during item clarification.
The file shown can be configured in `org-gtd-horizons-file'"
:package-version '(org-gtd . "3.0")
:group 'org-gtd-clarify
:type 'boolean)

(defconst org-gtd-clarify--prefix "Org-GTD WIP")

(defvar-local org-gtd-clarify--window-config nil
Expand All @@ -44,6 +56,19 @@
(defvar org-gtd-clarify-map (make-sparse-keymap)
"Keymap for command `org-gtd-clarify-mode', a minor mode.")

;; code to make windows atomic, from emacs manual
;; (let ((window (split-window-right)))
;; (window-make-atom (window-parent window))
;; (display-buffer-in-atom-window
;; (get-buffer-create "*Messages*")
;; `((window . ,(window-parent window)) (window-height . 5))))

;; code to make windows non-atomic
;; (walk-window-subtree (lambda (window) (set-window-parameter window 'window-atom nil)) (window-parent (get-buffer-window (current-buffer))) t)

;; dedicated side window
;; (display-buffer-in-side-window (get-buffer "horizons.org") '((side . right) (dedicated . t)))

;;;###autoload
(define-minor-mode org-gtd-clarify-mode
"Minor mode for org-gtd."
Expand Down Expand Up @@ -74,7 +99,10 @@
org-gtd-clarify--clarify-id (org-id-get)))
(set-buffer processing-buffer)
(display-buffer processing-buffer)
(delete-other-windows (get-buffer-window processing-buffer))))
(delete-other-windows (get-buffer-window processing-buffer))
(display-buffer-in-side-window
(org-gtd--horizons-file)
'((side . right) (dedicated . t)))))

;;;###autoload
(defun org-gtd-clarify-inbox-item ()
Expand Down
9 changes: 9 additions & 0 deletions org-gtd-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ your own files if you want multiple refile targets (projects, etc.)."
:package-version '(org-gtd . "0.1")
:type 'directory)

(defcustom org-gtd-horizons-file "horizons.org"
"File holding your GTD horizons.

This may get displayed during item clarification for context and focus. This file
must be in the `org-gtd-directory'."
:group 'org-gtd
:package-version '(org-gtd . "3.0")
:type 'file)

(defcustom org-gtd-next "NEXT"
"The org-mode keyword for an action ready to be done. Just the word."
:group 'org-gtd
Expand Down
22 changes: 15 additions & 7 deletions org-gtd-files.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,42 @@ This is the inbox. Everything goes in here when you capture it.
"
"Template for the GTD inbox.")

;; TODO remove this entirely
(defconst org-gtd-file-header "")


(defconst org-gtd-default-file-name "org-gtd-tasks")

(defconst org-gtd-file-horizons-template
"* Purpose and principles (why)
* Vision (what)
* Goals
* Areas of focus / accountabilities
")

;;;###autoload
(defun org-gtd-inbox-path ()
"Return the full path to the inbox file."
(let ((path (org-gtd--path org-gtd-inbox)))
(org-gtd--ensure-file-exists path org-gtd-inbox-template)
path))

(defun org-gtd--horizons-file ()
(let ((path (f-join org-gtd-directory org-gtd-horizons-file)))
(org-gtd--ensure-file-exists path org-gtd-file-horizons-template)
(find-file-noselect path)))

(defun org-gtd--inbox-file ()
"Create or return the buffer to the GTD inbox file."
(find-file-noselect (org-gtd-inbox-path)))

(defun org-gtd--default-file ()
"Create or return the buffer to the default GTD file."
(let ((path (org-gtd--path org-gtd-default-file-name)))
(org-gtd--ensure-file-exists path org-gtd-file-header)
(org-gtd--ensure-file-exists path)
(find-file-noselect path)))

(defun org-gtd--ensure-file-exists (path initial-contents)
(defun org-gtd--ensure-file-exists (path &optional initial-contents)
"Create the file at PATH with INITIAL-CONTENTS if it does not exist."
(unless (f-exists-p path)
(with-current-buffer (find-file-noselect path)
(insert initial-contents)
(insert (or initial-contents ""))
(org-gtd-core-prepare-buffer)
(basic-save-buffer))))

Expand Down
3 changes: 1 addition & 2 deletions test/files-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

(describe "Create a default file"

(before-each
(ogt--configure-emacs))
(before-each (ogt--configure-emacs))
(after-each (ogt--close-and-delete-files))

(describe "with default content"
Expand Down
9 changes: 6 additions & 3 deletions test/helpers/utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ Return the buffer visiting that file."
(let ((filename (make-temp-file basename nil ".org" text)))
(find-file-noselect filename)))

(defun create-additional-project-target (filename)
(let* ((file (f-join org-gtd-directory (format "%s.org" filename)))
(defun ogt--create-org-file-in-org-gtd-dir (basename &optional initial-contents)
(let* ((file (f-join org-gtd-directory (format "%s.org" basename)))
(buffer (find-file-noselect file)))
(with-current-buffer buffer
(insert ogt--base-project-heading)
(insert (or initial-contents ""))
(basic-save-buffer))
buffer))

(defun create-additional-project-target (filename)
(ogt--create-org-file-in-org-gtd-dir filename ogt--base-project-heading))

(defun ogt--buffer-string (buffer)
"Return buffer's content."
(with-current-buffer buffer
Expand Down
59 changes: 59 additions & 0 deletions test/horizons-test.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
;; -*- lexical-binding: t; coding: utf-8 -*-

(load "test/helpers/setup.el")
(load "test/helpers/utils.el")
(require 'org-gtd)
(require 'buttercup)
(require 'with-simulated-input)

(describe
"Higher horizons"

(before-each (ogt--configure-emacs))
(after-each (ogt--close-and-delete-files))

(describe
"when org-gtd should show the horizons"

(before-each (setq org-gtd-clarify-show-horizons t))
(after-each (setq org-gtd-clarify-show-horizons nil))

(describe
"when we clarify an item"

(it "creates a templated file when there isn't one"
(ogt--add-single-item "Add a configuration option")
(org-gtd-process-inbox)
(expect (get-buffer-window "horizons.org")
:not :to-be
nil)
(expect (get-buffer-window (car (org-gtd-clarify--get-buffers)))
:not :to-be
nil)
)

(it "shows the existing file if there is one"
(ogt--create-org-file-in-org-gtd-dir
"horizons"
"We are the champions")
(ogt--add-single-item "Add a configuration option")
(org-gtd-process-inbox)
(expect (get-buffer-window "horizons.org")
:not :to-be
nil)
(expect (get-buffer-window (car (org-gtd-clarify--get-buffers)))
:not :to-be
nil)
(expect (ogt--buffer-string "horizons.org")
:to-match
"We are the champions")))
(describe
"when we return to a WIP buffer"
))


(describe
"when org-gtd should not show the horizons"
(before-each (setq org-gtd-clarify-show-horizons nil))
(after-each (setq org-gtd-clarify-show-horizons nil))
))