[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] org-capture, datetree, and tags
From: |
Tim Burt |
Subject: |
Re: [O] org-capture, datetree, and tags |
Date: |
Sat, 23 Feb 2013 07:18:44 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) |
Bastien <address@hidden> writes:
> Hi Tim,
>
> Tim Burt <address@hidden> writes:
>
>> : (defun org-datetree-find-year-create (year)
>> : (let ((re "^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)[
>> \t]*\\(:[[:alnum:address@hidden)*:*[ \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:address@hidden:]*[ \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:address@hidden:]*[ \t]*$\\)")
: match)
However, the suggestion helped me find the following in
org-todo-line-tags-regexp
\\(.*?\\([ \t]:[[:alnum:]:address@hidden:[ \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:]:address@hidden:[ \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
- [O] org-capture, datetree, and tags, Jeffrey Brent McBeth, 2013/02/19
- Re: [O] org-capture, datetree, and tags, Tim Burt, 2013/02/20
- Re: [O] org-capture, datetree, and tags, Tim Burt, 2013/02/21
- Re: [O] org-capture, datetree, and tags, Bastien, 2013/02/22
- Re: [O] org-capture, datetree, and tags,
Tim Burt <=
- Re: [O] org-capture, datetree, and tags, Tim Burt, 2013/02/24
Re: [O] org-capture, datetree, and tags, Jeffrey Brent McBeth, 2013/02/20