From ebc2d58aa74eef7be4a0e90a109fcfd96aa23a70 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Thu, 18 Mar 2021 06:09:06 +0100 Subject: [PATCH] Reorganize Org mode custom functions for better readability --- configuration.org | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/configuration.org b/configuration.org index 776edd5..43359b4 100644 --- a/configuration.org +++ b/configuration.org @@ -1040,12 +1040,14 @@ TODO: What is FIELD for?" (or (abbrev--before-point) (yasnippet-can-fire-p))) #+END_SRC -** Filter out tasks from the Org agenda if they have a specific priority +** Org mode stuff + +*** Filter out tasks from the Org agenda if they have a specific priority The whole idea comes from [[https://blog.aaronbieber.com/2016/09/24/an-agenda-for-life-with-org-mode.html][here]], which i use almost verbatim. This is also the reason it has the ~air-~ prefix. -#+BEGIN_SRC emacs-lisp +#+begin_src emacs-lisp (defun air-org-skip-subtree-if-priority (priority) "Skip an agenda subtree if it has a priority of PRIORITY. @@ -1056,37 +1058,37 @@ PRIORITY may be one of the characters ?A, ?B, or ?C." (if (= pri-value pri-current) subtree-end nil))) -#+END_SRC +#+end_src -** Filter out habits from the Org agenda +*** Filter out habits from the Org agenda -#+BEGIN_SRC emacs-lisp +#+begin_src emacs-lisp (defun air-org-skip-subtree-if-habit () "Skip an agenda entry if it has a STYLE property equal to \"habit\"." (let ((subtree-end (save-excursion (org-end-of-subtree t)))) (if (string= (org-entry-get nil "STYLE") "habit") subtree-end nil))) -#+END_SRC +#+end_src -** Filter out entries from the Org agenda with a specific state +*** Filter out entries from the Org agenda with a specific state -#+BEGIN_SRC emacs-lisp +#+begin_src emacs-lisp (defun gpolonkai/org-skip-subtree-if-state (state) "Skip an agenda entry if its state is STATE." (let ((subtree-end (save-excursion (org-end-of-subtree t)))) (if (string= (org-get-todo-state) state) subtree-end nil))) -#+END_SRC +#+end_src -** Wrapper around ~org-agenda~ to open my own custom list +*** Wrapper around ~org-agenda~ to open my own custom list -#+BEGIN_SRC emacs-lisp +#+begin_src emacs-lisp (defun gpolonkai/org-agenda-list (&optional arg) (interactive "P") (org-agenda arg "c")) -#+END_SRC +#+end_src * UI preferences