emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Ken Mankoff <mankoff@gmail.com>
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: duplicate PROPERTIES drawers
Date: Mon, 23 Feb 2015 09:35:44 +0100	[thread overview]
Message-ID: <87pp9158kf.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <m2egphd3vm.fsf@gmail.com> (Ken Mankoff's message of "Sun, 22 Feb 2015 16:37:33 -0500")

Hello,

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.

There is a function in ORG-NEWS that will repair old documents, but it
will _not_ merge duplicate properties drawers.

> I'm not sure what is going on to create the second PROPERTIES drawer.
>
> Has anyone else seen this? Any ideas what I am doing wrong.
>
> I've found many of these tasks manually. I haven't been able to search
> and list them progragmatically (I've been trying using grep and other
> shell tools on my Org files).
>
> Is there a way to list all tasks with duplicate properties, or all tasks
> where :PROPERTIES: is not the first item listed, if that is a
> requirement?

This should find such entries.

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

Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2015-02-23  8:34 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 [this message]
2015-02-23 14:02   ` Ken Mankoff
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=87pp9158kf.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=mankoff@gmail.com \
    /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).