From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexis Subject: Re: org-calendar-holiday and local holidays Date: Tue, 03 Mar 2015 09:23:18 +1100 Message-ID: <87sidn3up5.fsf@gmail.com> References: <87pp8sz70q.fsf@hornet.workgroup> <871tl8s0f0.fsf@gmail.com> <87y4nfzahe.fsf@yale.edu> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Return-path: In-reply-to: <87y4nfzahe.fsf@yale.edu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: help-gnu-emacs List-Id: emacs-orgmode.gnu.org On 2015-03-03T02:26:37+1100, Jorge A. Alfaro-Murillo said: JAA> Alexis writes: >> When i scroll down to look at the current value of >> `calendar-holidays`, however, i see that neither the current >> value nor the original value makes any reference to the >> `holiday-local-holidays` variable. And indeed, when i examine >> my agenda for next Monday, which is a local holiday i've >> specified in `holiday-local-holidays`, i can't see that local >> holiday. To fix this, i use M-: to evaluate: >> >> (setq calendar-holidays (append calendar-holidays >> holiday-local-holidays)) >> >> after which the local holiday next Monday appears in my Org >> agenda. JAA> You do not need to add that, calendar-holidays appends JAA> holiday-local-holidays when holidays.el is loaded, just restart JAA> emacs. Not in my Emacs (manually compiled 24.4.1, the most recent official stable release). My `local-holidays` variable was set for years, such that only as part of trying to help the OP did i notice that it's been obsoleted; the documentation for it says: This variable is an alias for `holiday-local-holidays'. This variable is obsolete since 23.1; use `holiday-local-holidays' instead. So i changed my init to refer to `holiday-local-holidays` instead of `local-holidays`, and restarted Emacs, and the issue persisted: the value of `holiday-local-holidays` is /not/ included in `calendar-holidays` by default. The `(setq calendar-holidays ...` line i described above is necessary to work around this. JAA> It is also not a documentation bug, at least in my emacs JAA> (25.0.50.1) the documentation of calendar-holidays says clearly: JAA> "Note that these variables [`holiday-other-holidays', JAA> `holiday-general-holidays', `holiday-local-holidays', JAA> `holiday-christian-holidays', `holiday-hebrew-holidays', JAA> `holiday-islamic-holidays', `holiday-bahai-holidays', JAA> `holiday-oriental-holidays' and `holiday-solar-holidays'] have JAA> no effect on `calendar-holidays' after it has been set JAA> (e.g. after the calendar is loaded). In that case, customize JAA> `calendar-holidays' directly." In 24.4.1, the documentation is phrased differently; it says: Additional holidays are easy to add to the list, just put them in the list `holiday-other-holidays' in your init file. Similarly, by setting any of `holiday-general-holidays', `holiday-local-holidays', `holiday-christian-holidays', `holiday-hebrew-holidays', `holiday-islamic-holidays', `holiday-bahai-holidays', `holiday-oriental-holidays', or `holiday-solar-holidays' to nil in your init file, you can eliminate unwanted categories of holidays. The aforementioned variables control the holiday choices offered by the function `holiday-list' when it is called interactively. They also initialize the default value of `calendar-holidays', which is the default list of holidays used by the function `holiday-list' in the non-interactive case. Note that these variables have no effect on `calendar-holidays' after it has been set (e.g. after the calendar is loaded). In that case, customize `calendar-holidays' directly. The intention is that (in the US) `holiday-local-holidays' be set in site-init.el and `holiday-other-holidays' be set by the user. It's the fact that, despite the above docstring, and that, as i described above, setting the value of `holiday-local-holidays` has no direct effect on `calendar-holidays` /even after a restart of Emacs/, that led me to suggest there might be a code bug or a documentation bug (e.g. maybe some variable needed to be set to `t` to ensure the value of `holiday-local-holidays` gets included in `calendar-holidays`). Since things work for you, and the phrasing for the documentation for `calendar-holidays` has changed between the most recent stable release and the development version of Emacs you're using, my guess is that there is indeed a bug in 24.4.1 and earlier that has subsequently been fixed. Later today i'll try building from the first 24.5 pretest and the master branch, and examine what happens with `holiday-local-holidays` / `calendar-holidays` in both instances. Alexis.