From unknown Tue Jun 17 20:12:43 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#4209 <4209@debbugs.gnu.org> To: bug#4209 <4209@debbugs.gnu.org> Subject: Status: 23.1; Emacs 23.1 regression in re-search-forward Reply-To: bug#4209 <4209@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:12:43 +0000 retitle 4209 23.1; Emacs 23.1 regression in re-search-forward reassign 4209 emacs submitter 4209 "Christopher J. Madsen" severity 4209 serious thanks From cjm@cjmweb.net Wed Aug 19 17:50:52 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 20 Aug 2009 00:50:53 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7K0opM1027949 for ; Wed, 19 Aug 2009 17:50:52 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mdvrf-0004up-BF for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2009 20:50:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MdvrT-0004oJ-GW for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2009 20:50:50 -0400 Received: from [199.232.76.173] (port=40784 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdvrT-0004o8-CS for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2009 20:50:39 -0400 Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:45466 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MdvrS-0005dR-IO for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2009 20:50:38 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id CC2BD11C6B for ; Wed, 19 Aug 2009 20:50:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=date :message-id:from:to:subject:cc; s=sasl; bh=adqyjWsJvcQIFLouJFFYQ hnynow=; b=lIh27mKD+WAhosgEP5TZXDOGjPkL0odQ3/acOXYVjKUDieGAt3MVq iqGxerKUNES2TxxEsXssZBx5ZsanrgKmoZJYLHFgvAPU+XwlPuC7n4y+0fy5yVcJ kVKik1ElJMI0YqMKd1xXuY5PtQNm18xW+k55CLjzxCoEDTwAgEHavU= Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id C96F511C6A for ; Wed, 19 Aug 2009 20:50:34 -0400 (EDT) Received: from orthanc.cjmweb.net (unknown [66.25.11.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 85CE411C69 for ; Wed, 19 Aug 2009 20:50:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=cjmweb.net; h=date:message-id:from:to:subject:cc; s=y09; bh=N0eyk53kbSSZH6JKBtrGJ8YhjAJVT4JGPoF0ME+T/Go=; b=b1FDDuuiIcISF56XvhExA5WIV6wtDhsV7QE3kUshjFdz0ukFfH1B2LYyTnEi+ycyfyV3DWMXmyHVJiRaeEE4KEq6nal7/k84AtyUqBa8/PYK/JHcK/KC1/Y8lbDlSMMHHtolRUVEvydck5cXByCyFbP2/LvPkyw3c5xs870BqOI= Received: (qmail 20131 invoked by uid 1000); 20 Aug 2009 00:50:33 -0000 Date: 20 Aug 2009 00:50:33 -0000 Message-ID: <20090820005033.20130.qmail@cjmweb.net> From: "Christopher J. Madsen" To: bug-gnu-emacs@gnu.org Subject: 23.1; Emacs 23.1 regression in re-search-forward CC: cjm@byte.mynet X-Pobox-Relay-ID: 78364594-8D23-11DE-833E-CA0F1FFB4A78-09214675!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) I've found a regression in Emacs 23.1 (versus Emacs 22.3). I've narrowed it down to this test case: ;--- re-bug.el starts here (set-buffer (get-buffer-create "*Test Buffer*")) (insert "\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A") (goto-char (point-min)) (message "looking-at: %s" (looking-at "\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A")) (message "re-search-forward: %s" (re-search-forward "\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A" 100 t)) ;--- re-bug.el ends here Then at the command line: $ emacs-22 --batch -Q -l re-bug.el looking-at: t re-search-forward: 9 $ emacs-23 --batch -Q -l re-bug.el looking-at: t re-search-forward: nil As you can see, looking-at succeeds in both versions, but re-search-forward fails in Emacs 23. I don't know why. It seems like the functions should either both succeed or both fail. For comparison, here's the version of Emacs 22 that I'm using: GNU Emacs 22.3.1 (i686-pc-linux-gnu, GTK+ Version 2.12.11) of 2009-04-06 on byte Windowing system distributor `The X.Org Foundation', version 11.0.10503000 configured using `configure '--prefix=/usr' '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--program-suffix=-emacs-22' '--infodir=/usr/share/info/emacs-22' '--without-carbon' '--with-sound' '--with-x' '--with-toolkit-scroll-bars' '--with-jpeg' '--with-tiff' '--with-gif' '--with-png' '--with-xpm' '--with-x-toolkit=gtk' '--without-hesiod' '--without-kerberos' '--without-kerberos5' '--build=i686-pc-linux-gnu' 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 'CFLAGS=-march=prescott -O2 -pipe' 'LDFLAGS=-Wl,-O1'' And this is the Emacs 23 information: In GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.16.5) of 2009-08-10 on byte Windowing system distributor `The X.Org Foundation', version 11.0.10503000 configured using `configure '--prefix=/usr' '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--program-suffix=-emacs-23' '--infodir=/usr/share/info/emacs-23' '--with-sound' '--with-x' '--with-toolkit-scroll-bars' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xpm' '--without-xft' '--without-libotf' '--without-m17n-flt' '--with-x-toolkit=gtk' '--without-hesiod' '--without-kerberos' '--without-kerberos5' '--with-gpm' '--with-dbus' '--build=i686-pc-linux-gnu' 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 'CFLAGS=-march=core2 -O2 -pipe' 'LDFLAGS=-Wl,-O1'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.utf8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Fundamental From cyd@stupidchicken.com Fri Sep 11 17:53:14 2009 Received: (at control) by emacsbugs.donarmstrong.com; 12 Sep 2009 00:53:14 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.4 required=4.0 tests=AWL,VALID_BTS_CONTROL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pantheon-po32.its.yale.edu (pantheon-po32.its.yale.edu [130.132.50.88]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8C0rDQg003226 for ; Fri, 11 Sep 2009 17:53:14 -0700 Received: from furry (dhcp128036014244.central.yale.edu [128.36.14.244]) (authenticated bits=0) by pantheon-po32.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id n8C0r7ku007858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 11 Sep 2009 20:53:08 -0400 Received: by furry (Postfix, from userid 1000) id 32F93C070; Fri, 11 Sep 2009 20:53:08 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: severity 4209 serious Date: Fri, 11 Sep 2009 20:53:08 -0400 Message-ID: <87ab11vv9n.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) severity 4209 serious thanks From matthew@dempsky.org Tue Dec 1 16:21:14 2009 Received: (at 4209) by emacsbugs.donarmstrong.com; 2 Dec 2009 00:21:15 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=AWL,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-pz0-f181.google.com (mail-pz0-f181.google.com [209.85.222.181]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB20LDN5025964 for <4209@emacsbugs.donarmstrong.com>; Tue, 1 Dec 2009 16:21:14 -0800 Received: by pzk11 with SMTP id 11so3716882pzk.14 for <4209@emacsbugs.donarmstrong.com>; Tue, 01 Dec 2009 16:21:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.115.103.29 with SMTP id f29mr12440725wam.222.1259713267552; Tue, 01 Dec 2009 16:21:07 -0800 (PST) Date: Tue, 1 Dec 2009 16:21:07 -0800 Message-ID: Subject: Re: 23.1; Emacs 23.1 regression in re-search-forward From: Matthew Dempsky To: 4209@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1 This is a stab in the dark, but the patch below corrects this issue for me: $ ./retest.sh looking-at: t re-search-forward: 9 I don't see any reason this should cause regressions (searching forward 0 steps seems to me it should be the same as searching backward 0 steps), but I've only casually looked over regex.c. --- a/src/regex.c +++ b/src/regex.c @@ -4524,7 +4524,7 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop) d = POS_ADDR_VSTRING (startpos); - if (range > 0) /* Searching forwards. */ + if (range >= 0) /* Searching forwards. */ { register int lim = 0; int irange = range; From cjm@cjmweb.net Sun Dec 6 19:30:49 2009 Received: (at 4209) by emacsbugs.donarmstrong.com; 7 Dec 2009 03:30:50 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from sasl.smtp.pobox.com (a-pb-sasl-quonix.pobox.com [208.72.237.25]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB73UmbD030759 for <4209@emacsbugs.donarmstrong.com>; Sun, 6 Dec 2009 19:30:49 -0800 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id CB5FB86351 for <4209@emacsbugs.donarmstrong.com>; Sun, 6 Dec 2009 22:30:47 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=message-id :date:from:mime-version:to:subject:content-type :content-transfer-encoding; s=sasl; bh=I2mxU4qbZzU3RBs7+nzMNuHIW nM=; b=F/LA6Hu1Oia05Q2Gq5JPCw4Zf9AX0xxJFOqL1uGOebDi23I8lxiweOZbq Y8nqA0t7pESXkkNRL7VsjoeXgcTXglBtQ2NM0iCzWcfD0AjvqsmLuVfMOgYSm+xD M6YmkbW8Sb9Ft0Wj+bA3KHEBPhqO0XBXBB7zxR/8lLlE/FpPWA= Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id C09B186350 for <4209@emacsbugs.donarmstrong.com>; Sun, 6 Dec 2009 22:30:47 -0500 (EST) Received: from orthanc.cjmweb.net (unknown [76.184.145.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id F15518634F for <4209@emacsbugs.donarmstrong.com>; Sun, 6 Dec 2009 22:30:46 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=cjmweb.net; h=message-id:date:from:mime-version:to:subject:content-type:content-transfer-encoding; s=y09; bh=XE1cb1b9hXk6K9GANsxy+LHneijATu7f4OSVZukfEso=; b=lVxHLZk0XAUgn0nTOVGVemgO/RtZHZMXF0xR1hRjyzg939LJlZmAVI4/XGVFoH5eDYVNm9OeuEaw8FkrnS9f9masXkoalXlGk79486UUz2MKzMr2bMHCC0WedSabhHdQjZljFkoJvzhjvleexQJwzvQwW3qNevv8vsJxjCSSu+E= Received: (qmail 8336 invoked from network); 7 Dec 2009 03:30:44 -0000 Received: from core.mynet (HELO ?192.168.0.8?) (192.168.0.8) by byte.mynet with SMTP; 7 Dec 2009 03:30:44 -0000 Message-ID: <4B1C76E3.5030004@cjmweb.net> Date: Sun, 06 Dec 2009 21:30:43 -0600 From: "Christopher J. Madsen" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: 4209@debbugs.gnu.org Subject: Re: 23.1; Emacs 23.1 regression in re-search-forward Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Pobox-Relay-ID: E903F376-E2E0-11DE-AA73-9F3FEE7EF46B-09214675!a-pb-sasl-quonix.pobox.com Matthew's patch corrects the problem for me, too. (Even though that line did not change between 22.3 and 23.1.) Thanks, Matthew. This bug had been preventing me from upgrading to 23. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 26 15:38:39 2010 Received: (at 4209) by debbugs.gnu.org; 26 Jan 2010 20:38:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NZsBL-0004tp-He for submit@debbugs.gnu.org; Tue, 26 Jan 2010 15:38:39 -0500 Received: from pantheon-po34.its.yale.edu ([130.132.50.80]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NZsBJ-0004ti-Ve for 4209@debbugs.gnu.org; Tue, 26 Jan 2010 15:38:38 -0500 Received: from furry (dhcp128036014123.central.yale.edu [128.36.14.123]) (authenticated bits=0) by pantheon-po34.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o0QKcXFo001427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 26 Jan 2010 15:38:33 -0500 Received: by furry (Postfix, from userid 1000) id 46FE2C05D; Tue, 26 Jan 2010 13:38:33 -0700 (MST) From: Chong Yidong To: Kenichi Handa Subject: Re: 23.1; Emacs 23.1 regression in re-search-forward Date: Tue, 26 Jan 2010 15:38:33 -0500 Message-ID: <87ljfkha9i.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 4209 Cc: 4209@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) Hi Handa-san, Could you try to investigate Bug#4209? I took a quick look, and the contents of the Lisp string passed to Fre_search_forward in Emacs 23 is $2 = (struct Lisp_String *) 0x86765b8 "\\`\302L\357w\306i\214\n" but in Emacs 22 (where this test works) it's $2 = (struct Lisp_String *) 0x86290e8 "\\`\302L\357w\306i\236\254\n" which seems a little strange to me. > I've found a regression in Emacs 23.1 (versus Emacs 22.3). I've > narrowed it down to this test case: > > ;--- re-bug.el starts here > (set-buffer (get-buffer-create "*Test Buffer*")) > > (insert "\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A") > > (goto-char (point-min)) > > (message "looking-at: %s" (looking-at "\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A")) > > (message "re-search-forward: %s" > (re-search-forward "\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A" 100 t)) > ;--- re-bug.el ends here > > Then at the command line: > > $ emacs-22 --batch -Q -l re-bug.el > looking-at: t > re-search-forward: 9 > > $ emacs-23 --batch -Q -l re-bug.el > looking-at: t > re-search-forward: nil From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 26 22:43:48 2010 Received: (at 4209) by debbugs.gnu.org; 27 Jan 2010 03:43:49 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NZyom-0004Zw-KV for submit@debbugs.gnu.org; Tue, 26 Jan 2010 22:43:48 -0500 Received: from mx1.aist.go.jp ([150.29.246.133]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NZyoj-0004Zr-KQ for 4209@debbugs.gnu.org; Tue, 26 Jan 2010 22:43:47 -0500 Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id o0R3heCd008760; Wed, 27 Jan 2010 12:43:40 +0900 (JST) env-from (handa@m17n.org) Received: from smtp1.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id o0R3heiF028527; Wed, 27 Jan 2010 12:43:40 +0900 (JST) env-from (handa@m17n.org) Received: by smtp1.aist.go.jp with ESMTP id o0R3hdI8023137; Wed, 27 Jan 2010 12:43:39 +0900 (JST) env-from (handa@m17n.org) Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1NZyod-0002nR-9U; Wed, 27 Jan 2010 12:43:39 +0900 From: Kenichi Handa To: Chong Yidong Subject: Re: 23.1; Emacs 23.1 regression in re-search-forward In-Reply-To: <87ljfkha9i.fsf@stupidchicken.com> (message from Chong Yidong on Tue, 26 Jan 2010 15:38:33 -0500) References: <87ljfkha9i.fsf@stupidchicken.com> Date: Wed, 27 Jan 2010 12:43:39 +0900 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 4209 Cc: 4209@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) In article <87ljfkha9i.fsf@stupidchicken.com>, Chong Yidong writes: > Hi Handa-san, > Could you try to investigate Bug#4209? Ok, I'll work on it. > I took a quick look, and the > contents of the Lisp string passed to Fre_search_forward in Emacs 23 is > $2 = (struct Lisp_String *) 0x86765b8 > "\\`\302L\357w\306i\214\n" > but in Emacs 22 (where this test works) it's > $2 = (struct Lisp_String *) 0x86290e8 > "\\`\302L\357w\306i\236\254\n" > which seems a little strange to me. It seems that Emacs 22 provoides a multibyte string (perhaps because the searching buffer is multibyte) and Emacs 23 provoides a unibyte string. But, I think that difference is not important here. --- Kenichi Handa handa@m17n.org From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 27 00:41:19 2010 Received: (at 4209) by debbugs.gnu.org; 27 Jan 2010 05:41:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Na0eV-00065c-Ko for submit@debbugs.gnu.org; Wed, 27 Jan 2010 00:41:19 -0500 Received: from mx1.aist.go.jp ([150.29.246.133]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Na0eT-00065V-34 for 4209@debbugs.gnu.org; Wed, 27 Jan 2010 00:41:18 -0500 Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id o0R5fBtF025524; Wed, 27 Jan 2010 14:41:11 +0900 (JST) env-from (handa@m17n.org) Received: from smtp2.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id o0R5fBIc023360; Wed, 27 Jan 2010 14:41:11 +0900 (JST) env-from (handa@m17n.org) Received: by smtp2.aist.go.jp with ESMTP id o0R5fBxa001700; Wed, 27 Jan 2010 14:41:11 +0900 (JST) env-from (handa@m17n.org) Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1Na0eN-0004dA-Ab; Wed, 27 Jan 2010 14:41:11 +0900 From: Kenichi Handa To: Kenichi Handa Subject: Re: bug#4209: 23.1; Emacs 23.1 regression in re-search-forward In-Reply-To: (message from Kenichi Handa on Wed, 27 Jan 2010 12:43:39 +0900) References: <87ljfkha9i.fsf@stupidchicken.com> Date: Wed, 27 Jan 2010 14:41:11 +0900 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 4209 Cc: 4209@debbugs.gnu.org, cyd@stupidchicken.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) In article , Kenichi Handa writes: > In article <87ljfkha9i.fsf@stupidchicken.com>, Chong Yidong writes: > > Hi Handa-san, > > Could you try to investigate Bug#4209? > Ok, I'll work on it. I fixed it as below. === modified file 'src/regex.c' --- src/regex.c 2010-01-13 08:35:10 +0000 +++ src/regex.c 2010-01-27 03:57:03 +0000 @@ -4083,8 +4083,7 @@ the corresponding multibyte character. */ int c = RE_CHAR_TO_MULTIBYTE (p[1]); - if (! CHAR_BYTE8_P (c)) - fastmap[CHAR_LEADING_CODE (c)] = 1; + fastmap[CHAR_LEADING_CODE (c)] = 1; } } break; But, first of all, I don't know (remember) why there was this check: if (! CHAR_BYTE8_P (c)) I may have overlooked something. Stefan, could you please confirm that the above change is correct? --- Kenichi Handa handa@m17n.org From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 27 09:34:47 2010 Received: (at 4209) by debbugs.gnu.org; 27 Jan 2010 14:34:47 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Na8yj-0003BX-DF for submit@debbugs.gnu.org; Wed, 27 Jan 2010 09:34:45 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Na8yi-0003BP-3l for 4209@debbugs.gnu.org; Wed, 27 Jan 2010 09:34:44 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEALfdX0tFpaAe/2dsb2JhbACBO9Y0hDgEilA X-IronPort-AV: E=Sophos;i="4.49,353,1262581200"; d="scan'208";a="54665601" Received: from 69-165-160-30.dsl.teksavvy.com (HELO pastel.home) ([69.165.160.30]) by ironport2-out.pppoe.ca with ESMTP; 27 Jan 2010 09:34:38 -0500 Received: by pastel.home (Postfix, from userid 20848) id 7F54F88D6; Wed, 27 Jan 2010 09:34:38 -0500 (EST) From: Stefan Monnier To: Kenichi Handa Subject: Re: bug#4209: 23.1; Emacs 23.1 regression in re-search-forward Message-ID: References: <87ljfkha9i.fsf@stupidchicken.com> Date: Wed, 27 Jan 2010 09:34:38 -0500 In-Reply-To: (Kenichi Handa's message of "Wed, 27 Jan 2010 14:41:11 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: 4209 Cc: 4209@debbugs.gnu.org, cyd@stupidchicken.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) >> > Could you try to investigate Bug#4209? >> Ok, I'll work on it. > I fixed it as below. > === modified file 'src/regex.c' > --- src/regex.c 2010-01-13 08:35:10 +0000 > +++ src/regex.c 2010-01-27 03:57:03 +0000 > @@ -4083,8 +4083,7 @@ > the corresponding multibyte character. */ > int c = RE_CHAR_TO_MULTIBYTE (p[1]); > - if (! CHAR_BYTE8_P (c)) > - fastmap[CHAR_LEADING_CODE (c)] = 1; > + fastmap[CHAR_LEADING_CODE (c)] = 1; > } > } > break; > But, first of all, I don't know (remember) why there was this check: > if (! CHAR_BYTE8_P (c)) > I may have overlooked something. Stefan, could you please > confirm that the above change is correct? The preceding comment keeps me puzzled. I thought that we only ever matched re_patterns and buffers of the same multibyteness, i.e. if a unibyte regexp is matched against a multibyte buffer it should first be turned into a multibyte regexp and then re_compiled, so the case of: /* For the case of matching this unibyte regex against multibyte, we must set a leading code of the corresponding multibyte character. */ should never happen in analyse_first. Yet, if your patch fixes the bug, that indicates that apparently it *does* happen. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 27 11:43:40 2010 Received: (at 4209) by debbugs.gnu.org; 27 Jan 2010 16:43:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NaAzT-0004Kq-3I for submit@debbugs.gnu.org; Wed, 27 Jan 2010 11:43:39 -0500 Received: from pantheon-po34.its.yale.edu ([130.132.50.80]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NaAzQ-0004Kg-Lz for 4209@debbugs.gnu.org; Wed, 27 Jan 2010 11:43:37 -0500 Received: from furry (dhcp128036014123.central.yale.edu [128.36.14.123]) (authenticated bits=0) by pantheon-po34.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o0RGhVW7010523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 27 Jan 2010 11:43:31 -0500 Received: by furry (Postfix, from userid 1000) id 8990FC05D; Wed, 27 Jan 2010 09:43:30 -0700 (MST) From: Chong Yidong To: Stefan Monnier Subject: Re: bug#4209: 23.1; Emacs 23.1 regression in re-search-forward References: <87ljfkha9i.fsf@stupidchicken.com> Date: Wed, 27 Jan 2010 11:43:30 -0500 In-Reply-To: (Stefan Monnier's message of "Wed, 27 Jan 2010 09:34:38 -0500") Message-ID: <87zl3z4hxp.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 4209 Cc: 4209@debbugs.gnu.org, Kenichi Handa X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) Stefan Monnier writes: > The preceding comment keeps me puzzled. I thought that we only ever > matched re_patterns and buffers of the same multibyteness, i.e. if > a unibyte regexp is matched against a multibyte buffer it should first > be turned into a multibyte regexp and then re_compiled, so the case of: > > /* For the case of matching this unibyte regex > against multibyte, we must set a leading code of > the corresponding multibyte character. */ > > should never happen in analyse_first. Yet, if your patch fixes the bug, > that indicates that apparently it *does* happen. I observe that in the original bug recipe: (set-buffer (get-buffer-create "*Test Buffer*")) (insert "\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A") (goto-char (point-min)) (message "looking-at: %s" (looking-at "\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A")) (message "re-search-forward: %s" (re-search-forward "\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A" 100 t)) If we replace (re-search-forward "\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A" 100 t)) with (re-search-forward (string-to-multibyte "\\`\xC2\x4C\xEF\x77\xC6\x69\x8C\x0A") 100 t)) then the regexp match takes places correctly. I'm not sure why the looking-at call works, tho. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 27 20:19:07 2010 Received: (at 4209) by debbugs.gnu.org; 28 Jan 2010 01:19:07 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NaJ2I-0005AB-VP for submit@debbugs.gnu.org; Wed, 27 Jan 2010 20:19:07 -0500 Received: from mx1.aist.go.jp ([150.29.246.133]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NaJ2F-00059q-Ak for 4209@debbugs.gnu.org; Wed, 27 Jan 2010 20:19:04 -0500 Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id o0S1Ivl3019798; Thu, 28 Jan 2010 10:18:57 +0900 (JST) env-from (handa@m17n.org) Received: from smtp1.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id o0S1IvjI028260; Thu, 28 Jan 2010 10:18:57 +0900 (JST) env-from (handa@m17n.org) Received: by smtp1.aist.go.jp with ESMTP id o0S1IuoE028417; Thu, 28 Jan 2010 10:18:56 +0900 (JST) env-from (handa@m17n.org) Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1NaJ27-0004S0-U6; Thu, 28 Jan 2010 10:18:55 +0900 From: Kenichi Handa To: Stefan Monnier Subject: Re: bug#4209: 23.1; Emacs 23.1 regression in re-search-forward In-Reply-To: (message from Stefan Monnier on Wed, 27 Jan 2010 09:34:38 -0500) References: <87ljfkha9i.fsf@stupidchicken.com> Date: Thu, 28 Jan 2010 10:18:55 +0900 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 4209 Cc: 4209@debbugs.gnu.org, cyd@stupidchicken.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) In article , Stefan Monnier writes: > The preceding comment keeps me puzzled. I thought that we only ever > matched re_patterns and buffers of the same multibyteness, i.e. if > a unibyte regexp is matched against a multibyte buffer it should first > be turned into a multibyte regexp and then re_compiled, so the case of: Before we changed the behavour of unibyte->multibyte conversion, that conversion depended on the preferred charset (thus on lang. env.). But, Emacs 22 wrongly cached the pattern converted at some point, and reused it without checking the change of preferred charset. So, in emacs-unicode branch, I fixed the regex code so that unibyte pattern can be directry used for multibyte buffer search by doing unibyte->multibyte conversion on the fly. And that code was merged to trunk. So, > /* For the case of matching this unibyte regex > against multibyte, we must set a leading code of > the corresponding multibyte character. */ really happens. --- Kenichi Handa handa@m17n.org From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 28 12:27:03 2010 Received: (at control) by debbugs.gnu.org; 28 Jan 2010 17:27:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NaY91-0001vE-Kz for submit@debbugs.gnu.org; Thu, 28 Jan 2010 12:27:03 -0500 Received: from pantheon-po33.its.yale.edu ([130.132.50.94]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NaY90-0001uj-5c for control@debbugs.gnu.org; Thu, 28 Jan 2010 12:27:02 -0500 Received: from furry (dhcp128036014123.central.yale.edu [128.36.14.123]) (authenticated bits=0) by pantheon-po33.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o0SHQvtx028800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 28 Jan 2010 12:26:57 -0500 Received: by furry (Postfix, from userid 1000) id 9F6FFC05D; Thu, 28 Jan 2010 12:26:57 -0500 (EST) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 4209 Date: Thu, 28 Jan 2010 12:26:57 -0500 Message-ID: <87sk9qf8da.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) close 4209 thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 28 14:02:11 2010 Received: (at 4209) by debbugs.gnu.org; 28 Jan 2010 19:02:12 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NaZd4-0005tM-RS for submit@debbugs.gnu.org; Thu, 28 Jan 2010 14:02:10 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NaZd3-0005sw-NY for 4209@debbugs.gnu.org; Thu, 28 Jan 2010 14:02:10 -0500 Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id o0SJ1ueZ002506; Thu, 28 Jan 2010 14:01:56 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 28D243A814; Thu, 28 Jan 2010 14:01:55 -0500 (EST) From: Stefan Monnier To: Kenichi Handa Subject: Re: bug#4209: 23.1; Emacs 23.1 regression in re-search-forward Message-ID: References: <87ljfkha9i.fsf@stupidchicken.com> Date: Thu, 28 Jan 2010 14:01:55 -0500 In-Reply-To: (Kenichi Handa's message of "Thu, 28 Jan 2010 10:18:55 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3458=0 X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 4209 Cc: 4209@debbugs.gnu.org, cyd@stupidchicken.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.8 (-) > So, in emacs-unicode branch, I fixed the regex code so that > unibyte pattern can be directry used for multibyte buffer > search by doing unibyte->multibyte conversion on the fly. > And that code was merged to trunk. Hmm... that's too bad since the subsequent change to get rid of the dependency on locales made this change unnecessary. But given this, yes, the patch looks right, and no, I have no idea what the CHAR_BYTE8_P test was trying to do. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 29 01:15:38 2010 Received: (at 4209) by debbugs.gnu.org; 29 Jan 2010 06:15:38 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nak8o-0001E9-8Q for submit@debbugs.gnu.org; Fri, 29 Jan 2010 01:15:38 -0500 Received: from mx1.aist.go.jp ([150.29.246.133]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nak8l-0001Dx-Jy for 4209@debbugs.gnu.org; Fri, 29 Jan 2010 01:15:37 -0500 Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id o0T6FUQN018737; Fri, 29 Jan 2010 15:15:30 +0900 (JST) env-from (handa@m17n.org) Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id o0T6FTXf020796; Fri, 29 Jan 2010 15:15:29 +0900 (JST) env-from (handa@m17n.org) Received: by smtp4.aist.go.jp with ESMTP id o0T6FS8M021053; Fri, 29 Jan 2010 15:15:28 +0900 (JST) env-from (handa@m17n.org) Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1Nak8e-00039K-MZ; Fri, 29 Jan 2010 15:15:28 +0900 From: Kenichi Handa To: Stefan Monnier Subject: Re: bug#4209: 23.1; Emacs 23.1 regression in re-search-forward In-Reply-To: (message from Stefan Monnier on Thu, 28 Jan 2010 14:01:55 -0500) References: <87ljfkha9i.fsf@stupidchicken.com> Date: Fri, 29 Jan 2010 15:15:28 +0900 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 4209 Cc: 4209@debbugs.gnu.org, cyd@stupidchicken.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) In article , Stefan Monnier writes: > > So, in emacs-unicode branch, I fixed the regex code so that > > unibyte pattern can be directry used for multibyte buffer > > search by doing unibyte->multibyte conversion on the fly. > > And that code was merged to trunk. > Hmm... that's too bad since the subsequent change to get rid of the > dependency on locales made this change unnecessary. Yes. I'll put this in my todo list (but with lower priority). * avoid on-the-fly uni<->multi conversion in regex.c. > But given this, yes, the patch looks right, and no, I have no idea what > the CHAR_BYTE8_P test was trying to do. Ok, thank you for the confirmation. --- Kenichi Handa handa@m17n.org From unknown Tue Jun 17 20:12:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 26 Feb 2010 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator