From 5fc43e2a75b2af4a38f6579087aadbc188af9da4 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Thu, 31 Aug 2023 18:59:44 +0800 Subject: org: move account loading to the right place The file "account.el" appends to the `org-agenda-custom-commands` and org-capture-templates, whereas the codes in "org-conf.el" sets the above two variables, so the file "account.el" needs to be loaded after the variables are set. --- org-conf.el | 72 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'org-conf.el') diff --git a/org-conf.el b/org-conf.el index 0d2d0c6..2cd4906 100644 --- a/org-conf.el +++ b/org-conf.el @@ -261,42 +261,6 @@ in Lisp code use `org-set-tags' instead." (advice-add 'org-set-tags-command :override 'durand-org-set-tags-command) -;;; Accounts - -(load-file "account.el") - -;; ;;;###autoload -;; (defvar durand-org-capture-account-which-list -;; '("breakfast" "brunch" "brunverage" "lunch" "dinner" "beverage" "snack" "fruit") -;; "The list of purposes of accounts in the capture-template for accounting.") - -;; ;;;###autoload -;; (defun durand-org-capture-account-template () -;; "Org capture template for account." -;; (let* ((shop-and-items (durand-org-complete-capture-account)) -;; (which (completing-read -;; "For what? " -;; durand-org-capture-account-which-list)) -;; (cost (number-to-string -;; (read-number "Cost: " 0))) -;; (from (completing-read "From: " '("Cash" "etique"))) -;; (active-time (format-time-string -;; (cdr org-time-stamp-formats))) -;; (inactive-time -;; (let ((temp active-time)) -;; (while (string-match "<\\|>" temp) -;; (setf temp -;; (replace-match -;; (cond -;; ((string= (match-string-no-properties 0 temp) "<") "[") -;; ((string= (match-string-no-properties 0 temp) ">") "]")) -;; nil nil temp))) -;; temp))) -;; (format "%s\n :PROPERTIES:\n :cost: %s\n :FROM: %s\n :RECORD_TIME: %s\n :END: \n %s%%?" -;; which cost from inactive-time shop-and-items))) - -(require 'org-protocol) - ;;; Capture templates (setq org-capture-templates @@ -411,6 +375,42 @@ in Lisp code use `org-set-tags' instead." ;; ((durand-agenda-command-sections-time))) )) +;;; Accounts + +(load-file "account.el") + +;; ;;;###autoload +;; (defvar durand-org-capture-account-which-list +;; '("breakfast" "brunch" "brunverage" "lunch" "dinner" "beverage" "snack" "fruit") +;; "The list of purposes of accounts in the capture-template for accounting.") + +;; ;;;###autoload +;; (defun durand-org-capture-account-template () +;; "Org capture template for account." +;; (let* ((shop-and-items (durand-org-complete-capture-account)) +;; (which (completing-read +;; "For what? " +;; durand-org-capture-account-which-list)) +;; (cost (number-to-string +;; (read-number "Cost: " 0))) +;; (from (completing-read "From: " '("Cash" "etique"))) +;; (active-time (format-time-string +;; (cdr org-time-stamp-formats))) +;; (inactive-time +;; (let ((temp active-time)) +;; (while (string-match "<\\|>" temp) +;; (setf temp +;; (replace-match +;; (cond +;; ((string= (match-string-no-properties 0 temp) "<") "[") +;; ((string= (match-string-no-properties 0 temp) ">") "]")) +;; nil nil temp))) +;; temp))) +;; (format "%s\n :PROPERTIES:\n :cost: %s\n :FROM: %s\n :RECORD_TIME: %s\n :END: \n %s%%?" +;; which cost from inactive-time shop-and-items))) + +(require 'org-protocol) + ;;; elisp in link confirmation (setq org-link-elisp-confirm-function 'y-or-n-p) -- cgit v1.2.3-18-g5258