From 0e9ea88e0d93f59b9a7588f4a0d079364a370ce4 Mon Sep 17 00:00:00 2001 From: Kat Huang Date: Tue, 22 Aug 2023 04:05:03 +0000 Subject: [PATCH] [Emacs] Add shared shopping list --- dotfiles/emacs.d/README.org | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index a705f885..bac6bb12 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -3111,6 +3111,11 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877 (string-prefix-p (file-truename imalison:shared-org-dir) (file-truename default-directory))) + (require 'org-habit) + (when (not (fboundp 'org-is-habit-p)) + (defun org-is-habit-p () + (string-equal (org-entry-get nil "STYLE") "habit"))) + (defun imalison:habit-or-repeating-heading () (org-is-habit-p)) @@ -3393,6 +3398,9 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877 (imalison:join-paths imalison:shared-org-dir "shared_habits.org")) (defvar imalison:shared-calendar-file (imalison:join-paths imalison:shared-org-dir "shared_calendar.org")) + (defvar imalison:shared-shopping-file + (imalison:join-paths imalison:shared-org-dir "shared_shopping.org")) + (defvar imalison:orgzly-files (list (imalison:join-paths imalison:shared-org-dir "kat_orgzly.org") @@ -3411,7 +3419,7 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877 (nconc (list imalison:org-gtd-file imalison:org-habits-file imalison:org-calendar-file imalison:org-inbox-file imalison:shared-org-gtd-file imalison:shared-habits-file - imalison:shared-calendar-file) + imalison:shared-calendar-file imalison:shared-shopping-file) imalison:orgzly-files)) (add-to-list 'org-capture-templates @@ -3436,6 +3444,10 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877 (file ,imalison:org-calendar-file) ,(format "%s\n%s\n%s" "* %?" imalison:created-property-string "%^T"))) + (add-to-list 'org-capture-templates + `("z" "Shopping Todo" entry (file ,imalison:shared-shopping-file) + (function (lambda (&rest args) (imalison:make-org-todo-template :creation-state "TODO"))))) + (add-to-list 'org-capture-templates `("h" "Habit" entry (file ,imalison:org-habits-file) "* TODO