From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Burt Subject: Re: org-capture, datetree, and tags Date: Sun, 24 Feb 2013 16:05:42 -0500 Message-ID: References: <20130219122529.GB26449@broggs.org> <87ehg8xxjd.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9ilY-0007U1-3m for emacs-orgmode@gnu.org; Sun, 24 Feb 2013 16:05:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U9ilT-0007G1-De for emacs-orgmode@gnu.org; Sun, 24 Feb 2013 16:05:48 -0500 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.122]:11978) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9ilT-0007Ft-AZ for emacs-orgmode@gnu.org; Sun, 24 Feb 2013 16:05:43 -0500 In-Reply-To: (Tim Burt's message of "Sat, 23 Feb 2013 07:18:44 -0500") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: Jeffrey Brent McBeth , emacs-orgmode@gnu.org I have just submitted a patch. It is marked with TINYCHANGE so that it can be processed before the assignment paperwork (which I just began today) is complete. Good day, Tim Tim Burt writes: > Bastien writes: > >> Hi Tim, >> >> Tim Burt writes: >> >>> : (defun org-datetree-find-year-create (year) >>> : (let ((re "^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)[ \t]*\\(:[[:alnum:]_@]*\\)*:*[ \t]*$") >>> : match) >>> I've tested with the following headlines: >>> - 2013 >>> - both with and without trailing spaces >>> - 2013 :abc: >>> - 2013 :abc123: >>> - 2013 :abc123:_underscore:@attaboy:: >>> - 2013 :noexport: >>> >>> Any comments on the regular expression are welcome before I make >>> patch. >> >> Thanks for working on fixing this. >> >> The more or less standard regexp for tags-till-end-of-line is this: >> >> :[[:alnum:]_@#%:]*[ \t]*$ >> ^ >> >> With * if you want to match headlines with no tag. > > I may have misapplied what you suggested, but the new regexp (see below) > does not work on a year headline without tags. > : (defun org-datetree-find-year-create (year) > : (let ((re "^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)[ \t]*\\(:[[:alnum:]_@#%:]*[ \t]*$\\)") > : match) > However, the suggestion helped me find the following in org-todo-line-tags-regexp > \\(.*?\\([ \t]:[[:alnum:]:_@#%]+:[ \t]*\\)?$\\) > Applying this regexp worked on a tag-free headline (both with and > without trailing spaces) > : (defun org-datetree-find-year-create (year) > : (let ((re "^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)\\(.*?\\([ \t]:[[:alnum:]:_@#%]+:[ \t]*\\)?$\\)") > : match) > > > >> >> Please have a look at this page before submitting a patch: >> http://orgmode.org/worg/org-contribute.html#sec-5 > > Will do. > >> >> Thanks! -- Tim Burt www.rketburt.org "It is healthful to every sane man to utter the art within him;" -- GK Chesterton