From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [RFC] Change property drawer syntax Date: Wed, 15 Oct 2014 09:38:56 +0200 Message-ID: References: <87oatek909.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeJAv-0006Np-Kj for emacs-orgmode@gnu.org; Wed, 15 Oct 2014 03:39:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XeJAo-0007tF-1T for emacs-orgmode@gnu.org; Wed, 15 Oct 2014 03:39:13 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:36910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeJAn-0007t4-Oa for emacs-orgmode@gnu.org; Wed, 15 Oct 2014 03:39:05 -0400 Received: by mail-wi0-f178.google.com with SMTP id h11so1153656wiw.17 for ; Wed, 15 Oct 2014 00:39:04 -0700 (PDT) Received: from Rainers-MacBook-Pro-3.local (arn78-1-88-186-171-7.fbx.proxad.net. [88.186.171.7]) by mx.google.com with ESMTPSA id k10sm22786845wjb.28.2014.10.15.00.39.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Oct 2014 00:39:03 -0700 (PDT) In-Reply-To: <87oatek909.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Tue, 14 Oct 2014 16:42:46 +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: Org Mode List --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Nicolas Goaziou writes: > Hello, Hi I am not using org that much for schedulig, todo items, and other similar topics, but mainly for literate programming, so I will comment From=20that perspective. > > As discussed previously, I would like to modify property drawers syntax. > The change is simple: they must be located right after a headline and > its planning line, if any. Therefore the following cases are valid > > * Headline > :PROPERTIES: > :KEY: value > :END: > > * Headline > SCHEDULED: <2014-10-14 mar.> > :PROPERTIES: > :KEY: value > :END: > > but, in the following case, the scheduled keyword will not be recognized > > * Headline > :PROPERTIES: > :KEY: value > :END: > SCHEDULED: <2014-10-14 mar.> > > When not empty, they also have to contain only node properties. No problems so far from my side. > Moreover, node properties' keys can only contain non-whitespace > characters and cannot end with a plus sign (which is used for > accumulation).=20 This is problematic for me, as I am using it extensively in the case of :header-args. I set file wide header-arg and add the ones which have to change per subtree / node: =2D-8<---------------cut here---------------start------------->8--- #+Property: header-args :tangle-mode (identity #o444) #+PROPERTY: header-args+ :tangle no #+PROPERTY: header-args+ :mkdirp yes #+PROPERTY: header-args+ :exports both #+PROPERTY: header-args+ :comments both #+PROPERTY: header-args+ :padline no #+PROPERTY: header-args+ :eval no-export * To be tangled but *never* executed :PROPERTIES: :header-args+: :eval never :END: ** some code :PROPERTIES: :comments: no :header-args+: :tangle ./code.R :header-args+: :padline no :header-args+: :no-expand TRUE :header-args+: :comments no :END: #+begin_src R=20 ## some code #+end_src * Not to be tangled but can be executed #+begin_src R=20 ## some other code #+end_src =2D-8<---------------cut here---------------end--------------->8--- So if I understand you correctly, this would break this approach, which I think is very valuable in literate programming and reproducible research. > Value can contain anything but a newline character. > > Thus, the following property drawer is invalid > > * Headline > :PROPERTIES: > :KEY: value > Some text. > :END: > > Any invalid property drawer becomes de facto a regular drawer, with > "PROPERTIES" as its name. > > Besides defining exactly the syntax of property drawers, it should also > make the property API faster in some cases. Indeed, there's no need to > search through entire (possibly huge) sections in order to find > properties attached to a headline. > > However, it will break some Org documents. In particular, TODO-states > changes are usually logged before any drawer, including properties > drawers. The following function repairs them. At the moment, I do not see any way on how I can replace the + in the properties drawer - or am I missing something very basic here? Cheers, Rainer > > (defun org-repair-property-drawers () > "Fix properties drawers in current buffer. > Ignore non Org buffers." > (when (eq major-mode 'org-mode) > (org-with-wide-buffer > (goto-char (point-min)) > (let ((case-fold-search t) > (inline-re (and (featurep 'org-inlinetask) > (concat (org-inlinetask-outline-regexp) > "END[ \t]*$")))) > (org-map-entries > (lambda () > (unless (and inline-re (org-looking-at-p inline-re)) > (save-excursion > (let ((end (save-excursion (outline-next-heading) (point)= ))) > (forward-line) > (when (org-looking-at-p org-planning-line-re) (forward-= line)) > (when (and (< (point) end) > (not (org-looking-at-p org-property-drawer-r= e)) > (save-excursion > (re-search-forward org-property-drawer-re = end t))) > (insert (delete-and-extract-region > (match-beginning 0) > (min (1+ (match-end 0)) end))) > (unless (bolp) (insert "\n")))))))))))) > > Internally, changes are somewhat invasive, as they include a rewrite of > almost all the property API. They also alter clocking, tags, todo > keywords, logging, initialization, hopefully in an invisible manner. > > I pushed a new branch, "top-properties" in the repository for code > review and testing. It includes unit tests, documentation and an > ORG-NEWS entry. > > Feedback welcome. > > > Regards, =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJUPiSUAAoJENvXNx4PUvmCi00IAKnIrvuvOhCKTRUqxWG3CRBh ws+YVks1kZJ9HwQ1MHJpuOKAhjUvHfiB22Q5AW7qUR59xB0fvffGMxoDqlcp4qs+ igYucd5oBOCc1UV2QeZeY+nEng+oK/uZ5i3XWqxzyQ77z/tq8gv9qB22ByoE8dUD p9dnoVxVsmqdJMVBFa/oD7xi+tPMMx/uQnccYPosonP6RS3tqRKKvt9adDO4qfeJ lFKujQYzzZpZZBcXesxPx1MOUQoZDo0S7Usc2CLHKEB2M+IcFmf0ofHg2+Wq6DBK +FrC05FntAR8p46mZcFfDuA7N0+xqscKCi4LYGVLEt233iaL1pjbKCsfCDGCCs8= =JuF5 -----END PGP SIGNATURE----- --=-=-=--