From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#6388: Should not match data be set on misses? Date: Thu, 10 Jun 2010 15:35:17 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1276178323 30066 80.91.229.12 (10 Jun 2010 13:58:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 10 Jun 2010 13:58:43 +0000 (UTC) Cc: 6388@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 10 15:58:40 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-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 1OMiHG-0002Yi-OC for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Jun 2010 15:58:39 +0200 Original-Received: from localhost ([127.0.0.1]:40838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMiHG-00087u-9v for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Jun 2010 09:58:38 -0400 Original-Received: from [140.186.70.92] (port=39042 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMiGv-0007vb-Rh for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2010 09:58:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OMiGu-0000xj-HC for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2010 09:58:17 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52142) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMiGu-0000xe-Ey for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2010 09:58:16 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OMhvN-0003HS-SO; Thu, 10 Jun 2010 09:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lennart Borgman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Jun 2010 13:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6388 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6388-submit@debbugs.gnu.org id=B6388.127617694512604 (code B ref 6388); Thu, 10 Jun 2010 13:36:01 +0000 Original-Received: (at 6388) by debbugs.gnu.org; 10 Jun 2010 13:35:45 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMhv6-0003HF-NI for submit@debbugs.gnu.org; Thu, 10 Jun 2010 09:35:45 -0400 Original-Received: from mail-yx0-f172.google.com ([209.85.213.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMhv5-0003H9-9M for 6388@debbugs.gnu.org; Thu, 10 Jun 2010 09:35:43 -0400 Original-Received: by yxt33 with SMTP id 33so1361355yxt.3 for <6388@debbugs.gnu.org>; Thu, 10 Jun 2010 06:35:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=/pHQkK7LVyUd99og+7CMCfTfVhEFMoXyZfxYdchkz4Q=; b=iyI7MDuvlD7ntsrCedp5oi7OrzQRDPQdHD0sLXBkB2/UXQFO+Z6QyFKAUxiZHGqop/ Sp3QucAx2+JwV/mugPnnQAJ9ti8rITfrAj8MTs/t67NB9N+7HBVRrS/c51T49zmwn1uq zHUOaiOIgvHpWsz51aMuw53QUfAf5UVK1XCF0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=LixOQof5UlBEQte/Rj53rP1d3lP3YYDsqhlcB4kNkM9vfBjvCId1EiBkrTQr/72XA7 C73bgiLqnK7XPI+x2hRQtzcYVRzb8JkWaYVaJ5/lVmizby8o5p9MMbeXYudgM8+eneGC CTrpW4gC+4j9lKfF+XEvh12Hwbx0ZIX9OGLxc= Original-Received: by 10.101.129.16 with SMTP id g16mr176010ann.76.1276176937889; Thu, 10 Jun 2010 06:35:37 -0700 (PDT) Original-Received: by 10.100.154.15 with HTTP; Thu, 10 Jun 2010 06:35:17 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 10 Jun 2010 09:36:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37651 Archived-At: On Thu, Jun 10, 2010 at 3:04 PM, Stefan Monnier wrote: >> I'm closing this bug report because the ELisp manual explicitly >> documents the current behavior: > >> =C2=A0 =C2=A0 =C2=A0 Every successful search sets the match data. =C2=A0= Therefore, you should >> =C2=A0 =C2=A0query the match data immediately after searching, before ca= lling any >> =C2=A0 =C2=A0other function that might perform another search. =C2=A0Alt= ernatively, you >> =C2=A0 =C2=A0may save and restore the match data (*note Saving Match Dat= a::) around >> =C2=A0 =C2=A0the call to functions that could perform another search. > >> =C2=A0 =C2=A0 =C2=A0 A search which fails may or may not alter the match= data. =C2=A0In the >> =C2=A0 =C2=A0past, a failing search did not do this, but we may change i= t in the >> =C2=A0 =C2=A0future. =C2=A0So don't try to rely on the value of the matc= h data after a >> =C2=A0 =C2=A0failing search. > >> Patches welcome to "change this in the future" (unless Stefan or >> Yidong object to such a change). > > Yes, there was a long discussion about this a few years ago. Sorry, forgot. > The main > obstacle to such a change are: > - it breaks some code. Aka it makes some bugs (bad assumptions) surface. That is not always bad. > - it is not tremendously useful. But it is probably what a user/programmer normally expects. > - it is difficult to detect code that relies on the current behavior > =C2=A0(so it's difficult to output a warning to help in the migration). > The current behavior is not tremendously useful either, of course, but > it has the advantage of being what we've used for many years. Yes, that is true. However the current behavior probably wastes a lot of time for those unaware of it.