diff options
author | Matthew Lemon <y@yulqen.org> | 2024-07-08 13:57:02 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-07-08 13:57:02 +0100 |
commit | 63c4a52d91c89b12fade73861f59ef346f2eb079 (patch) | |
tree | 809dfc6abcf65dda7add4eede07909f281c1964a | |
parent | 311ebf6e8e252798dd3b09f4cf0e569153f8bd1b (diff) |
Added colours for radcal and radcal_alt on agenda
This is using a nice bit of emacs lisp to do - awesome.
-rw-r--r-- | init.el | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -1624,3 +1624,30 @@ If failed try to complete the common part with `company-complete-common'" ("TODO" ("WAITING") ("CANCELLED") ("HOLD")) ("NEXT" ("WAITING") ("CANCELLED") ("HOLD")) ("DONE" ("WAITING") ("CANCELLED") ("HOLD")))))) + +(defface org-agenda-radcal-highlight-face `((t :foreground "SpringGreen3")) + "Face used to highlight radcal entries in agenda view. +https://emacs.stackexchange.com/questions/69564/changing-the-color-of-items-in-org-mode-agenda-depending-on-keyword-tag") + +(defface org-agenda-radcal-alt-highlight-face `((t :foreground "dark magenta")) + "Face used to highlight radcal entries in agenda view. +https://emacs.stackexchange.com/questions/69564/changing-the-color-of-items-in-org-mode-agenda-depending-on-keyword-tag") + +(defun org-agenda-highlight-radcal-entries () + "Highlight calendar items in agenda." + (let ((inhibit-read-only t)) + (save-excursion + (goto-char (point-min)) + (while (not (eobp)) + (let ((line-begin (line-beginning-position)) + (line-end (line-end-position))) + (save-excursion + (goto-char line-begin) + (when (re-search-forward "radcal_alt" line-end t) + (font-lock-prepend-text-property line-begin line-end 'face 'org-agenda-radcal-alt-highlight-face)) + (when (re-search-forward "radcal" line-end t) + (font-lock-prepend-text-property line-begin line-end 'face 'org-agenda-radcal-highlight-face)))) + (forward-line 1))))) + +(add-hook 'org-agenda-finalize-hook #'org-agenda-highlight-radcal-entries) + ;; (add-hook 'org-agenda-finalize-hook #'org-agenda-highlight-cal-entry) |