From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Michael Welle <mwe012008@gmx.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-bbdb-anniversaries-future
Date: Sun, 05 Mar 2017 18:28:10 +0100 [thread overview]
Message-ID: <877f437hw5.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87o9xlw0u2.fsf@luisa.c0t0d0s0.de> (Michael Welle's message of "Wed, 01 Mar 2017 15:03:49 +0100")
Hello,
Michael Welle <mwe012008@gmx.net> 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
next prev parent reply other threads:[~2017-03-05 17:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <qf8k5dxnqs.ln2@news.c0t0d0s0.de>
2016-07-14 22:22 ` org-bbdb-anniversaries-future Marco Wahl
2017-03-01 9:19 ` org-bbdb-anniversaries-future Alan Schmitt
2017-03-01 9:30 ` org-bbdb-anniversaries-future Michael Welle
2017-03-01 10:39 ` org-bbdb-anniversaries-future Marco Wahl
2017-03-01 13:38 ` org-bbdb-anniversaries-future Nicolas Goaziou
2017-03-01 14:03 ` org-bbdb-anniversaries-future Michael Welle
2017-03-01 14:30 ` org-bbdb-anniversaries-future Alan Schmitt
2017-03-01 14:40 ` org-bbdb-anniversaries-future Michael Welle
2017-03-01 14:34 ` org-bbdb-anniversaries-future Rasmus
2017-03-05 17:28 ` Nicolas Goaziou [this message]
2017-03-07 9:19 ` org-bbdb-anniversaries-future Michael Welle
2017-03-12 12:47 ` org-bbdb-anniversaries-future Nicolas Goaziou
2017-03-13 8:22 ` org-bbdb-anniversaries-future Michael Welle
2017-03-13 8:31 ` org-bbdb-anniversaries-future Michael Welle
2017-03-17 7:29 ` org-bbdb-anniversaries-future Nicolas Goaziou
2017-03-01 10:35 ` org-bbdb-anniversaries-future Marco Wahl
[not found] <ipa2rcx5nc.ln2@news.c0t0d0s0.de>
2016-03-08 9:25 ` org-bbdb-anniversaries, bbdb v3 Marco Wahl
[not found] ` <7hp2rcx89n.ln2@news.c0t0d0s0.de>
2016-03-08 13:08 ` Nick Dokos
2016-03-08 15:43 ` org-bbdb-anniversaries-future Georges
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877f437hw5.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=emacs-orgmode@gnu.org \
--cc=mwe012008@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).