From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: stardiviner Newsgroups: gmane.emacs.help Subject: Re: void variable error in function diary-anniversary Date: Thu, 21 Dec 2017 13:51:13 +0800 Message-ID: <51030225-2859-15eb-abf5-c2f492377b88@gmail.com> References: <47c16b80-c229-07b8-b787-9ed4d69b2404@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1513835393 19083 195.159.176.226 (21 Dec 2017 05:49:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 21 Dec 2017 05:49:53 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 21 06:49:49 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eRtjo-0004PX-Oc for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Dec 2017 06:49:49 +0100 Original-Received: from localhost ([::1]:33272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRtll-0007VS-Ka for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Dec 2017 00:51:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRtlJ-0007Uq-Uz for help-gnu-emacs@gnu.org; Thu, 21 Dec 2017 00:51:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRtlG-0005ya-Sz for help-gnu-emacs@gnu.org; Thu, 21 Dec 2017 00:51:22 -0500 Original-Received: from mail-it0-x236.google.com ([2607:f8b0:4001:c0b::236]:42431) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRtlG-0005yM-Of for help-gnu-emacs@gnu.org; Thu, 21 Dec 2017 00:51:18 -0500 Original-Received: by mail-it0-x236.google.com with SMTP id p139so9341120itb.1 for ; Wed, 20 Dec 2017 21:51:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=Un3w3Ef8v3U86+52vHNGJJ6eXAYoI66ZhrtQhl0vIEM=; b=KxIezjy41uTs5GqmxIPtBUpTyUL8kHE0rq0cjv9AAcmfUG9OeyVYQjJ7JI4Hl7sQi9 EMB0UU8dpFu9ryWaSSm/BDRcHUGAn7Bz00PjynHCcsbA89Qt2LeRIftn9uJtWuwTjbWy ZsiDYzbj6EHrT+64q/VtoTkmTOBL6ih2mLL8Mqj2p92XlbY+YNomHyNJ9Re+1cqP3M96 MO/qMg8KF93dyQJteb05HLnDEcS4WroIZvm0H7tivPx1sZkujsuF/xtN3YOwgJzK1qF+ yatwDDUcvylLw6WUHSV/9ChTBU0Aa1fxLjhkm08I+f/s5geKB66V99A3icyI+pzghy0E +dEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Un3w3Ef8v3U86+52vHNGJJ6eXAYoI66ZhrtQhl0vIEM=; b=qn7INCVXjq5MJInAxNNn/QXVy7UP58Yd24r7TNmF0pDgVKfP2catf1qz7f0mI4hGSv wFAimXxnptOh6HzU4lmZlSiwRU4ogRMNVPmXCEpJuUwJBv/p+oDIjiRjzzWEtLG7rimf D55jAO+utEOu20ZKmdZ0oQ4t8P+ah/L6sv7E9ww2wattYPZyEfkTTdZw4Juo8oUd9gyj tGkZwrmsfJXXYGB7ggUbGWrnHDsvykTvdO314HuPSmasQolT0mQ/E0+uS5lEQLHON5Ja Dj/RSgEDLO0AEJ5kbl5WlAnjneazrImyLats0sNyKabjbq9OyW3FsanWq+4TV/7ThSX5 rslQ== X-Gm-Message-State: AKGB3mI0kRePvsyxmzKKpihu9vdTl8TIZVOkcYAir7n6bj4J2AMYkzDV IMhnYyyFRxDWe+Etok5I3Vd+Z4Y= X-Google-Smtp-Source: ACJfBovFkDPikfous8n1Ze/OCsSBbtQqmJfb2T/GjvUtxXliygVJJk5CCaTFNHvh2lxSh7gdH6jkaQ== X-Received: by 10.36.14.86 with SMTP id 83mr10548199ite.8.1513835477570; Wed, 20 Dec 2017 21:51:17 -0800 (PST) Original-Received: from [0.0.0.0] ([119.28.89.243]) by smtp.gmail.com with ESMTPSA id n66sm10560973ioe.88.2017.12.20.21.51.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Dec 2017 21:51:16 -0800 (PST) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::236 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:115417 Archived-At: I'm using latest Emacs version from `master` branch. Current version: GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.26) of 2017-12-16 And here is the edebug backtrace (check out the FIXME): #+begin_src emacs-lisp (defun diary-anniversary (month day &optional year mark)   "Anniversary diary entry. Entry applies if date is the anniversary of MONTH, DAY, YEAR. The order of the input parameters changes according to `calendar-date-style' (e.g. to DAY MONTH YEAR in the European style). The diary entry can contain `%d' or `%d%s'; the %d will be replaced by the number of years since the MONTH, DAY, YEAR, and the %s will be replaced by the ordinal ending of that number (that is, `st', `nd', `rd' or `th', as appropriate).  The anniversary of February 29 is considered to be March 1 in non-leap years. An optional parameter MARK specifies a face or single-character string to use when highlighting the day in the calendar."   (with-no-warnings (defvar date) (defvar entry))   (let* ((ddate (diary-make-date month day year))          (dd (calendar-extract-day ddate))          (mm (calendar-extract-month ddate))          (yy (calendar-extract-year ddate))          (y (calendar-extract-year date)) ; FIXME: here date is void.          (diff (if yy (- y yy) 100)))     (and (= mm 2) (= dd 29) (not (calendar-leap-year-p y))          (setq mm 3                dd 1))     (and (> diff 0) (calendar-date-equal (list mm dd y) date)          (cons mark (format entry diff (diary-ordinal-suffix diff)))))) #+end_src On 12/21/2017 12:09 AM, Stefan Monnier wrote: >> I have: >> ```org >> * test anniversary >> %%(diary-anniversary 12 8 2007) >> ``` >> When I execute [M-: (diary-anniversary 12 8 2007) RET], I got error: >> Symbol's value as variable is vodi: date > Which Emacs version? > Could you set "Options => Enter Debugger on Error", then reproduce > the problem, then send us the backtrace that you (hopefully) get? > > > Stefan > > >