Alan L Tyree <alanty...@gmail.com> writes:

> So: my problem is that somehow the '137.' got at the head of a line. I
> have no idea how that happened. I inserted references in this document
> using reftex, so I suppose that is one source to investigate.
>
> The other source is, no doubt, cut and paste.
>
> In a 60+ page document, I had four or five of these, so it is a very
> annoying problem.
>
> In view of this, should I explore further about the source of these or
> try out the patch you sent?
>

If the problematic lines existed in the file that you pasted into an org
file, then there is nothing that org can do of course. The thing to do
is to check the file *before* you "import" it into org. Here's a simple
awk script to catch the two cases of plain and numbered lists:

--8<---------------cut here---------------start------------->8---
#! /usr/bin/gawk -f

/^ *- /         {printf("Line %d: plain list element: %s\n", NR, $0);}
/^ *[0-9]+\. /  {printf("Line %d: numbered list element: %s\n", NR, $0);}
--8<---------------cut here---------------end--------------->8---

Catching more cases and integrating the script into your workflow (and
fixing any bugs) is left as an exercise.

-- 
Nick


Reply via email to