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: 13 Feb 2003 13:25:16 +0100 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <5xfzqsl64z.fsf@kfs2.cua.dk> References: <001301c2d32b$17f71b40$6200a8c0@swift.xxx> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1045136880 26988 80.91.224.249 (13 Feb 2003 11:48:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 13 Feb 2003 11:48:00 +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 18jHqM-00070d-00 for ; Thu, 13 Feb 2003 12:47:55 +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 18jHa4-00056U-04 for gnu-bug-gnu-emacs@m.gmane.org; Thu, 13 Feb 2003 06:31:04 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18jHZQ-0004y7-00 for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2003 06:30:24 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18jHXR-00046l-00 for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2003 06:28:53 -0500 Original-Received: from mail.filanet.dk ([195.215.206.179]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18jHVJ-0003fu-00 for bug-gnu-emacs@gnu.org; Thu, 13 Feb 2003 06:26:10 -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 B0ED77C012; Thu, 13 Feb 2003 12:26:07 +0100 (CET) Original-To: "Matt Swift" In-Reply-To: <001301c2d32b$17f71b40$6200a8c0@swift.xxx> Original-Lines: 32 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-cc: 'Luc Teirlinck' 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:4456 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4456 "Matt Swift" writes: > I stand corrected. > > Nevertheless I see a strong case for revising both the documentation and the > behavior of the function. I have fixed the documentation for match-data, so that it explicitly states that the return value is undefined if the last search failed. I don't see a strong reason to change the behaviour; it's worked like this for many years, so people seem to be able to cope with it. I think the code is generally easier to understand if there is an explicit test on the return value of the search command. On the other hand, I don't object (but I'm not the one to decide!!) to changing this behaviour in the way you suggest (i.e. make the various match-* functions return nil if the last search failed). Maybe you can write a patch (it can be isolated to search.c I think), so we can see what's needed? > The second sentence you quote is almost meaningless. "did not do > this" -- did not do WHAT? alter it, or not alter it? Likewise, one > cannot tell what might be changed to what in the future. At least it cleary (:-)) indicates that you should not rely on the return value, neither now, nor in the future. -- Kim F. Storm http://www.cua.dk