emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Burt <tcburt@rochester.rr.com>
To: Bastien <bzg@altern.org>
Cc: Jeffrey Brent McBeth <mcbeth@broggs.org>, emacs-orgmode@gnu.org
Subject: Re: org-capture, datetree, and tags
Date: Sat, 23 Feb 2013 07:18:44 -0500	[thread overview]
Message-ID: <m34nh3i5p7.fsf@fluorine.burtket> (raw)
In-Reply-To: <87ehg8xxjd.fsf@bzg.ath.cx> (Bastien's message of "Fri, 22 Feb 2013 14:56:06 +0100")

Bastien <bzg@altern.org> writes:

> Hi Tim,
>
> Tim Burt <tcburt@rochester.rr.com> 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

  reply	other threads:[~2013-02-23 12:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-19 12:25 org-capture, datetree, and tags Jeffrey Brent McBeth
2013-02-20 11:40 ` Tim Burt
2013-02-21 11:42   ` Tim Burt
2013-02-22 13:56     ` Bastien
2013-02-23 12:18       ` Tim Burt [this message]
2013-02-24 21:05         ` Tim Burt
2013-02-20 11:43 ` Jeffrey Brent McBeth

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=m34nh3i5p7.fsf@fluorine.burtket \
    --to=tcburt@rochester.rr.com \
    --cc=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=mcbeth@broggs.org \
    /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).