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:54:43 +1100 Message-ID: <87r3t72eoc.fsf@gmail.com> References: <87pp8sz70q.fsf@hornet.workgroup> <871tl8s0f0.fsf@gmail.com> <87r3t7z4o4.fsf@hornet.workgroup> <87sidn83k3.fsf@yale.edu> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Return-path: In-reply-to: <87sidn83k3.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-03T08:58:20+1100, Jorge A. Alfaro-Murillo said: JAA> holidays.el appends holiday-local-holidays to calendar-holidays JAA> via a defcustom, so if you set holiday-local-holidays in your JAA> .emacs, restart emacs and the local holidays are not in JAA> calendar-holidays, it is because you are calling something that JAA> loads holidays.el before you set holiday-local-holidays. JAA> If you add the code above to your .emacs and later modify your JAA> configuration and remove or move the part that loads JAA> holidays.el, then either your code will fail (because JAA> calendar-holidays is not yet defined) or calendar-holidays will JAA> have your local holidays twice and they will show twice in your JAA> agenda. JAA> I think that you should look for whatever calls holidays.el and JAA> set holiday-local-holidays before that. i just tried moving my `(setq holiday-local-holidays ...)` to the very first line of my config setup, and lo, that does result in local holidays appearing in my Org agenda. However, my config setup is a 3000+ line Org Babel file, in which i group together things that are related in my mind, and the setup for the calendar is about a third of the way through this. Thus .... JAA> If not, then at least use eval-after-load so that JAA> calendar-holidays is already defined when the code is run, and JAA> add-to-list so that the entries do not get added twice if they are JAA> already there: JAA> #+BEGIN_SRC emacs-lisp (eval-after-load 'holidays '(dolist JAA> (holiday holiday-local-holidays) (add-to-list 'calendar-holidays JAA> holiday)) #+END_SRC .... works better in my context, and is more robust, longer-term, than my original suggestion to use (setq calendar-holidays (append calendar-holidays holiday-local-holidays)) So, thank you! Although i do note that my suggestion was nevertheless within the guidelines of the documentation for `calendar-holidays`: 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. i feel the above documentation could be improved by adding that `eval-after-load` should probably by used in this context, e.g.: 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, for example by using `eval-after-load': (eval-after-load 'holidays '(dolist (holiday holiday-local-holidays) (add-to-list 'calendar-holidays holiday))) i'll open a GNU Emacs issue to that effect. :-) Thanks again! Alexis.