Reorganize Org mode custom functions for better readability
This commit is contained in:
parent
c62c1ac457
commit
ebc2d58aa7
@ -1040,12 +1040,14 @@ TODO: What is FIELD for?"
|
|||||||
(or (abbrev--before-point) (yasnippet-can-fire-p)))
|
(or (abbrev--before-point) (yasnippet-can-fire-p)))
|
||||||
#+END_SRC
|
#+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
|
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.
|
~air-~ prefix.
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun air-org-skip-subtree-if-priority (priority)
|
(defun air-org-skip-subtree-if-priority (priority)
|
||||||
"Skip an agenda subtree if it has a priority of 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)
|
(if (= pri-value pri-current)
|
||||||
subtree-end
|
subtree-end
|
||||||
nil)))
|
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 ()
|
(defun air-org-skip-subtree-if-habit ()
|
||||||
"Skip an agenda entry if it has a STYLE property equal to \"habit\"."
|
"Skip an agenda entry if it has a STYLE property equal to \"habit\"."
|
||||||
(let ((subtree-end (save-excursion (org-end-of-subtree t))))
|
(let ((subtree-end (save-excursion (org-end-of-subtree t))))
|
||||||
(if (string= (org-entry-get nil "STYLE") "habit")
|
(if (string= (org-entry-get nil "STYLE") "habit")
|
||||||
subtree-end
|
subtree-end
|
||||||
nil)))
|
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)
|
(defun gpolonkai/org-skip-subtree-if-state (state)
|
||||||
"Skip an agenda entry if its state is STATE."
|
"Skip an agenda entry if its state is STATE."
|
||||||
(let ((subtree-end (save-excursion (org-end-of-subtree t))))
|
(let ((subtree-end (save-excursion (org-end-of-subtree t))))
|
||||||
(if (string= (org-get-todo-state) state)
|
(if (string= (org-get-todo-state) state)
|
||||||
subtree-end
|
subtree-end
|
||||||
nil)))
|
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)
|
(defun gpolonkai/org-agenda-list (&optional arg)
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(org-agenda arg "c"))
|
(org-agenda arg "c"))
|
||||||
#+END_SRC
|
#+end_src
|
||||||
|
|
||||||
* UI preferences
|
* UI preferences
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user