all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Vincent Lefevre <vincent@vinc17.net>
Cc: 58992@debbugs.gnu.org
Subject: bug#58992: 28.2; "lax space matching" no longer works
Date: Thu, 03 Nov 2022 19:04:31 +0200	[thread overview]
Message-ID: <83iljw6kbk.fsf@gnu.org> (raw)
In-Reply-To: <87tu3gasjn.fsf@zira.vinc17.org> (message from Vincent Lefevre on Thu, 03 Nov 2022 17:53:16 +0100)

> From: Vincent Lefevre <vincent@vinc17.net>
> 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.





  reply	other threads:[~2022-11-03 17:04 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03 16:53 bug#58992: 28.2; "lax space matching" no longer works Vincent Lefevre
2022-11-03 17:04 ` Eli Zaretskii [this message]
2022-11-03 17:21   ` Vincent Lefevre
2022-11-03 17:34     ` Vincent Lefevre
2022-11-03 18:05       ` Eli Zaretskii
2022-11-03 17:49     ` Gregory Heytings
2022-11-03 17:56       ` Vincent Lefevre
2022-11-03 18:02         ` Vincent Lefevre
2022-11-03 18:04           ` Gregory Heytings
2022-11-03 18:04           ` Vincent Lefevre
2022-11-03 18:11             ` Gregory Heytings
2022-11-03 18:18               ` Gregory Heytings
2022-11-03 18:28                 ` Vincent Lefevre
2022-11-03 18:39                   ` Eli Zaretskii
2022-11-03 18:43                   ` Gregory Heytings
2022-11-03 18:36                 ` Juri Linkov
2022-11-03 18:18               ` Eli Zaretskii
2022-11-03 18:02         ` Gregory Heytings
2022-11-03 18:03     ` Eli Zaretskii
2022-11-03 18:33       ` Vincent Lefevre
2022-11-03 18:42         ` Eli Zaretskii
2022-11-03 18:52           ` Vincent Lefevre
2022-11-03 19:22             ` Eli Zaretskii
2022-11-04  2:29               ` Vincent Lefevre
2022-11-04  3:38                 ` Vincent Lefevre
2022-11-04  7:25                   ` Eli Zaretskii
2022-11-04 10:46                     ` Vincent Lefevre
2022-11-04 11:50                       ` Eli Zaretskii
2022-11-04  7:14                 ` Eli Zaretskii
2022-11-04 10:41                   ` Vincent Lefevre
2022-11-04 10:56                     ` Vincent Lefevre
2022-11-04 11:52                       ` Eli Zaretskii
2022-11-04 13:04                         ` Vincent Lefevre
2022-11-04 13:40                           ` Eli Zaretskii
2022-11-04 11:48                     ` Eli Zaretskii
2022-11-04  3:30       ` Vincent Lefevre
2022-11-04  7:21         ` Eli Zaretskii
2022-11-04 10:15           ` Vincent Lefevre
2022-11-04 11:38             ` Andreas Schwab
2022-11-04 12:47               ` Vincent Lefevre
2022-11-04 13:25                 ` Andreas Schwab
2022-11-04 14:32                   ` Vincent Lefevre
2022-11-04 14:35                     ` Andreas Schwab
2022-11-04 15:02                       ` Vincent Lefevre
2022-11-04 15:24                         ` Andreas Schwab
2022-11-04 11:45             ` Eli Zaretskii
2022-11-04 13:56               ` Robert Pluim
2022-11-04 14:04                 ` Eli Zaretskii
2022-11-04 15:00                   ` Vincent Lefevre
2022-11-04 15:23                     ` Eli Zaretskii
2022-11-05  1:55                       ` Vincent Lefevre
2022-11-05  6:47                         ` Eli Zaretskii
2022-11-05 11:20                           ` Vincent Lefevre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83iljw6kbk.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=58992@debbugs.gnu.org \
    --cc=vincent@vinc17.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.