diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-07-20 08:47:41 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-07-20 12:29:48 -0700 |
commit | 5613a715851d118ed3cb2248212302bd5bea3b6f (patch) | |
tree | 47c13ca3644e213dbfb147eef5fe851f44f8829a /.emacs.d/init-org.el | |
parent | 4ad149c76ae076c75b13e1460603de3dcb815b9c (diff) | |
download | dotfiles-5613a715851d118ed3cb2248212302bd5bea3b6f.tar.gz |
normalise function names
Diffstat (limited to '.emacs.d/init-org.el')
-rw-r--r-- | .emacs.d/init-org.el | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/.emacs.d/init-org.el b/.emacs.d/init-org.el index 69ed277f..ca31dc05 100644 --- a/.emacs.d/init-org.el +++ b/.emacs.d/init-org.el @@ -237,7 +237,7 @@ (org-agenda-todo-ignore-deadlines 'far) (org-agenda-overriding-header' "Unscheduled standalone tasks & project next actions") - (org-agenda-skip-function #'spw--skip-non-actionable))) + (org-agenda-skip-function #'spw/skip-non-actionable))) ;; commented out as not using Org as an appointments diary at present ;; (agenda "" ((org-agenda-span 3) ;; (org-agenda-start-day "+1d") @@ -256,7 +256,7 @@ "Waiting on others & not scheduled to chase up"))) (todo "TODO|NEXT" ((org-agenda-todo-ignore-with-date t) (org-agenda-overriding-header "Stuck projects") - (org-agenda-skip-function #'spw--skip-non-stuck-projects))) + (org-agenda-skip-function #'spw/skip-non-stuck-projects))) (tags "LEVEL=1+REFILE" ((org-agenda-todo-ignore-with-date nil) (org-agenda-todo-ignore-deadlines nil) @@ -282,7 +282,7 @@ (org-agenda-todo-ignore-deadlines nil) (org-agenda-todo-ignore-with-date nil) (org-agenda-skip-function - #'spw--skip-incomplete-projects-and-all-subprojects-and-NOARCHIVE))) + #'spw/skip-incomplete-projects-and-all-subprojects-and-NOARCHIVE))) ;; to find files which were mistakenly not added to ;; `org-agenda-files'. to exclude whole files from this list, @@ -293,7 +293,7 @@ ((org-agenda-overriding-header "Tasks from outside of org-agenda-files") (org-agenda-files (spw/org-non-agenda-files)) - (org-agenda-skip-function #'spw--skip-subprojects-and-NOAGENDA))))) + (org-agenda-skip-function #'spw/skip-subprojects-and-NOAGENDA))))) ;; don't have diary.org anymore; all moved into iCal ;; ("d" "Six-month diary" agenda "" @@ -307,7 +307,7 @@ ;; (org-agenda-files '("~/doc/org/diary.org")))) )) -(defun spw--org-auto-exclude-function (tag) +(defun spw/org-auto-exclude-function (tag) (let ((hour-of-day ;; (info "(elisp) Time of Day") suggests you really are meant to use ;; `substring' to get at the hour of the day @@ -352,7 +352,7 @@ ;; (= (calendar-day-of-week (calendar-current-date)) 6)) ) (concat "-" tag)))) -(setq org-agenda-auto-exclude-function #'spw--org-auto-exclude-function) +(setq org-agenda-auto-exclude-function #'spw/org-auto-exclude-function) ;;; agenda skipping functions. Many of these are adapted from Bernt ;;; Hansen's http://doc.norang.ca/org-mode.html @@ -368,7 +368,7 @@ (setq matches t))))) matches)) -(defmacro spw--skip-when (condition) +(defmacro spw/skip-when (condition) "Skip trees where CONDITION is false when evaluated when point is on the headline of the tree." `(let ((next-headline (save-excursion (outline-next-heading)))) (when ,condition @@ -393,12 +393,12 @@ ;; alternatively: (member (org-get-todo-state) org-todo-keywords-1) (member (nth 2 (org-heading-components)) org-todo-keywords-1)) -(defun bh--is-project-p () +(defun spw/is-project-p () "Any task with a todo keyword subtask" (and (spw/is-task-or-project-p) (spw/has-subheading-such-that (spw/is-task-or-project-p)))) -(defun bh--is-subproject-p () +(defun spw/is-subproject-p () "Any task which is a subtask of another project" (when (spw/is-task-or-project-p) (let ((is-subproject)) @@ -408,44 +408,44 @@ (setq is-subproject t)))) is-subproject))) -(defun bh--is-task-p () +(defun spw/is-task-p () "Any task with a todo keyword and no subtask" (and (spw/is-task-or-project-p) (not (spw/has-subheading-such-that (spw/is-task-or-project-p))))) -(defun spw--skip-subprojects-and-NOAGENDA () +(defun spw/skip-subprojects-and-NOAGENDA () "Skip trees that are subprojects, and trees with (possibly inherited) NOAGENDA tag" - (spw--skip-when (or (bh--is-subproject-p) + (spw/skip-when (or (spw/is-subproject-p) (member "NOAGENDA" (org-get-tags-at))))) -(defun spw--skip-projects-with-scheduled-or-deadlined-subprojects () +(defun spw/skip-projects-with-scheduled-or-deadlined-subprojects () "Skip projects that have subtasks, where at least one of those is scheduled or deadlined" - (spw--skip-when (spw--has-scheduled-or-deadlined-subproject-p))) + (spw/skip-when (spw/has-scheduled-or-deadlined-subproject-p))) -(defun spw--skip-subprojects-and-projects-with-scheduled-or-deadlined-subprojects () +(defun spw/skip-subprojects-and-projects-with-scheduled-or-deadlined-subprojects () "Skip subprojects projects that have subtasks, where at least one of those is scheduled or deadlined." - (spw--skip-when - (or (bh--is-subproject-p) - (spw--has-scheduled-or-deadlined-subproject-p)))) + (spw/skip-when + (or (spw/is-subproject-p) + (spw/has-scheduled-or-deadlined-subproject-p)))) -(defun spw--skip-incomplete-projects-and-all-subprojects-and-NOARCHIVE () +(defun spw/skip-incomplete-projects-and-all-subprojects-and-NOARCHIVE () "Skip all subprojects and projects with subprojects not yet completed, and trees with (possibly inherited) NOARCHIVE tag" - (spw--skip-when - (or (bh--is-subproject-p) - (spw--has-incomplete-subproject-or-task-p) + (spw/skip-when + (or (spw/is-subproject-p) + (spw/has-incomplete-subproject-or-task-p) (member "NOARCHIVE" (org-get-tags-at))))) -(defun spw--skip-non-stuck-projects () - (spw--skip-when - (or (bh--is-task-p) - (spw--has-scheduled-or-deadlined-subproject-p) - (spw--has-next-action-p)))) +(defun spw/skip-non-stuck-projects () + (spw/skip-when + (or (spw/is-task-p) + (spw/has-scheduled-or-deadlined-subproject-p) + (spw/has-next-action-p)))) -(defun spw--skip-non-actionable () +(defun spw/skip-non-actionable () "Skip: - anything tagged @Sheffield when I'm in Tucson - anything tagged @Tucson when I'm in Sheffield @@ -460,7 +460,7 @@ then I intend to tackle all the NEXT actions on that date (or at least the next chunk of them); I've broken the project down into NEXT actions but not for the purpose of handling them on different occasions." - (spw--skip-when + (spw/skip-when (or ;; #1 ;; iris is a laptop, but usually it's not in Sheffield @@ -472,15 +472,15 @@ different occasions." (and (string= (system-name) "zephyr") (member "@Tucson" (org-get-tags))) ;; #3 - (bh--is-project-p) + (spw/is-project-p) ;; we used to skip deadlined standalone tasks but actually those ;; are actionable in general - ;; (and (bh--is-task-p) - ;; (spw--org-has-deadline-p)) + ;; (and (spw/is-task-p) + ;; (spw/org-has-deadline-p)) ;; #4--#7 - (and (bh--is-subproject-p) + (and (spw/is-subproject-p) (or ;; #4 (not (string= (nth 2 (org-heading-components)) "NEXT")) @@ -493,9 +493,9 @@ different occasions." ;; # 6 (string= (nth 2 (org-heading-components)) "WAITING") ;; # 7 - (spw--org-is-scheduled-p))))))))) + (spw/org-is-scheduled-p))))))))) -(defun spw--org-is-scheduled-p () +(defun spw/org-is-scheduled-p () "A task that is scheduled" (spw/org-task-first-line-such-that (when (looking-at (org-re-timestamp 'deadline)) @@ -503,7 +503,7 @@ different occasions." (forward-char)) (looking-at (org-re-timestamp 'scheduled)))) -(defun spw--org-has-deadline-p () +(defun spw/org-has-deadline-p () "A task that has a deadline" (spw/org-task-first-line-such-that (when (looking-at (org-re-timestamp 'scheduled)) @@ -511,21 +511,21 @@ different occasions." (forward-char)) (looking-at (org-re-timestamp 'deadline)))) -(defun spw--org-is-scheduled-or-deadlined-p () +(defun spw/org-is-scheduled-or-deadlined-p () "A task that is scheduled or deadlined" (spw/org-task-first-line-such-that (looking-at (org-re-timestamp 'scheduled-or-deadline)))) -(defun spw--has-scheduled-or-deadlined-subproject-p () +(defun spw/has-scheduled-or-deadlined-subproject-p () "A task that has a scheduled or deadlined subproject" - (spw/has-subheading-such-that (spw--org-is-scheduled-or-deadlined-p))) + (spw/has-subheading-such-that (spw/org-is-scheduled-or-deadlined-p))) -(defun spw--has-next-action-p () +(defun spw/has-next-action-p () "A task that has a NEXT subproject" (spw/has-subheading-such-that (string= (nth 2 (org-heading-components)) "NEXT"))) -(defun spw--has-incomplete-subproject-or-task-p () +(defun spw/has-incomplete-subproject-or-task-p () "A task that has an incomplete subproject or task." (spw/has-subheading-such-that (not (member (nth 2 (org-heading-components)) |