1

I'm trying to show weekend days in agenda org-mode in red font-face Followed this instructions to no avail

https://julien.danjou.info/org-mode-and-holidays/

Testing the link above the mentioned variables seems that don't exist anymore

[no match] 

Tried this function here too. But no success so far:

color specific days in different background in org agenda

Would be awesome if holidays are in red too

any hint will be much appreciated.

Forge
  • 275
  • 2
  • 13
  • I just tried using that feature and it works for me. What have you done to investigate? Did the face get applied to the day headings? In the agenda, with the cursor on a date heading, try `what-cursor-position` with a prefix argument to see whether the appropriate face is listed in the text properties (`Ctrl-u C-x =` in regular emacs, `4 C-x =` if you're using evil, e.g. in spacemacs). I don't know what you mean when you write `[no match] seems that mentioned variables are deprecated`. – Croad Langshan Nov 05 '18 at 23:33

1 Answers1

1

Here's what works for me in emacs 26.1 to do what you asked for -- but it's very similar to what's in the answer from the other question that you referenced:

(defface my/org-agenda-holiday '((t (:inherit default)))
  "Base face used in agenda for holidays, whether today's date or not."
  :group 'org-faces)
(defface my/org-agenda-holiday-not-today '((t (:inherit (my/org-agenda-holiday org-agenda-date))))
  "Face used in agenda for holidays other than for today's date."
  :group 'org-faces)
(defface my/org-agenda-holiday-today '((t (:inherit (my/org-agenda-holiday org-agenda-date-today))))
  "Face used in agenda for holidays for today's date."
  :group 'org-faces)
(custom-set-faces
 '(my/org-agenda-holiday ((t (:foreground "red")))))
(defun my/org-agenda-day-face-function (day)
  (let* ((abs (calendar-absolute-from-gregorian day))
         (todayp (org-agenda-today-p abs))
         (day-of-week (calendar-day-of-week day))
         (holidayp (or
                    (= day-of-week 0) (= day-of-week 6)
                    (holiday-in-range abs abs))))
    (cond ((and todayp holidayp) 'my/org-agenda-holiday-today)
          (holidayp 'my/org-agenda-holiday-not-today)
          (todayp 'org-agenda-date-today)
          (t 'org-agenda-date))))
(setq org-agenda-day-face-function #'my/org-agenda-day-face-function)
Croad Langshan
  • 3,192
  • 14
  • 42
  • worked, but only for weekends and USA holidays..Local holidays are not modified. – Forge Nov 07 '18 at 11:41
  • 1
    @Forge you just have to set up the holidays you want: https://www.gnu.org/software/emacs/manual/html_node/emacs/Holiday-Customizing.html Here's how I set up UK holidays: https://emacs.stackexchange.com/a/45352/5495 – Croad Langshan Nov 07 '18 at 20:20
  • That’s the issue. The local holidays were set beforehand – Forge Nov 09 '18 at 10:52
  • Then I think you'll need to give detailed information about exactly what you did. A good way to let other people reproduce your situation is to run emacs -Q and then show the full elisp you evaluated. – Croad Langshan Nov 10 '18 at 17:49