From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 16 17:25:35 2012 Received: (at submit) by debbugs.gnu.org; 16 Apr 2012 21:25:35 +0000 Received: from localhost ([127.0.0.1]:37377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJtQS-0003dD-RB for submit@debbugs.gnu.org; Mon, 16 Apr 2012 17:25:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46507) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJtQQ-0003cz-EX for submit@debbugs.gnu.org; Mon, 16 Apr 2012 17:25:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SJtQF-0004fp-LJ for submit@debbugs.gnu.org; Mon, 16 Apr 2012 17:25:21 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,RCVD_IN_XBL autolearn=ham version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:57660) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJtQF-0004fb-H8 for submit@debbugs.gnu.org; Mon, 16 Apr 2012 17:25:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJtQD-0006zT-ML for bug-gnu-emacs@gnu.org; Mon, 16 Apr 2012 17:25:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SJtQB-0004bV-NJ for bug-gnu-emacs@gnu.org; Mon, 16 Apr 2012 17:25:17 -0400 Received: from fmmailgate07.web.de ([217.72.192.248]:36072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJtQB-0004Yy-Dg for bug-gnu-emacs@gnu.org; Mon, 16 Apr 2012 17:25:15 -0400 Received: from moweb002.kundenserver.de (moweb002.kundenserver.de [172.19.20.108]) by fmmailgate07.web.de (Postfix) with ESMTP id AD26411AB73C for ; Mon, 16 Apr 2012 23:25:13 +0200 (CEST) Received: from snow.dragon ([89.204.138.158]) by smtp.web.de (mrweb001) with ESMTPA (Nemesis) id 0LwZA7-1SCzIt2iI3-018NF9; Mon, 16 Apr 2012 23:25:13 +0200 Date: Mon, 16 Apr 2012 23:27:08 +0200 Message-Id: <8762cz4bbn.fsf@web.de> From: Michael Heerdegen To: bug-gnu-emacs@gnu.org Subject: 24.1.50; `holiday-sexp' may create entry twice X-Provags-ID: V02:K0:ItUU/etKcAVzfpkTI0VnZJnxDqzWVDEGOkqO/QOtv4Z vjJYFnHdWAIuZLUWiEO8WIaSQkAMNOwZAQcYw0z9Dv0ZAqRcbu dBOqY6vJ4VrGubEmcDBQIUuVmXldpdbADqGevsjyx0oaas6kXx 6glISbK9pxxzyg0BELezvWFoNd9T15EF9eKhRblHCnOb96QOF4 2q81p/z2ZNfzLfsohKnZxsqw+/ogcwmKvtHdbaLovY= 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.9 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: michael_heerdegen@web.de 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.9 (------) Hi, the following happens also in Emacs 23. Recipe: 1. emacs -Q 2. M-x calendar RET 3. evaluate: (require 'holidays) 4. evaluate: (add-to-list 'calendar-holidays '(holiday-sexp '(list 4 17 2012) "April 17th 2012")) 5. In the calendar, move point to April 17th 2012 and hit h. You'll see that "April 17th 2012" appears twice. I've debugged this. `calendar-holiday-list' indeed returns two entries for this date. The bug is in `holiday-sexp': | (defun holiday-sexp (sexp string) | "Sexp holiday for dates in the calendar window. | SEXP is an expression in variable `year' that is evaluated to | give `date'. STRING is an expression in `date' that evaluates to | the holiday description of `date'. If `date' is visible in the | calendar window, the holiday STRING is on that date. If date is | nil, or if the date is not visible, there is no holiday." | (let ((m displayed-month) | (y displayed-year) | year date) | (calendar-increment-month m y -1) | (holiday-filter-visible-calendar | (list | (progn | (setq year y | date (eval sexp)) | (list date (if date (eval string)))) | (progn | (setq year (1+ y) | date (eval sexp)) ;; <------------------------------- | (list date (if date (eval string)))))))) At the marked position, there is no check if `date' is in the incremented year. I see two possible fixes: 1. Add such a check, and set date to nil when it fails. 2. Add to the doc of `holiday-sexp' that a given sexp _must_ return either nil or a date which is in the year equal to the value of `year'. I would prefer 1., because I don't see the need for such a restriction. But I'm not really familiar with calendar stuff. 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'' Important settings: value of $LC_ALL: de_DE.utf8 value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: C value of $LANG: de_DE.utf8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 16 17:42:30 2012 Received: (at 11260) by debbugs.gnu.org; 16 Apr 2012 21:42:30 +0000 Received: from localhost ([127.0.0.1]:37387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJtgs-00040p-3t for submit@debbugs.gnu.org; Mon, 16 Apr 2012 17:42:30 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:43599) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJtgp-00040h-Gj for 11260@debbugs.gnu.org; Mon, 16 Apr 2012 17:42:29 -0400 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3VWjjk3gKkz3hhcl; Mon, 16 Apr 2012 23:42:08 +0200 (CEST) Received: from igel.home (ppp-93-104-132-43.dynamic.mnet-online.de [93.104.132.43]) by mail.mnet-online.de (Postfix) with ESMTPA id 3VWjjX4qB2z4KK4K; Mon, 16 Apr 2012 23:42:08 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 5BC15CA2A0; Mon, 16 Apr 2012 23:42:08 +0200 (CEST) From: Andreas Schwab To: michael_heerdegen@web.de Subject: Re: bug#11260: 24.1.50; `holiday-sexp' may create entry twice References: <8762cz4bbn.fsf@web.de> X-Yow: Boys, you have ALL been selected to LEAVE th' PLANET in 15 minutes!! Date: Mon, 16 Apr 2012 23:42:08 +0200 In-Reply-To: <8762cz4bbn.fsf@web.de> (Michael Heerdegen's message of "Mon, 16 Apr 2012 23:27:08 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11260 Cc: 11260@debbugs.gnu.org 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: -1.9 (-) Michael Heerdegen writes: > the following happens also in Emacs 23. Recipe: > > 1. emacs -Q > 2. M-x calendar RET > 3. evaluate: (require 'holidays) > 4. evaluate: > (add-to-list > 'calendar-holidays > '(holiday-sexp > '(list 4 17 2012) > "April 17th 2012")) > > 5. In the calendar, move point to April 17th 2012 and hit h. > > You'll see that "April 17th 2012" appears twice. Your expression does not use year. > | (defun holiday-sexp (sexp string) > | "Sexp holiday for dates in the calendar window. > | SEXP is an expression in variable `year' that is evaluated to ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 16 18:41:23 2012 Received: (at 11260) by debbugs.gnu.org; 16 Apr 2012 22:41:23 +0000 Received: from localhost ([127.0.0.1]:37428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJubq-0005Mv-Q2 for submit@debbugs.gnu.org; Mon, 16 Apr 2012 18:41:23 -0400 Received: from fmmailgate05.web.de ([217.72.192.243]:48567) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJubo-0005Mj-RG for 11260@debbugs.gnu.org; Mon, 16 Apr 2012 18:41:22 -0400 Received: from moweb001.kundenserver.de (moweb001.kundenserver.de [172.19.20.114]) by fmmailgate05.web.de (Postfix) with ESMTP id 9F1826DB0055 for <11260@debbugs.gnu.org>; Tue, 17 Apr 2012 00:41:10 +0200 (CEST) Received: from snow.dragon ([89.204.138.158]) by smtp.web.de (mrweb001) with ESMTPA (Nemesis) id 0LgpYk-1RxDRz0cTO-00oDdA; Tue, 17 Apr 2012 00:41:10 +0200 From: Michael Heerdegen To: Andreas Schwab Subject: Re: bug#11260: 24.1.50; `holiday-sexp' may create entry twice In-Reply-To: (Andreas Schwab's message of "Mon, 16 Apr 2012 23:42:08 +0200") References: <8762cz4bbn.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) Date: Tue, 17 Apr 2012 00:43:06 +0200 Message-ID: <871unn5mdh.fsf@web.de> MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V02:K0:ZSGCRODH7XlE2WJTMj0B8/Ozr9UCsxGKVQuwOibIGA2 SYdSKwcCutVo555weV57PmoSCIVxNlNCaylH00BsvjJioR/K8t 7TwX6QbW+3eLg4TM3WFWBtoHVZl6CR4h5OfdEMoIZXtBqC7LiG 4mWNFuIw6BJMEMxE+IlI/IIfnRBze5Ow4N1wT1uOAZoG/N0hZM Z7SbnyIxKoykB9nuwFfnxeLqV+/00K7C99UIKv9G0s= X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11260 Cc: 11260@debbugs.gnu.org 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: -1.9 (-) Andreas Schwab writes: > > '(holiday-sexp > > '(list 4 17 2012) > > "April 17th 2012")) > > > Your expression does not use year. > > > | (defun holiday-sexp (sexp string) > > | "Sexp holiday for dates in the calendar window. > > | SEXP is an expression in variable `year' that is evaluated to > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Good point, indeed. Also the manual says it clearly. And I didn't find a realistic counterexample that is an expression in `year'. So, we can close this report. Sorry for the noise! Regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 16 19:11:30 2012 Received: (at control) by debbugs.gnu.org; 16 Apr 2012 23:11:30 +0000 Received: from localhost ([127.0.0.1]:37433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJv4z-00061g-78 for submit@debbugs.gnu.org; Mon, 16 Apr 2012 19:11:29 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:59502 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJv4w-00061X-B8 for control@debbugs.gnu.org; Mon, 16 Apr 2012 19:11:27 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1SJv4r-0006Zp-7H for control@debbugs.gnu.org; Mon, 16 Apr 2012 19:11:21 -0400 Date: Mon, 16 Apr 2012 19:11:21 -0400 Message-Id: Subject: control message for bug 11260 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: control 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.9 (------) tag 11260 notabug close 11260 From unknown Sat Aug 16 16:06:17 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 15 May 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator