From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] Add support for month trees Date: Tue, 26 Nov 2019 10:22:46 +0100 Message-ID: <87ftib2dqx.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:52207) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZX3c-0004Dd-KL for emacs-orgmode@gnu.org; Tue, 26 Nov 2019 04:22:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZX3b-0006Yv-9d for emacs-orgmode@gnu.org; Tue, 26 Nov 2019 04:22:52 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:51879) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iZX3b-0006Y2-3T for emacs-orgmode@gnu.org; Tue, 26 Nov 2019 04:22:51 -0500 In-Reply-To: (Jason's message of "Thu, 7 Nov 2019 08:29:24 -0600") 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: Jason Cc: Org Mode Hello, Jason 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