From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Possible bug in `match-string` in 24.4.50.18? Date: Sun, 25 May 2014 16:02:26 -0400 Message-ID: References: <87bnumh3zh.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1401048178 1108 80.91.229.3 (25 May 2014 20:02:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 May 2014 20:02:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alexis Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 25 22:02:51 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 1Woed8-0002q3-6a for ged-emacs-devel@m.gmane.org; Sun, 25 May 2014 22:02:50 +0200 Original-Received: from localhost ([::1]:53121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Woed5-0005lP-Fq for ged-emacs-devel@m.gmane.org; Sun, 25 May 2014 16:02:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Woecv-0005lF-2m for emacs-devel@gnu.org; Sun, 25 May 2014 16:02:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Woecn-0005Hi-9D for emacs-devel@gnu.org; Sun, 25 May 2014 16:02:37 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:9445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Woecn-0005HV-4i for emacs-devel@gnu.org; Sun, 25 May 2014 16:02:29 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVNLd/fU/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0CwcUGA0NFxOHcQjSGReOegeEOASpGYFqg0wh X-IPAS-Result: ArUGAIDvNVNLd/fU/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0CwcUGA0NFxOHcQjSGReOegeEOASpGYFqg0wh X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="64104417" Original-Received: from 75-119-247-212.dsl.teksavvy.com (HELO pastel.home) ([75.119.247.212]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 25 May 2014 16:02:26 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id AAF8F600CA; Sun, 25 May 2014 16:02:26 -0400 (EDT) In-Reply-To: <87bnumh3zh.fsf@gmail.com> (Alexis's message of "Sun, 25 May 2014 14:33:22 +1000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:172085 Archived-At: > Take the following code: > (setq address "mailto:alexis@example.com") > (setq re "mailto") > (string-match re address) > (match-string 0 address) These are 4 separate expressions. How do you run them? My crystal ball says that the problem is the code you unknowingly run between each one of those expressions. If you run them as a single expression such as (let ((address "mailto:alexis@example.com") (re "mailto")) (if (string-match re address) (match-string 0 address))) I'm pretty sure you'll get what you want. Stefan