emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Add support for month trees


From: Nicolas Goaziou
Subject: Re: [PATCH] Add support for month trees
Date: Tue, 26 Nov 2019 10:22:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hello,

Jason <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]