emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Olaf Dietsche <olaf+list.orgmode@olafdietsche.de>
Cc: Markus Heller <hellerm2@gmail.com>,
	nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: : Search for missing :END:
Date: Tue, 22 Nov 2011 09:37:12 -0500	[thread overview]
Message-ID: <22762.1321972632@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Olaf Dietsche <olaf+list.orgmode@olafdietsche.de> of "Tue, 22 Nov 2011 09:46:33 +0100." <87d3ckczo6.fsf@rat.lan>

Olaf Dietsche <olaf+list.orgmode@olafdietsche.de> wrote:

> Nick Dokos <nicholas.dokos@hp.com> writes:
> 
> [snip]
> > But assuming that you are getting some error from org, you don't know
> > where the problem is and you are trying to find it, it will be simpler
> > to just use egrep:
> >
> >     grep -E -n ':PROPERTIES:|:END:' foo.org
> >
> > will filter out the relevant lines, so all you have to do is scan the
> > output by eye and spot any irregularity (consecutive :PROPERTIES: or
> > consecutive :END: lines). Even if you have hundreds of them, that's
> > *easy* for humans to do.[fn:2]
> >
> > Or, if you prefer, you can write trivial validation programs to operate
> > on the output, e.g.:
> >
> >         grep -E -n ':PROPERTIES:|:END:' foo.org | tee foo.out | grep PROP | wc -l
> > 	grep END foo.out | wc -l
> >
> > (the counts 'd better be the same).
> 
> Since you might have other drawers as well (LOGBOOK, CLOCK), the counts
> need not be the same.
> 

Indeed - you might have user-defined drawers as well and they all contribute the
:END: part, so the begin part will have to be fleshed out accordingly. But the
generalization is easy and eyeballing the output is pretty effective: if you
miss some drawer types, the repeating :END: stands out like a sore thumb.

>
> NB: At least GNU grep knows how to search for multiple regexps:
> $ grep -e :PROPERTIES: -e :END: foo.org
> So, no need for egrep here.
> 

Ok - thanks.

Nick

      reply	other threads:[~2011-11-22 14:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-21 18:48 [OT]: Search for missing :END: Markus Heller
2011-11-21 21:38 ` Nick Dokos
2011-11-21 23:27   ` Markus Heller
2011-11-21 23:51     ` Andrew Stribblehill
2011-11-21 23:54     ` Nick Dokos
2011-11-21 23:59       ` Jonathan Leech-Pepin
2011-11-22  0:14       ` Markus Heller
2011-11-21 23:58     ` Nick Dokos
2011-11-22  8:46   ` : " Olaf Dietsche
2011-11-22 14:37     ` Nick Dokos [this message]

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=22762.1321972632@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=hellerm2@gmail.com \
    --cc=olaf+list.orgmode@olafdietsche.de \
    /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).