From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org-bbdb-anniversaries-future Date: Sun, 05 Mar 2017 18:28:10 +0100 Message-ID: <877f437hw5.fsf@nicolasgoaziou.fr> References: <87shmxwdhp.fsf@luisa.c0t0d0s0.de> <8737exce1j.fsf@nicolasgoaziou.fr> <87o9xlw0u2.fsf@luisa.c0t0d0s0.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckZxC-0004Gq-2X for emacs-orgmode@gnu.org; Sun, 05 Mar 2017 12:28:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ckZx7-0003sS-VW for emacs-orgmode@gnu.org; Sun, 05 Mar 2017 12:28:18 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:58599) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ckZx7-0003sF-Og for emacs-orgmode@gnu.org; Sun, 05 Mar 2017 12:28:13 -0500 In-Reply-To: <87o9xlw0u2.fsf@luisa.c0t0d0s0.de> (Michael Welle's message of "Wed, 01 Mar 2017 15:03:49 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Michael Welle Cc: emacs-orgmode@gnu.org Hello, Michael Welle writes: > Maybe it's a tiny change, if we strip the comments ;). It's not too > sophisticated, everyone could have done it. I definitely think it _is_ a tiny change. Some comments follow. > +(defun org-bbdb-anniversary-description (agenda-date anniv-date) > + "Return a string used to modify an agenda anniversary entry. The The first line needs to be a sentence on its own. IOW, the last "The" belong to the next line. > + calculation of the string is based on the difference between Indentation in this line and all subsequent ones needs to be removed. > + the anniversary date and the date on which the entry appears > + in the agenda. This makes it possible to have different entries Docstrings follow US English conventions, i.e., two spaces are required after a full stop. > + for the same event depending on if it occurs in the next few days > + or far away in the future." You also need to document what are the arguments (type). They are written up-cased in the docstring. > + (let ((delta (- (calendar-absolute-from-gregorian anniv-date) > + (calendar-absolute-from-gregorian agenda-date)))) > + > + (cond > + ((= delta 0) " -- today\\&") > + ((= delta 1) " -- tomorrow\\&") > + ((< delta 7) (format " -- in %d days\\&" delta)) > + ((format " -- %d-%02d-%02d\\&" (third anniv-date) (first anniv-date) (second anniv-date)))))) You need to used "cl-" prefix, e.g., `cl-third'. OTOH, I'd rather use pattern matching here, for clarity: (pcase-let ((`(,month ,day ,year) anniv-date)) (format " -- %s-%02%d-%02d\\&" year month day)) Also, could you provide a commit message? Thank you. Regards, -- Nicolas Goaziou