unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Yuchen Pei <hi@ypei.me>
Cc: 50195@debbugs.gnu.org
Subject: bug#50195: [PATCH] Adding diary-offset, a diary-sexp offsetting another diary-sexp.
Date: Wed, 25 Aug 2021 14:52:55 +0300	[thread overview]
Message-ID: <83mtp5vizs.fsf@gnu.org> (raw)
In-Reply-To: <87fsuychjr.fsf@ypei.me> (message from Yuchen Pei on Wed, 25 Aug 2021 13:46:48 +1000)

> From: Yuchen Pei <hi@ypei.me>
> Date: Wed, 25 Aug 2021 13:46:48 +1000
> 
> See below my first patch to Emacs.  The copyright assignment has 
> already been done BTW.

Congrats, and welcome aboard.

> Let me know what you think.

Some minor comments below.

> Would you like me to add some tests?

Adding more tests is always welcome, thanks.

> Subject: [PATCH] Adding diary-offset, a diary-sexp offsetting another
>  diary-sexp.

"git am" uses the Subject for the heading line, and this Subject is
too long for that.  Please consider making it shorter.

> A bit like diary-remind, as a diary-sexp rather than reminder, and
> also support both positive and negative offsets.
> 
> This is useful when for example your organization has a committee
> meeting two days after every monthly meeting which takes place on the
> third Thursday, or if you would like to attend a virtual meeting
> scheduled in a different timezone causing a difference in the date.

The commit log message should include a ChangeLog-style description of
the files and functions where you made the changes.  See CONTRIBUTE
for more details about the format we prefer.

Also, please in the next version include the bug number as part of the
log message.

> --- a/doc/emacs/calendar.texi
> +++ b/doc/emacs/calendar.texi
> @@ -1363,6 +1363,20 @@ Special Diary Entries
>  Thursday of January, February, and March.  If the month is @code{t}, the
>  entry applies to all months of the year.
>  
> +@findex diary-offset
> +@example
> +%%(diary-offset '(diary-float t 3 4) 2) Monthly post-event committee meeting

That line is too long, and will overflow the page width in the printed
version of the manual.  Please break it in two.

> +@noindent
> +This entry applies to the Saturday after the third Thursday of each
> +month.  The 2 specifies number of days after when the sexp
> +@samp{'(diary-float t 3 4)} would evaluate to @code{t}.  This is
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
This should be in @code, not @samp.  I'd also wrap it in @w{..}, so
that it doesn't get broken between two lines.

> +(defun diary-offset (sexp days)
> +  "Offsetted diary entry.

The first line of a doc string should preferably mention the
arguments, but without becoming too long, so it could still fit on a
single line.

> +  (with-no-warnings (defvar date) (defvar entry))

Why did you need this?

> +  (integerp days)

Isn't it better to use an assertion?

Thanks.





  parent reply	other threads:[~2021-08-25 11:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  3:46 bug#50195: [PATCH] Adding diary-offset, a diary-sexp offsetting another diary-sexp Yuchen Pei
2021-08-25 11:31 ` Lars Ingebrigtsen
2021-08-25 11:52 ` Eli Zaretskii [this message]
2021-08-25 12:06   ` Lars Ingebrigtsen
2021-08-25 12:24     ` Eli Zaretskii
2021-08-25 12:38       ` Lars Ingebrigtsen
2021-08-25 15:22       ` Michael Heerdegen
2021-08-25 15:32         ` Michael Heerdegen
2021-08-25 16:07         ` Eli Zaretskii
2021-08-25 16:22           ` Michael Heerdegen
2021-08-26  6:52             ` Yuchen Pei
2021-08-26  9:26               ` Michael Heerdegen
2021-08-26  6:49   ` bug#50195: [PATCH] Adding diary-offset to diary-lib.el Yuchen Pei
2021-08-26  6:54     ` Yuchen Pei
2021-08-27 13:16       ` Yuchen Pei
2021-09-03 22:40         ` Yuchen Pei
2021-09-04  6:15           ` Eli Zaretskii
2021-09-04  6:29             ` Lars Ingebrigtsen
2021-09-04  7:21               ` Yuchen Pei
2021-08-26 10:26 ` bug#50195: [PATCH] Adding diary-offset, a diary-sexp offsetting another diary-sexp Michael Heerdegen
2021-08-27 13:11   ` Yuchen Pei

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.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mtp5vizs.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=50195@debbugs.gnu.org \
    --cc=hi@ypei.me \
    /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.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).