emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: "emacs-orgmode@gnu.org List" <emacs-orgmode@gnu.org>
Subject: Re: Problem with property matching
Date: Tue, 26 Nov 2013 18:00:03 +0100	[thread overview]
Message-ID: <87fvqj85f0.fsf@gmail.com> (raw)
In-Reply-To: <4EE54E6B-582D-4E9B-A641-520E37AC26EA@gmail.com> (Carsten Dominik's message of "Tue, 26 Nov 2013 13:27:48 +0100")

Hello,

Carsten Dominik <carsten.dominik@gmail.com> writes:

> I think there is an error in the property matching regexp.  It will not match a line where the property value is empty.  I propose the following change, which makes the value part optional:
>
> --------------------------------------------------------------------------------
> diff --git a/lisp/org.el b/lisp/org.el
> index 7a4d244..4641ce5 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -6205,7 +6205,7 @@ Use `org-reduced-level' to remove the effect of `org-odd-levels'."
>  Match group 3 will be set to the value if it exists."
>    (concat "^\\(?4:[ \t]*\\)\\(?1::\\(?2:"
>  	  (if literal property (regexp-quote property))
> -	  "\\):\\)[ \t]+\\(?3:[^ \t\r\n].*?\\)\\(?5:[ \t]*\\)$"))
> +	  "\\):\\)\\([ \t]+\\(?3:[^ \t\r\n].*?\\)\\)?\\(?5:[ \t]*\\)$"))

Why \\(?3:[^ \t\r\n].*?\\) instead of \\(?3:.*?\\) ?

>  (defconst org-property-re
>    (org-re-property ".*?" 'literal)
> --------------------------------------------------------------------------------
>
> Can anyone think of problems this would cause? Nicolas, does the
> syntax definition require a non-empty value?

Not really. It just means that we cannot have a property named "END".


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2013-11-26 17:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26 12:27 Problem with property matching Carsten Dominik
2013-11-26 17:00 ` Nicolas Goaziou [this message]
2013-11-26 21:12 ` Achim Gratz

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=87fvqj85f0.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.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).