From: Ken Mankoff <mankoff@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: duplicate PROPERTIES drawers
Date: Mon, 23 Feb 2015 09:02:17 -0500 [thread overview]
Message-ID: <m2sidwvi8m.fsf@gmail.com> (raw)
In-Reply-To: <87pp9158kf.fsf@nicolasgoaziou.fr>
On 2015-02-23 at 03:35, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Ken Mankoff <mankoff@gmail.com> writes:
>
>> I have found many task with duplicate PROPERTIES drawers. I saw mention on the list that, "...it will be invalid for a LOGBOOK to appear before PROPERTIES in Org 8.3."
>>
>> It seems that tasks don't have properties by default, and if I LOG an item, I get a LOGBOOK drawer. If properties are added later (by touching the item with MobileOrg, or adding a property with "C-c C-x p", then PROPERTIES go below the LOGBOOK.
>
> This shouldn't happen in master branch.
Hmm. It is happening on the latest melpa install. Or maybe on an earlier version and I'm only seeing it now. I run melpa, no git versions.
> There is a function in ORG-NEWS that will repair old documents, but it will _not_ merge duplicate properties drawers.
Thanks for the hint. I've found that and run it, but get an error because "org-planning-line-re" 'symbols variable is void'. Searching that I see mention that error is indicative of a mixed installation. But when I grep (or ack) for "org-planning-line-re" in the elpa/org-20150216 folder, it doesn't exist. If I rewrite that line to "org-planning-or-clock-line-re", then it works, and I see items get repaired. I can run this on all my Org files, but as you point out, it won't help with tasks that are already messed up with two property drawers. I also don't think I have a mixed install because I cons elpa to the load-path before I access any Org functions.
I've tried to run the code you sent:
> (org-element-map (org-element-parse-buffer 'element) 'headline
> (lambda (h)
> (and (org-element-map h 'drawer
> (lambda (d) (equal (org-element-property :name d) "PROPERTIES"))
> nil t 'headline)
> (let ((begin (org-element-property :begin h)))
> (message "Entry with erroneous properties drawer at %d" begin)
> begin))))
>
But nothing happens. It seems to be an incomplete solution. I tried wrapping it in an interactive function call, but I'm a lisp newbie and it doesn't list the entries with duplicate properties for me, on this system.
-k.
next prev parent reply other threads:[~2015-02-23 14:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-22 21:37 duplicate PROPERTIES drawers Ken Mankoff
2015-02-23 8:35 ` Nicolas Goaziou
2015-02-23 14:02 ` Ken Mankoff [this message]
2015-02-23 15:44 ` Ken Mankoff
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=m2sidwvi8m.fsf@gmail.com \
--to=mankoff@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=mail@nicolasgoaziou.fr \
/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).