From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: error in replace-match: "args out of range" Date: Sun, 27 Mar 2011 19:07:49 +0000 (UTC) Organization: muc.de e.V. Message-ID: References: <4D8F2752.2070604@mousecar.com> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1301254832 14943 80.91.229.12 (27 Mar 2011 19:40:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 27 Mar 2011 19:40:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 27 21:40:29 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 1Q3vp6-0003Fw-5F for geh-help-gnu-emacs@m.gmane.org; Sun, 27 Mar 2011 21:40:28 +0200 Original-Received: from localhost ([127.0.0.1]:53911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q3vp5-0005hp-KH for geh-help-gnu-emacs@m.gmane.org; Sun, 27 Mar 2011 15:40:27 -0400 Original-Path: usenet.stanford.edu!goblin3!goblin.stu.neva.ru!news.tu-darmstadt.de!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-NNTP-Posting-Host: marvin.muc.de Original-X-Trace: colin2.muc.de 1301252869 50125 2001:608:1000::2 (27 Mar 2011 19:07:49 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: Sun, 27 Mar 2011 19:07:49 +0000 (UTC) User-Agent: tin/1.6.2-20030910 ("Pabbay") (UNIX) (FreeBSD/4.11-RELEASE (i386)) Original-Xref: usenet.stanford.edu gnu.emacs.help:186349 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:80478 Archived-At: Hi, Ken. ken wrote: > > On 03/27/2011 08:02 AM ken wrote: >> replace-match works fine in a couple instances in one function, but this >> instance (in the same function) it doesn-- 't. I get the error msg below >> about the arguments being out of range. I'm guessing the problem is >> with the 4th arg, the one beginning: #("> "(fontified ..." cruft in it... is that confusing replace-match...? Or >> might I have just the totally wrong type arg there? >> Debugger entered--Lisp error: (args-out-of-range -1 -1) >> replace-match("Text for Heading" t nil #("> name=\"Testing-TOC-Header\">" 0 1 (fontified t face >> font-lock-function-name-face) 1 2 (fontified t face html-tag-face) 2 3 >> (fontified t) 3 8 (fontified t face font-lock-variable-name-face) 8 9 >> (fontified t face font-lock-string-face) 9 27 (fontified t face >> font-lock-string-face) 27 28 (fontified t face font-lock-string-face) 28 >> 29 (fontified t face font-lock-function-name-face) 29 30 (fontified t >> face font-lock-function-name-face) 30 32 (fontified t face >> html-tag-face) 32 33 (fontified t face font-lock-function-name-face)) 4) >> eval((replace-match head-text-nested t nil head-text 4)) > Still groping for a resolution.... Here's something that might be > relevant. > The immediately preceding re-search-forward was successful. However, > the subexpression which matched (#4) is a null string, i.e., "". So the > question: Will replace-match replace an empty string with specified > text...? in effect *inserting* text at the location of the specified > (albeit nil) subexpression? You'll be far more likely to get help if you give some basic details. WhIch Emacs version are you using (M-x emacs-version)? What major mode are you in? What minor modes (if any) are active? What did you ACTUALLY DO (exactly which keys did you press) to cause the error. Can you make the error happen in a small enough buffer to post? If so, do it! The idea is to help somebody reproduce the error with the minimum amount of work. Incidentally, there's a section on bug reporting in the Emacs Manual on page "Bugs". To get to it, do C-h i, m emacs, g bugs. -- Alan Mackenzie (Nuremberg, Germany).