Subject: Re: bug#16265: 24.3.50; re-search-forward (error "Invalid search bound (wrong side of point)")

From: Nicolas Richard <[email-masked]>
Date: Fri, 27 Dec 2013 13:55:56 +0100

Keith David Bershatsky <[email-masked]> writes:
>So my best guess is that the problem is with
> re-search-forward` or a function that it relies upon -- however it's
> written in "C" which is out of my league.

The given error happens when you search forward but set a limit before
point, e.g. (re-search-forward "." (1- (point))). It'd be very
surprising that the code throws that error wrongly.

> The error comes about when calling `org-capture` a second time after
> creating the first todo.

I tried calling org-capture twice but couldn't reproduce. Do you have a
recipe ?

> Debugger entered--Lisp error: (error "Invalid search bound (wrong side of point)")
>   re-search-forward("^\\(?:\\*+
> \\|\\[\\(?:[0-9]+\\|fn:[-_[:word:]]+\\)\\]\\|[
> ]*\\(?:$\\|\\(?:|\\|\\+-[-+]\\)\\|[#:]\\|-\\{5,\\}[
> ]*$\\|\\\\begin{\\([A-Za-z0-9]+\\*?\\)}\\|\\(?:\\(?:CLO\\(?:CK\\|SED\\)\\|DEADLINE\\|SCHEDULED\\):\\)\\|\\(?:[-+*]\\|\\(?:[0-9]+\\)[.)]\\)\\(?:[
> ]\\|$\\)\\)\\)" 40674 m)
>   org-element-paragraph-parser(40674)

org-element-paragraph-parser calls "end-of-line" before calling
re-search-forward, perhaps that's a problem in this situation ? I don't
know where the limit comes from.

>   org-element--current-element(40674 element nil nil)
>   byte-code("\306\303	\n$\211@\307
> \211:\203$

This backtrace looks incomplete.

-- 
Nico.