emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] in org-property-drawer-re?
@ 2013-10-01 17:50 Thorsten Jolitz
  2013-10-01 18:17 ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: Thorsten Jolitz @ 2013-10-01 17:50 UTC (permalink / raw)
  To: emacs-orgmode


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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-10-02 11:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-01 17:50 [BUG] in org-property-drawer-re? Thorsten Jolitz
2013-10-01 18:17 ` Carsten Dominik
2013-10-01 18:36   ` Thorsten Jolitz
2013-10-01 18:44     ` Carsten Dominik
2013-10-02  9:55   ` Nicolas Goaziou
2013-10-02 11:05     ` Carsten Dominik
2013-10-02 11:14       ` Nicolas Goaziou
2013-10-02 11:37         ` Carsten Dominik
2013-10-02 11:38     ` Thorsten Jolitz

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).