From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: no-spam@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.bugs Subject: Re: `match-data' set improperly Date: 12 Feb 2003 11:53:24 +0100 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <5xsmutsrbv.fsf@kfs2.cua.dk> References: <200302120316.h1C3Gvcu007789@beth.swift.xxx> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1045043808 2294 80.91.224.249 (12 Feb 2003 09:56:48 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 12 Feb 2003 09:56:48 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18itdH-0000as-00 for ; Wed, 12 Feb 2003 10:56:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18itfB-0004bC-09 for gnu-bug-gnu-emacs@m.gmane.org; Wed, 12 Feb 2003 04:58:45 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18itez-0004Xp-00 for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2003 04:58:33 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18itey-0004WS-00 for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2003 04:58:32 -0500 Original-Received: from mail.filanet.dk ([195.215.206.179]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18itau-0003UE-00 for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2003 04:54:20 -0500 Original-Received: from kfs2.cua.dk.cua.dk (kfs2.local.filanet.dk [192.168.1.182]) by mail.filanet.dk (Postfix) with SMTP id BC1947C012; Wed, 12 Feb 2003 10:54:14 +0100 (CET) Original-To: Matthew Swift In-Reply-To: <200302120316.h1C3Gvcu007789@beth.swift.xxx> Original-Lines: 21 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4434 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4434 Matthew Swift writes: > Evaluating the following `let' form gives varying results, but the results > should be consistent. Correct results are always returned when `s' is "The > quick fox...", which matches the regexp `r'. When `s' is "great grey > green...", which does not match `r', the results in my trials have never been > correct: either an 'args-out-of-range' error is raised, or incorrect data is > given, which appears to be the result of applying match-data from matching a > previous value of `s' ("The quick fox...") to the current value of `s'. Sample > results are copied below. > > My *guess* is that when `string-match' fails, it either fails to set > `match-data' or sets it incorrectly in one of two (or more) ways. My guess is that you are not supposed to use match-data when string-match fails, so its value is indeed undefined in that case. What _valid_ values would you expect it to contain after the match failed? -- Kim F. Storm http://www.cua.dk