From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: [BUG] in org-property-drawer-re? Date: Tue, 01 Oct 2013 19:50:03 +0200 Message-ID: <87r4c4519w.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR45Y-0003V1-JG for emacs-orgmode@gnu.org; Tue, 01 Oct 2013 13:50:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VR45Q-0002Za-G2 for emacs-orgmode@gnu.org; Tue, 01 Oct 2013 13:50:24 -0400 Received: from plane.gmane.org ([80.91.229.3]:54997) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR45Q-0002ZL-92 for emacs-orgmode@gnu.org; Tue, 01 Oct 2013 13:50:16 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VR45O-0006Sy-90 for emacs-orgmode@gnu.org; Tue, 01 Oct 2013 19:50:14 +0200 Received: from e178190201.adsl.alicedsl.de ([85.178.190.201]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Oct 2013 19:50:14 +0200 Received: from tjolitz by e178190201.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Oct 2013 19:50:14 +0200 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: emacs-orgmode@gnu.org Hi List, for the navi-mode keyword-search for complete property drawers I copied ,----------------------- | org-property-drawer-re `----------------------- from org.el: #+begin_src emacs-lisp (concat "\\(" org-property-start-re "\\)[^\000]*\\(" org-property-end-re "\\)\n?") #+end_src #+results: : \(^[ ]*:PROPERTIES:[ ]*$\)[^\\000]*\(^[ ]*:END:[ ]*$\) : ? A bit unreadable, but you get the message ... here is my hopefully equivalent version: ,-------------------------------------------------------------- | (:propertydrawer | . (concat "\\(^[\\s\\t]*:PROPERTIES:[\\s\\t]*$\\)[^\\000]*" | "\\(^[\\s\\t]*:END:[\\s\\t]*$\\)\\n?")) `-------------------------------------------------------------- But this did not match correctly in Bernt Hansens tutorial: ,-------------------------------------------------------------------------- | 43::PROPERTIES: | ::CUSTOM_ID: Setup | ::END: | 131::PROPERTIES: | ::CUSTOM_ID: OrgFiles | ::END: | 185::PROPERTIES: | ::CUSTOM_ID: AgendaSetup | ::END: | : | :Here is my current =org-agenda-files= setup. | :#+begin_src emacs-lisp :tangle no | : (setq org-agenda-files (quote ("~/git/org" | : "~/git/org/client1" | : "~/git/org/bzflag" | : "~/git/client2"))) | :#+end_src | : | :#+begin_src emacs-lisp :tangle yes :exports none | : ;; The following setting is different from the document so that you | : ;; can override the document org-agenda-files by setting your | : ;; org-agenda-files in the variable org-user-agenda-files | : ;; | : (if (boundp 'org-user-agenda-files) | : (setq org-agenda-files org-user-agenda-files) | : (setq org-agenda-files (quote ("~/git/org" | : "~/git/org/client1" | : "~/git/org/bzflag" | : "~/git/client2")))) | : | :#+end_src `-------------------------------------------------------------------------- I had to add two ? after the * and delete the final \n ,------------------------------------------------------------- | (:propertydrawer | . (concat "\\(^[\\s\\t]*:PROPERTIES:[\\s\\t]*$\\)[^\\000]*?" | "\\(^[\\s\\t]*:END:[\\s\\t]*?$\\)")) `------------------------------------------------------------- to get the desired results: ,--------------------------------- | 43::PROPERTIES: | ::CUSTOM_ID: Setup | ::END: | 131::PROPERTIES: | ::CUSTOM_ID: OrgFiles | ::END: | 185::PROPERTIES: | ::CUSTOM_ID: AgendaSetup | ::END: | 234::PROPERTIES: | ::CUSTOM_ID: OrgFileStructure | ::END: `--------------------------------- A bug in the regexp? PS Can anybody explain this marvelous construct in the regexp: ,--------- | [^\\000] `--------- I often pondered about how to achieve its effect with other means, since I did not find it in the Emacs Lisp manual. -- cheers, Thorsten