From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexis Newsgroups: gmane.emacs.help,gmane.emacs.orgmode Subject: Re: [O] 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: ger.gmane.org 1425336923 1290 80.91.229.3 (2 Mar 2015 22:55:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Mar 2015 22:55:23 +0000 (UTC) Cc: help-gnu-emacs To: emacs-orgmode@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 02 23:55:18 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YSZF5-0006MA-Vr for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Mar 2015 23:55:16 +0100 Original-Received: from localhost ([::1]:60220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSZF5-000884-Bh for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Mar 2015 17:55:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSZEn-000859-FH for help-gnu-emacs@gnu.org; Mon, 02 Mar 2015 17:54:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSZEm-0002qP-6S for help-gnu-emacs@gnu.org; Mon, 02 Mar 2015 17:54:57 -0500 Original-Received: from mail-pd0-x22c.google.com ([2607:f8b0:400e:c02::22c]:38938) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSZEg-0002oJ-32; Mon, 02 Mar 2015 17:54:50 -0500 Original-Received: by pdjy10 with SMTP id y10so43179206pdj.6; Mon, 02 Mar 2015 14:54:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; bh=gEQehITVXkHrMKoEz/D9TXJuqT+Rf5rwqShG6I9VtYg=; b=re6t3v080ZaHkLmjPgm9fzDRhVdPtDnT2y6EKfd5sUpa8DFrDvQbnrxfDJoQVP0jy7 SRslGP+E/R9cVfOBXoQmBPWbNDQcobau45HsPaFCndoyHRHWTDmCqjFz4dbuSvoDQzbC ngySH85gC6LtgRv1xjzPqPmGIPqXD3PDXJ4NGoFhCQgu2Lgi0tg0oxHzxnwjhROdCidq 1jlBCdhhEwmBfa0EqlFzK8vlBQvcvIHHFVtGHVGT61wVP8R8s1VfnX0i78zEwoB+D7zz Y9HILkxAYDrc0pHn67esnosUM1F3wzg4bHxcFOsP/AQocsBfsvgkkH1fNXTBq1d499ZN DZvA== X-Received: by 10.70.93.69 with SMTP id cs5mr17148291pdb.42.1425336889205; Mon, 02 Mar 2015 14:54:49 -0800 (PST) Original-Received: from localhost (ppp118-209-174-156.lns20.mel8.internode.on.net. [118.209.174.156]) by mx.google.com with ESMTPSA id z4sm449565pdn.46.2015.03.02.14.54.47 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 02 Mar 2015 14:54:48 -0800 (PST) In-reply-to: <87sidn83k3.fsf@yale.edu> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::22c X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102987 gmane.emacs.orgmode:95598 Archived-At: 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.