From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58992: 28.2; "lax space matching" no longer works Date: Thu, 03 Nov 2022 19:04:31 +0200 Message-ID: <83iljw6kbk.fsf@gnu.org> References: <87tu3gasjn.fsf@zira.vinc17.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37910"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58992@debbugs.gnu.org To: Vincent Lefevre Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 03 18:05:38 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqdes-0009b2-7E for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Nov 2022 18:05:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqdeN-0003FP-QX; Thu, 03 Nov 2022 13:05:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqdeJ-0002zj-CW for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 13:05:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqdeH-0007oL-Uh for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 13:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqdeH-0006fW-O5 for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 13:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Nov 2022 17:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58992 X-GNU-PR-Package: emacs Original-Received: via spool by 58992-submit@debbugs.gnu.org id=B58992.166749508825612 (code B ref 58992); Thu, 03 Nov 2022 17:05:01 +0000 Original-Received: (at 58992) by debbugs.gnu.org; 3 Nov 2022 17:04:48 +0000 Original-Received: from localhost ([127.0.0.1]:50266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqde4-0006f1-5u for submit@debbugs.gnu.org; Thu, 03 Nov 2022 13:04:48 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqde0-0006el-P0 for 58992@debbugs.gnu.org; Thu, 03 Nov 2022 13:04:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqddv-0007lV-3q; Thu, 03 Nov 2022 13:04:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=uJgvfelEzpaUG/460+UwyCAPLBYV1REY7wG/Kzv3viw=; b=T3PAa35XAggOEa1pVdg6 fQ/vNmcKweXLOjHrVRwRpeq0c8zlNm8+2Lh9YLED3u1pFIkanxV0kK70o2/eFOgTLu5vt41Idbq2J Z6jq2DiHtVk9/QNYVQaoER+HQ2cQXRXuz2LToLsZWjLKNQuKj+1aG5aJCSc6aJtTsuArI8an8aKG+ qNBkoPpDTCx0QPovLbTcF69WIvCnZGHohbUkIOnBy4tpgnJyhJ3XciTtcceVBfeuNUBVsRzUZpr45 4Op89HasZfNn0rtJ8QMi3DhPt8d2aYnuMiZFMBuXWWYrWxOWntZbd10EpuEf/5ZG6RNd0XPvPilV8 R6mxWXUyvDo6zQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqddu-0001tE-Ft; Thu, 03 Nov 2022 13:04:38 -0400 In-Reply-To: <87tu3gasjn.fsf@zira.vinc17.org> (message from Vincent Lefevre on Thu, 03 Nov 2022 17:53:16 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246988 Archived-At: > From: Vincent Lefevre > Date: Thu, 03 Nov 2022 17:53:16 +0100 > > > The Emacs manual says: > > 15.9 Lax Matching During Searching > ================================== > [...] > By default, search commands perform “lax space matching”: each space, > or sequence of spaces, matches any sequence of one or more whitespace > characters in the text. (Incremental regexp search has a separate > default; see *note Regexp Search::.) Hence, ‘foo bar’ matches > ‘foo bar’, ‘foo bar’, ‘foo bar’, and so on (but not ‘foobar’). More > [...] > > This is working with GNU Emacs 27, but not with GNU Emacs 28.2 > (tested under Debian/unstable). If it works for you by default in Emacs 27, then you either didn't test with "emacs -Q" there or your Emacs 27 is customized wrt the upstream. For me, Emacs 26, Emacs 27, and all the later versions behave the same. > To reproduce with emacs -Q, consider a file with > > ab > cd > ab cd > > and search for "b c" with > > C-s b c > > Only the one in the 3rd line is found. Yes. Because the default value of search-whitespace-regexp is "[ \t]+". And the Emacs manual which comes with Emacs 28 says: By default, search commands perform “lax space matching”: each space, or sequence of spaces, matches any sequence of one or more whitespace characters in the text. (Incremental regexp search has a separate default; see *note Regexp Search::.) Hence, ‘foo bar’ matches ‘foo bar’, ‘foo bar’, ‘foo bar’, and so on (but not ‘foobar’). More precisely, Emacs matches each sequence of space characters in the search string to a regular expression specified by the variable ‘search-whitespace-regexp’. For example, to make spaces match sequences of newlines as well as spaces, set it to the regular expression ‘[[:space:]\n]+’. The default value of this variable considers any sequence of spaces and tab characters as whitespace. So I see no bug here.