From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexis Newsgroups: gmane.emacs.devel Subject: Re: Possible bug in `match-string` in 24.4.50.18? Date: Mon, 26 May 2014 10:01:31 +1000 Message-ID: <87zji5flwk.fsf@gmail.com> References: <87bnumh3zh.fsf@gmail.com> <83ioouj80l.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1401062519 12036 80.91.229.3 (26 May 2014 00:01:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 May 2014 00:01:59 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 26 02:01:52 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WoiMR-0003VJ-Bt for ged-emacs-devel@m.gmane.org; Mon, 26 May 2014 02:01:51 +0200 Original-Received: from localhost ([::1]:53818 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoiMQ-0004Jy-UR for ged-emacs-devel@m.gmane.org; Sun, 25 May 2014 20:01:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoiMJ-0004Jr-1h for emacs-devel@gnu.org; Sun, 25 May 2014 20:01:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WoiMD-0007NV-Jl for emacs-devel@gnu.org; Sun, 25 May 2014 20:01:42 -0400 Original-Received: from mail-pb0-x22b.google.com ([2607:f8b0:400e:c01::22b]:63162) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoiMD-0007NP-Bu for emacs-devel@gnu.org; Sun, 25 May 2014 20:01:37 -0400 Original-Received: by mail-pb0-f43.google.com with SMTP id up15so6810871pbc.30 for ; Sun, 25 May 2014 17:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:user-agent:from:to:subject:in-reply-to:date:message-id :mime-version:content-type; bh=HXRkWYfl1UAe93RkXUinkruxG8eeNrvxHEFlqZjv26Q=; b=WQ6LGTfomweUeBV6EVSc0iPrPIyM2AxE+AzTPbytMfvgcgU6TzTuubR/A9UM5HJV47 YPkViVSIB99/clJuIZDRhESE/QMGds3KdIbDYOm6tY3ppl7mpRFLtxlMW2zOaldPjG9x CsINn1MnGBn0Gm5GrfGMJmTmkTDKAqVYr4I2qy7Sh+8sEctX8gV7EkwoKqkJ42AQ5+dv svo/R511FWs3M76s7Yz6Pr2n3eF0kOUOTC42t9Df7xxT89ao/SHp9TMPnWyYIYuqOmjO MUT9OBmpfqvXU8BdjN2pxO3V07NWKTXpI/cX1qf02yhmzcSQrr3wDdy9RRaAAo7YrFEY ja4Q== X-Received: by 10.67.1.39 with SMTP id bd7mr24017382pad.15.1401062495726; Sun, 25 May 2014 17:01:35 -0700 (PDT) Original-Received: from localhost (ppp118-209-145-187.lns20.mel6.internode.on.net. [118.209.145.187]) by mx.google.com with ESMTPSA id xw5sm49550376pab.30.2014.05.25.17.01.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 25 May 2014 17:01:35 -0700 (PDT) User-agent: mu4e 0.9.9.6pre3; emacs 24.4.50.18 In-reply-to: <83ioouj80l.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:172088 Archived-At: Eli Zaretskii writes: >> From: Alexis >> Date: Sun, 25 May 2014 14:33:22 +1000 >> >> (setq address "mailto:alexis@example.com") >> (setq re "mailto") >> (string-match re address) >> (match-string 0 address) >> >> In 24.3, the call to `string-match` correctly returns 0, and the call to >> `match-string` correctly returns "mailto". >> >> In 24.4.50.18 (more specifically, git commit >> 08005cbfff9227ac73cbee5f3f5afa65f8c27849), the call to `string-match` >> correctly returns 0, but the call to `match-string` consistently returns >> "m" instead of "mailto". >> >> Am i doing something wrong, is there an issue with my local setup, or is >> this a bug? > > I cannot reproduce this with today's trunk. Does it happen to you in > "emacs -Q"? It does; the above results were derived from running both 24.4.50.18 and 24.3 with the -Q option. However, putting the code inside a `let` as suggested by Stefan does result in the correct output being produced. Alexis.