aboutsummaryrefslogtreecommitdiff
path: root/.emacs.local.d
diff options
context:
space:
mode:
authorRaúl Benencia <id@rbenencia.name>2023-05-17 08:55:40 -0700
committerRaúl Benencia <id@rbenencia.name>2023-05-17 08:56:19 -0700
commit3c5a1b28106f6e8891576482e94a106188b9f571 (patch)
tree998ecdb859e5469bcde4dfe53d5c9aba30ae8fd9 /.emacs.local.d
parent282d33b3f4a686b8ca0331ffdc1e256119fc8ca0 (diff)
emacs: add function for skipping by tag in org-agenda
Diffstat (limited to '.emacs.local.d')
-rw-r--r--.emacs.local.d/lisp/packages/rul-org-agenda.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/.emacs.local.d/lisp/packages/rul-org-agenda.el b/.emacs.local.d/lisp/packages/rul-org-agenda.el
index 7a6e787..8122afb 100644
--- a/.emacs.local.d/lisp/packages/rul-org-agenda.el
+++ b/.emacs.local.d/lisp/packages/rul-org-agenda.el
@@ -365,6 +365,23 @@ as the default task."
(defvar bh/organization-task-id "eb155a82-92b2-4f25-a3c6-0304591af2f9")
+;; https://stackoverflow.com/a/10091330
+(defun zin/org-agenda-skip-tag (tag &optional others)
+ "Skip all entries that correspond to TAG.
+
+If OTHERS is true, skip all entries that do not correspond to TAG."
+ (let ((next-headline (save-excursion (or (outline-next-heading) (point-max))))
+ (current-headline (or (and (org-at-heading-p)
+ (point))
+ (save-excursion (org-back-to-heading)))))
+ (if others
+ (if (not (member tag (org-get-tags-at current-headline)))
+ next-headline
+ nil)
+ (if (member tag (org-get-tags-at current-headline))
+ next-headline
+ nil))))
+
(defun bh/clock-in-organization-task-as-default ()
(interactive)
(org-with-point-at (org-id-find bh/organization-task-id 'marker)
nihil fit ex nihilo