0

I'm following these instructions https://www.gnu.org/software/emacs/manual/html_node/emacs/Holiday-Customizing.html to try and add Colombian holidays but I haven't been able to add holidays of the form "on the 29th of June if its a Monday or on the next monday".

Can anyone help me with a holiday-sexp that will achieve this?

Note: I'm an elisp noob

1

The expression you're looking for is

(holiday-sexp '(calendar-nth-named-day 1 1 6 year 29)
              "St Peter and St Paul")

I recommend you look at the function's documentation (C-h f calendar-nth-named-day RET) for an explanation of its arguments. Here, the symbol year is bound for you by holiday-sexp, so you don't need to define it.

Usually custom holidays are added to the list holiday-other-holidays, either in one swell foop like so:

(setq holiday-other-holidays
      '((holiday-sexp '(calendar-nth-named-day 1 1 6 year 29)
                      "St Peter and St Paul")))

or incrementally, like so:

(add-to-list 'holiday-other-holidays
             '(holiday-sexp '(calendar-nth-named-day 1 1 6 year 29)
                            "St Peter and St Paul"))

Note that the calendar-nth-named-day sexp must be quoted even within another quoted expression, as holiday-sexp evals its arguments.

1
  • Can you fix the command for accessing the function documentation? It should be C-h f May 11 '17 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.