help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error in replace-match: "args out of range" [SOLVED]


From: ken
Subject: Re: error in replace-match: "args out of range" [SOLVED]
Date: Tue, 05 Apr 2011 23:39:39 -0400
User-agent: Thunderbird 2.0.0.24 (X11/20101213)

On 04/04/2011 09:56 PM Stefan Monnier wrote:
>> Here's the relevant code fragment:
> 
>>     (if (re-search-forward aname-re-str head-text-end-pt t)
>>      (progn  
>>        (setq aname-str (match-string 2))
>>        (setq head-text-nested (match-string 4))
>>        (if (equal head-text-nested "")
>>            (progn
>>              (setq head-text-nested (create-heading-text))
>>              (if (equal aname-str "")
>>                  (progn
>>                    (setq aname-str (create-aname head-text-nested))
>>                    (replace-match head-text-nested t nil nil 4)
>>                    (replace-match aname-str t nil nil 2))
>>                (replace-match head-text-nested t t nil 4))) ;ERROR:
> 
> An obvious part to heck is create-heading-text: if it might ever call
> a regexp-matching function, then you have a problem.
> 
> 
>         Stefan

Stefan,

You pointed to the right function... well, it was actually both.  But
the problem wasn't a search, but with the read-from-minibuffer function.
 For some reason, invoking that wipes out all the subexpressions.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]