From unknown Fri Jun 13 11:30:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11272: 24.1.50; `holiday-sexp' not always sufficient Resent-From: Michael Heerdegen Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Apr 2012 17:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11272 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 11272@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Reply-To: michael_heerdegen@web.de Received: via spool by submit@debbugs.gnu.org id=B.13347701202762 (code B ref -1); Wed, 18 Apr 2012 17:29:02 +0000 Received: (at submit) by debbugs.gnu.org; 18 Apr 2012 17:28:40 +0000 Received: from localhost ([127.0.0.1]:40117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SKYgG-0000iQ-GX for submit@debbugs.gnu.org; Wed, 18 Apr 2012 13:28:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43877) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SKYgA-0000iA-UB for submit@debbugs.gnu.org; Wed, 18 Apr 2012 13:28:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKYfk-0003eW-38 for submit@debbugs.gnu.org; Wed, 18 Apr 2012 13:28:11 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, RCVD_IN_XBL autolearn=ham version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:59797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKYfj-0003e6-WF for submit@debbugs.gnu.org; Wed, 18 Apr 2012 13:28:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKYff-0005tW-N0 for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2012 13:28:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKYfa-0003YP-JO for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2012 13:27:59 -0400 Received: from fmmailgate04.web.de ([217.72.192.242]:58657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKYfa-0003Xy-9F for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2012 13:27:54 -0400 Received: from moweb002.kundenserver.de (moweb002.kundenserver.de [172.19.20.108]) by fmmailgate04.web.de (Postfix) with ESMTP id 40B16763DA8E for ; Wed, 18 Apr 2012 19:26:55 +0200 (CEST) Received: from snow.dragon ([89.204.154.74]) by smtp.web.de (mrweb002) with ESMTPA (Nemesis) id 0LopMx-1Rn7ht29xz-00glW9; Wed, 18 Apr 2012 19:26:55 +0200 Date: Wed, 18 Apr 2012 19:28:52 +0200 Message-Id: <87hawhkkyz.fsf@web.de> From: Michael Heerdegen X-Provags-ID: V02:K0:giB9gThgpExWqG0eNJRmFM7QAE7tfiAiZr0dHxX3/a7 9IxGGU5HQez2TvdHRm9YwKLiMtCxOvSmLyd6XUfUCGIMfLoZtJ 5T8MxNQH4bjHfZImFMmFRTe6cQiu9FyLriYq5p12dRC2O64vGE Y7XteOBrBFA7MKkXHCfQA1NWBs/z1tPHoL9fGcY+KhJcW+JFOp BohqHyUS+RGtSGL2/y8xhlPj5dWrf7ikb9WjKW8zC0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Hello, I wonder why it is currently not possible to have `holiday-sexp' or a similar function return a _list_ of entries for a given year, instead of only one (or nil). Could we provide such a feature? Some background (just an example): I have a function like this: (defun sundays-after-trinitatis (year) "List of sundays after Trinitatis in year YEAR." (let ((i 1) (results ()) (easterday (tagnummer-ostertag year)) (3lSoKj (3lSoKj year))) (while (<= i 24) (let* ((day (+ easterday 56 (* 7 i)))) (when (< day 3lSoKj) (push (list (calendar-gregorian-from-absolute (+ (calendar-absolute-from-gregorian (list 1 1 year)) -1 day)) (format "%s. sunday after Trinitatis" i)) results))) (setq i (+ i 1))) results)) For any year, according to certain rules, certain sundays are named "nth sunday after Trinitatis", depending on `year'. The above function returns the list of them for any given year. But I can't use it directly with `holiday-sexp' - I have to write my own interface function for the calendar: (defun holiday-sundays-after-trinitatis () "List of visible sundays after Trinitatis in `calendar'." (let ((year displayed-year)) (holiday-filter-visible-calendar (append (sonntage-nach-trinitatis year) (sonntage-nach-trinitatis (+ 1 year)))))) (eval-after-load "holidays" '(add-to-list 'calendar-holidays '(holiday-sundays-after-trinitatis))) I wonder if we could provide a function `holiday-list', so that it would be possible to do this: (add-to-list 'calendar-holidays '(holidays-list '(holiday-sundays-after-trinitatis))) It would no doubt be useful for other cases as well. It could look similar to this: (defun holiday-list (sexp) (let ((y displayed-year) year dates) (holiday-filter-visible-calendar (append (progn (setq year y) (eval sexp)) (progn (setq year (1+ y)) (eval sexp)))))) Please tell me what you think. If you don't want to add something like that, maybe we could at least improve the manual a bit. Under "Holiday Customization", there is this paragraph: | Some holidays just don't fit into any of these forms because special | calculations are involved in their determination. In such cases you | must write a Lisp function to do the calculation. To include eclipses, | for example, add `(eclipses)' to `holiday-other-holidays' and write an | Emacs Lisp function `eclipses' that returns a (possibly empty) list of | the relevant Gregorian dates among the range visible in the calendar | window, with descriptive strings, like this: | | (((6 4 2012) "Lunar Eclipse") ((11 13 2012) "Solar Eclipse") ... ) I think it would be good to add a simple example for how such a function could look like. No user not browsing the sources will know about `holiday-filter-visible-calendar'. At least that function should be mentioned somewhere. Thanks, Michael. In GNU Emacs 24.1.50.1 (i486-pc-linux-gnu, GTK+ Version 3.2.3) of 2012-04-10 on zelenka, modified by Debian (emacs-snapshot package, version 2:20120410-1) Windowing system distributor `The X.Org Foundation', version 11.0.11104000 Configured using: `configure '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.1.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.1.50/site-lisp:/usr/share/emacs/site-lisp' '--without-compress-info' '--with-crt-dir=/usr/lib/i386-linux-gnu/' '--with-x=yes' '--with-x-toolkit=gtk3' '--with-imagemagick=yes' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2'' From unknown Fri Jun 13 11:30:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11272: 24.1.50; `holiday-sexp' not always sufficient Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 May 2022 11:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11272 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Heerdegen Cc: 11272@debbugs.gnu.org Received: via spool by 11272-submit@debbugs.gnu.org id=B11272.16521834202932 (code B ref 11272); Tue, 10 May 2022 11:51:02 +0000 Received: (at 11272) by debbugs.gnu.org; 10 May 2022 11:50:20 +0000 Received: from localhost ([127.0.0.1]:60478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1noONg-0000lE-DY for submit@debbugs.gnu.org; Tue, 10 May 2022 07:50:20 -0400 Received: from quimby.gnus.org ([95.216.78.240]:54028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1noONe-0000kv-Rr for 11272@debbugs.gnu.org; Tue, 10 May 2022 07:50:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=tk9J7El83p3pH7O6TKrzywMDjl5DshHwL0JZHgJKmWM=; b=RvrGqw5XKFYab2hPxMFAEZCEyn VoAPvXZG8faSV4V7ruv2Jnt9LjSCbxtcyyxuMmLOM3RdOV/a0IQq1NjZyXS5FEonCN+wVK+efgV7/ xuwOZgNvXUR2htLTLG7DKjkDwP4MsbUKU3C65I3XybeiqgechKVsjfPpEj0/Kg+k6iIk=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1noONW-0002xX-LU; Tue, 10 May 2022 13:50:12 +0200 From: Lars Ingebrigtsen References: <87hawhkkyz.fsf@web.de> X-Now-Playing: Joni Mitchell's _Court and Spark_: "Trouble Child" Date: Tue, 10 May 2022 13:50:09 +0200 In-Reply-To: <87hawhkkyz.fsf@web.de> (Michael Heerdegen's message of "Wed, 18 Apr 2012 19:28:52 +0200") Message-ID: <87mtfpk3ny.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Michael Heerdegen writes: > I wonder if we could provide a function `holiday-list', so that it > would be possible to do this: > > (add-to-list 'calendar-holidays '(holidays-list '(holiday-sundays-after-trinitatis))) Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Michael Heerdegen writes: > I wonder if we could provide a function `holiday-list', so that it > would be possible to do this: > > (add-to-list 'calendar-holidays '(holidays-list '(holiday-sundays-after-trinitatis))) (I'm going through old bug reports that unfortunately weren't resolved at the time.) I don't use the calendar much myself, but if I understand the report correctly, what you're suggesting makes sense to me. This was ten years ago, though, so perhaps you've chosen to do something else? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Fri Jun 13 11:30:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11272: 24.1.50; `holiday-sexp' not always sufficient Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 May 2022 00:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11272 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: 11272@debbugs.gnu.org Received: via spool by 11272-submit@debbugs.gnu.org id=B11272.165222872513227 (code B ref 11272); Wed, 11 May 2022 00:26:01 +0000 Received: (at 11272) by debbugs.gnu.org; 11 May 2022 00:25:25 +0000 Received: from localhost ([127.0.0.1]:35439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1noaAO-0003RH-QY for submit@debbugs.gnu.org; Tue, 10 May 2022 20:25:25 -0400 Received: from mout.web.de ([212.227.17.12]:36891) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1noaAM-0003R2-NE for 11272@debbugs.gnu.org; Tue, 10 May 2022 20:25:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1652228715; bh=oX2T/Oom6LBjabzp6OepqgoeXDVFZRSPVnxfuLtAbaY=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=tDY165LolAuIQ94opOleupbLOKXWo8tWaVsF4hsPMT816NorC5tkV1L/fzNcRWzig 51R05yNpBGAFJi4KJvc/6t0SN3vwCUB1CbH8ZpCJVYgu4kbk59FeJq1SF2/dTk6Wzj P4+UhFSk7JoslR5M3O6gcGWoXi4a0EYT/SyZPRHc= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([178.6.28.204]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MLijy-1nX3HP1RSK-00HlEe; Wed, 11 May 2022 02:25:15 +0200 From: Michael Heerdegen References: <87hawhkkyz.fsf@web.de> <87mtfpk3ny.fsf@gnus.org> Date: Wed, 11 May 2022 02:25:14 +0200 In-Reply-To: <87mtfpk3ny.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 10 May 2022 13:50:09 +0200") Message-ID: <87a6bozzit.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:hd/isewtXYaATky3Qp6EnCpPr8IxsDnlYlQOJ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NoKfGAELV5x6rLUvdC3BP+fmKd8zFH4MAghm1ncmpSvHdTEzVmBtR r9BhyqWIB0ZqXcTJlePQynYJD+3y3wckZuY7b36fQ2jKEJ5rpldHArY+zO3kPTxU+856NODds hGR8qTZYLsplkTPNsPVZa7YMXqm2Vr5arCRKKgH4v5fX/huzk3H9EfP9wzLsUj6s+0krmWeYF F0GK/KhaKeJNURwrK+np7zUwpaLLB8AFFU+GD5YFKNObtniyRU3zDuiZBM5qWydZXTR3PTmVF KS8+ZvVMATn6tU= X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > > I wonder if we could provide a function `holiday-list', so that it > > would be possible to do this: > > > > (add-to-list 'calendar-holidays > > '(holidays-list '(holiday-sundays-after-trinitatis))) > I don't use the calendar much myself, but if I understand the report > correctly, what you're suggesting makes sense to me. This was ten years > ago, though, so perhaps you've chosen to do something else? Now I'm using my own extension library for diary sexps, it also handles holidays. AFAIR, one problem (with holidays) I later faced had been that it was not possible at all to use the calendar holiday definitions in diary sexps. You can mark and list holidays in the calendar, but it is not possible to use a diary sexp for date definitions like "Every Monday meet Peter unless it's a holiday". So I wrote some glue code to make things like that possible, but it's all a bit hackish because Calendar and Diary are written in a way that I don't like, like Ediff, with lots of special variables and weird references to global state. So now I'm using only the basic mechanisms from Calendar and Diary, and the stuff I need to hack is only my own code. Not sure yet what I will do with that code. Touching the calendar and diary libs is nothing I look forward to, to be honest. Michael.