emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo)
To: emacs-orgmode@gnu.org
Cc: help-gnu-emacs@gnu.org
Subject: Re: org-calendar-holiday and local holidays
Date: Mon, 02 Mar 2015 16:58:20 -0500	[thread overview]
Message-ID: <87sidn83k3.fsf@yale.edu> (raw)
In-Reply-To: 87r3t7z4o4.fsf@hornet.workgroup

Melleus  writes:

> Alexis <flexibeast@gmail.com> writes: 
> 
>> see that local holiday. To fix this, i use M-: to evaluate: 
>> 
>>    (setq calendar-holidays (append calendar-holidays 
>> holiday-local-holidays)) 
> 
> Works perfectly this way, thank you. 
> 
> jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) writes: 
> 
>> They should show up after you restart emacs. 
> 
> I supposed it should. But in fact in does not work.

holidays.el appends holiday-local-holidays to calendar-holidays 
via a defcustom, so if you set holiday-local-holidays in your 
.emacs, restart emacs and the local holidays are not in 
calendar-holidays, it is because you are calling something that 
loads holidays.el before you set holiday-local-holidays.

If you add the code above to your .emacs and later modify your 
configuration and remove or move the part that loads holidays.el, 
then either your code will fail (because calendar-holidays is not 
yet defined) or calendar-holidays will have your local holidays 
twice and they will show twice in your agenda.

I think that you should look for whatever calls holidays.el and 
set holiday-local-holidays before that.

If not, then at least use eval-after-load so that 
calendar-holidays is already defined when the code is run, and 
add-to-list so that the entries do not get added twice if they are 
already there:

#+BEGIN_SRC emacs-lisp
  (eval-after-load 'holidays
    '(dolist (holiday holiday-local-holidays)
             (add-to-list 'calendar-holidays holiday))
#+END_SRC

Best,
-- 
Jorge.

  reply	other threads:[~2015-03-02 21:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-01 22:29 org-calendar-holiday and local holidays Melleus
2015-03-02  0:33 ` Alexis
2015-03-02 15:26   ` Jorge A. Alfaro-Murillo
2015-03-02 22:23     ` Alexis
2015-03-02 17:32   ` Melleus
2015-03-02 21:58     ` Jorge A. Alfaro-Murillo [this message]
2015-03-02 22:54       ` Alexis
2015-03-02 23:53         ` Jorge A. Alfaro-Murillo
2015-03-03 13:43       ` Melleus
2015-03-02  1:40 ` Nick Dokos
2015-03-02 15:34 ` Jorge A. Alfaro-Murillo
2015-03-02 17:30   ` Melleus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sidn83k3.fsf@yale.edu \
    --to=jorge.alfaro-murillo@yale.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).