emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Jason <jasondunsmore@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Add support for month trees
Date: Tue, 26 Nov 2019 10:22:46 +0100	[thread overview]
Message-ID: <87ftib2dqx.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAEgAqct=+a+rEdL9H7ZrK4TfxnfeuHsyiX-CJnG9uCO37yzvCg@mail.gmail.com> (Jason's message of "Thu, 7 Nov 2019 08:29:24 -0600")

Hello,

Jason <jasondunsmore@gmail.com> writes:

> Please find my attached patch which implements a way to capture entries
> grouped by month.

Thank you.

> I was searching for this option, but only found a way to group entries by
> week or day.
>
> I found the following posts where other people also need this feature:
> https://emacs.stackexchange.com/questions/48414/monthly-date-tree
> https://lists.gnu.org/archive/html/emacs-orgmode/2018-02/msg00092.html

I think this can be tested in "next" branch. Could you rebase your patch
against it?

> * etc/ORG-NEWS: Document new `:tree-type month' option.

No need to provide this information in the commit message, IMO. Of
course, it doesn't hurt in any case. Just sayin'.

> +    Use ~week~ to make a week tree instead of the month-day tree,
> +    i.e., place the headings for each day under a heading with the
> +    current ISO week. Use @code{month} to group entries by month
> +    only. Default is to group entries by day.

You need to put two spaces after full stops.

> +	    (cond
> +	     ((eq (org-capture-get :tree-type) 'week)
> +	      #'org-datetree-find-iso-week-create)
> +	     ((eq (org-capture-get :tree-type) 'month)
> +	      #'org-datetree-find-month-create)
> +	     (t
> +	      #'org-datetree-find-date-create))

Could you refactor that with `case' instead? I.e.,

    (case (org-capture-get :tree-type)
     (`week ...)
     ...)
> +      (if (eq time-grouping 'day)
> +	  (org-datetree--find-create
> +	   "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\) \\w+$"
> +	   year month day)))))

Please use `when' (or `unless') instead of one-armed `if'.

Could you send an updated patch?

Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2019-11-26  9:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-07 14:29 [PATCH] Add support for month trees Jason
2019-11-26  9:22 ` Nicolas Goaziou [this message]
2019-11-27  0:14   ` Jason Dunsmore
2019-12-09 19:10     ` Nicolas Goaziou

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=87ftib2dqx.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=jasondunsmore@gmail.com \
    /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).