From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: error in replace-match: "args out of range" Date: Mon, 04 Apr 2011 21:56:13 -0400 Organization: A noiseless patient Spider Message-ID: References: <4D90D85C.5060805@mousecar.com> <4D98EE5B.4080108@mousecar.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1301971247 8709 80.91.229.12 (5 Apr 2011 02:40:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 5 Apr 2011 02:40:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 05 04:40:44 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q6wC9-0003E1-Sf for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Apr 2011 04:40:42 +0200 Original-Received: from localhost ([127.0.0.1]:35479 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6wC9-0007YE-AQ for geh-help-gnu-emacs@m.gmane.org; Mon, 04 Apr 2011 22:40:41 -0400 Original-Path: usenet.stanford.edu!news.glorb.com!news2.glorb.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 21 Injection-Info: mx02.eternal-september.org; posting-host="GQt2ijV7I4tUlF+wCE7rhw"; logging-data="7102"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wnPdr5c/y870SuWA3+cWD" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:NmNFQzSxrdcGwovorfqBos0X7Jo= sha1:K5dBczYSKdkvMYRpI/J8nIJTMZA= Original-Xref: usenet.stanford.edu gnu.emacs.help:186497 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:80613 Archived-At: > 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