From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Problem with property matching Date: Tue, 26 Nov 2013 18:00:03 +0100 Message-ID: <87fvqj85f0.fsf@gmail.com> References: <4EE54E6B-582D-4E9B-A641-520E37AC26EA@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlLzZ-0006vC-VK for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 12:00:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlLzR-0006NX-Ie for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 12:00:05 -0500 Received: from mail-ea0-x236.google.com ([2a00:1450:4013:c01::236]:50599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlLzR-0006NS-BU for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 11:59:57 -0500 Received: by mail-ea0-f182.google.com with SMTP id o10so5393803eaj.27 for ; Tue, 26 Nov 2013 08:59:56 -0800 (PST) In-Reply-To: <4EE54E6B-582D-4E9B-A641-520E37AC26EA@gmail.com> (Carsten Dominik's message of "Tue, 26 Nov 2013 13:27:48 +0100") 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: Carsten Dominik Cc: "emacs-orgmode@gnu.org List" Hello, Carsten Dominik 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