From d51313232b5df4de9b16667d2945d9b9837df4a9 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 17 Apr 2021 00:56:05 -0400 Subject: [PATCH] REF make tags dryer --- etc/conf.org | 60 +++++++++++------------- local/lib/org-x/org-x.el | 99 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 125 insertions(+), 34 deletions(-) diff --git a/etc/conf.org b/etc/conf.org index ff595c9..d1e19de 100644 --- a/etc/conf.org +++ b/etc/conf.org @@ -2149,52 +2149,46 @@ IDs and links are useful for meetings where I either reference tasks to discuss I use tags for agenda filtering (primarily for GTD contexts, see below). Each tag here starts with a symbol to define its group (note, only the special chars "_", "@", "#", and "%" seem to be allowed; anything else will do weird things in the hotkey prompt). Some groups are mutually exclusive. By convention, any tag not part of these groups is ALLCAPS (not very common) and set at the file level. #+BEGIN_SRC emacs-lisp (setq org-tag-alist - ;; (@) gtd location context + ;; gtd location context `((:startgroup) - ("@errand" . ?e) - ("@home" . ?h) - ("@work" . ?w) - ("@travel" . ?r) + (,org-x-tag-errand . ?e) + (,org-x-tag-home . ?h) + (,org-x-tag-work . ?w) + (,org-x-tag-travel . ?r) (:endgroup) - ;; (#) gtd resource context - ("#laptop" . ?l) - ("#tcult" . ?t) - ("#phone" . ?p) + ;; gtd resource context + (,org-x-tag-laptop . ?l) + (,org-x-tag-tcult . ?t) + (,org-x-tag-phone . ?p) - ;; (%) misc tags + ;; misc tags ;; denotes reference information - ("%note" . ?n) + (,org-x-tag-note . ?n) ;; incubator (the someday/maybe list) - ("%inc" . ?i) + (,org-x-tag-incubated . ?i) - ;; maybe (for things I might want to do, to be used with %inc) - ("%maybe" . ?m) + ;; maybe (for things I might want to do, to be used with + ;; `org-x-tag-incubated') + (,org-x-tag-maybe . ?m) ;; denotes tasks that need further subdivision to turn into true project - ("%subdiv" . ?s) + (,org-x-tag-subdivision . ?s) ;; catchall to mark important headings, usually for meetings - ("%flag" . ?f) - - ;; taskjuggler - ;; (:startgroup) - ;; (,org-tj-project-tag . ?x) - ;; (,org-tj-resource-tag . ?y) - ;; (,org-tj-report-tag . ?z) - ;; (:endgroup) + (,org-x-tag-flagged . ?f) - ;; (_) life categories, used for gtd priorities + ;; life categories, used for gtd priorities (:startgroup) - ("_env" . ?E) ;; environmental - ("_fin" . ?F) ;; financial - ("_int" . ?I) ;; intellectual - ("_met" . ?M) ;; metaphysical - ("_phy" . ?H) ;; physical - ("_pro" . ?P) ;; professional - ("_rec" . ?R) ;; recreational - ("_soc" . ?S) ;; social + (,org-x-tag-environmental . ?E) + (,org-x-tag-financial . ?F) + (,org-x-tag-intellectual . ?I) + (,org-x-tag-metaphysical . ?M) + (,org-x-tag-physical . ?H) + (,org-x-tag-professional . ?P) + (,org-x-tag-recreational . ?R) + (,org-x-tag-social . ?S) (:endgroup))) #+END_SRC **** colors @@ -2398,7 +2392,7 @@ The modeline is a nice place to indicate if something is clocked in or out. Unfo (setq spaceline-highlight-face-func 'nd/spaceline-highlight-face-clocked) #+END_SRC -*** clustering +*** aggregation Org mode has no way of detecting if conflicts exist. It also has no way of alerting someone if they have overbooked their schedule. The main code is defined in =org-x= so the following is only to set some domain-specific options. diff --git a/local/lib/org-x/org-x.el b/local/lib/org-x/org-x.el index 4b95d80..c6be92b 100644 --- a/local/lib/org-x/org-x.el +++ b/local/lib/org-x/org-x.el @@ -36,6 +36,104 @@ (require 'org) (require 'org-x-agg) + +;;; TAGS + +(defconst org-x-tag-location-context-prefix ?@ + "Prefix character denoting location context tag.") + +(defconst org-x-tag-resource-context-prefix ?# + "Prefix character denoting resource context tag.") + +(defconst org-x-tag-misc-prefix ?% + "Prefix character denoting misc tag.") + +(defconst org-x-tag-category-prefix ?_ + "Prefix character denoting life category tag.") + +(defun org-x-prefix-string (char string) + (concat (char-to-string char) string)) + +(defconst org-x-tag-errand + (org-x-prefix-string org-x-tag-location-context-prefix "errand") + "Tag denoting an errand location.") + +(defconst org-x-tag-home + (org-x-prefix-string org-x-tag-location-context-prefix "home") + "Tag denoting a home location.") + +(defconst org-x-tag-work + (org-x-prefix-string org-x-tag-location-context-prefix "work") + "Tag denoting a work location.") + +(defconst org-x-tag-travel + (org-x-prefix-string org-x-tag-location-context-prefix "travel") + "Tag denoting a travel location.") + +(defconst org-x-tag-laptop + (org-x-prefix-string org-x-tag-resource-context-prefix "laptop") + "Tag denoting a laptop resource.") + +(defconst org-x-tag-tcult + (org-x-prefix-string org-x-tag-resource-context-prefix "tcult") + "Tag denoting a tissue-culture resource.") + +(defconst org-x-tag-phone + (org-x-prefix-string org-x-tag-resource-context-prefix "phone") + "Tag denoting a phone resource.") + +(defconst org-x-tag-note + (org-x-prefix-string org-x-tag-misc-prefix "note") + "Tag denoting a note.") + +(defconst org-x-tag-incubated + (org-x-prefix-string org-x-tag-misc-prefix "inc") + "Tag denoting an incubated task.") + +(defconst org-x-tag-maybe + (org-x-prefix-string org-x-tag-misc-prefix "maybe") + "Tag denoting a maybe task.") + +(defconst org-x-tag-subdivision + (org-x-prefix-string org-x-tag-misc-prefix "subdiv") + "Tag denoting a task awaiting subdivision.") + +(defconst org-x-tag-flagged + (org-x-prefix-string org-x-tag-misc-prefix "flag") + "Tag denoting a flagged task.") + +(defconst org-x-tag-environmental + (org-x-prefix-string org-x-tag-category-prefix "env") + "Tag denoting an environmental life category.") + +(defconst org-x-tag-financial + (org-x-prefix-string org-x-tag-category-prefix "fin") + "Tag denoting a financial life category.") + +(defconst org-x-tag-intellectual + (org-x-prefix-string org-x-tag-category-prefix "int") + "Tag denoting an intellectual life category.") + +(defconst org-x-tag-metaphysical + (org-x-prefix-string org-x-tag-category-prefix "met") + "Tag denoting an metaphysical life category.") + +(defconst org-x-tag-physical + (org-x-prefix-string org-x-tag-category-prefix "phy") + "Tag denoting an physical life category.") + +(defconst org-x-tag-professional + (org-x-prefix-string org-x-tag-category-prefix "pro") + "Tag denoting a professional life category.") + +(defconst org-x-tag-recreational + (org-x-prefix-string org-x-tag-category-prefix "rec") + "Tag denoting a recreational life category.") + +(defconst org-x-tag-social + (org-x-prefix-string org-x-tag-category-prefix "soc") + "Tag denoting a social life category.") + ;;; PROPERTIES (eval-and-compile @@ -79,7 +177,6 @@ ;;; CONSTANTS - (defconst org-x-iter-future-time (* 7 24 60 60) "Iterators must have at least one task greater into the future to be active.")