From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.bugs Subject: bug#22147: Obsolete search-forward-lax-whitespace Date: Mon, 14 Dec 2015 01:11:59 +0000 Message-ID: References: <87wpsk7dcs.fsf@mail.linkov.net> <87d1ubz3w9.fsf@mail.linkov.net> <87r3ipoofk.fsf@mail.linkov.net> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11406bce2d3d9c0526d15c32 X-Trace: ger.gmane.org 1450055602 13710 80.91.229.3 (14 Dec 2015 01:13:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Dec 2015 01:13:22 +0000 (UTC) Cc: 22147@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 14 02:13:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1a8HhR-00049H-5s for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Dec 2015 02:13:13 +0100 Original-Received: from localhost ([::1]:57237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8HhQ-0005MR-DV for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Dec 2015 20:13:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8HhL-0005Lv-Gv for bug-gnu-emacs@gnu.org; Sun, 13 Dec 2015 20:13:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8HhG-0007Sa-JE for bug-gnu-emacs@gnu.org; Sun, 13 Dec 2015 20:13:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8HhG-0007SW-EM for bug-gnu-emacs@gnu.org; Sun, 13 Dec 2015 20:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1a8HhG-0004w3-9p for bug-gnu-emacs@gnu.org; Sun, 13 Dec 2015 20:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Artur Malabarba Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Dec 2015 01:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22147 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22147-submit@debbugs.gnu.org id=B22147.145005552818903 (code B ref 22147); Mon, 14 Dec 2015 01:13:02 +0000 Original-Received: (at 22147) by debbugs.gnu.org; 14 Dec 2015 01:12:08 +0000 Original-Received: from localhost ([127.0.0.1]:50770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a8HgO-0004up-23 for submit@debbugs.gnu.org; Sun, 13 Dec 2015 20:12:08 -0500 Original-Received: from mail-lf0-f46.google.com ([209.85.215.46]:33811) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a8HgM-0004uI-22 for 22147@debbugs.gnu.org; Sun, 13 Dec 2015 20:12:06 -0500 Original-Received: by lfcy184 with SMTP id y184so36884981lfc.1 for <22147@debbugs.gnu.org>; Sun, 13 Dec 2015 17:12:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=s98PIj3gFxLFm5Y+9guXs+X0HZP2UiQMxhY/beD692U=; b=ZEz50YDdsve8DXeqWtTduf887BbKcJ97zAVrXFSLWKmYdkJVAd/sUbsuntPNq9VJgY F9MhX2q53Ra9Z+cvTxQtqVden2EJ1xogtCvHUULw6DjvoBEWL0Z2Hjm/U5mI7efZD9At yqtY0VctzEv++C6hsN4LA6Np/NfJ/D9KmlEBALq74tmfAzwHsom8kAC98eidYOsQDm0R SvFigWDKNHOhPMO2SmfX4c6eTnQ7YGdBVYnhSBl7YZ/Ad2URRzibt7HBQQcu+WmBJ+E/ BigV8JkF5uqvVIMX2GtiBmybuu3lSEcWlhfP2Q3PqNFIG1LnsgP6ZjoeCTg8KGogS0/b JVnQ== X-Received: by 10.25.23.201 with SMTP id 70mr2528798lfx.164.1450055520039; Sun, 13 Dec 2015 17:12:00 -0800 (PST) Original-Received: by 10.112.202.99 with HTTP; Sun, 13 Dec 2015 17:11:59 -0800 (PST) Original-Received: by 10.112.202.99 with HTTP; Sun, 13 Dec 2015 17:11:59 -0800 (PST) In-Reply-To: <87r3ipoofk.fsf@mail.linkov.net> X-Google-Sender-Auth: _hx5HgkCYouqliQt5tknr_ZpNAk X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:109962 Archived-At: --001a11406bce2d3d9c0526d15c32 Content-Type: text/plain; charset=UTF-8 On 14 Dec 2015 12:23 am, "Juri Linkov" wrote: > > > > True. I think it might also be possible to get what you want by just > > setting the search-whitespace-regexp variable to "[ \t\r\n]+". That would > > have the advantage of not removing char folding (and would reduce > > everything to one line). > > This still doesn't allow ^J in the search string to match a newline. Right. I always get confused about that variable. > (maybe simpler > would be to normalize the search string by turning all whitespace > into space characters), Yes, I think this should give you the behaviour you're looking for. Try setting search-default-regexp-function to #'my-lax-with-char-fold, where (defun my-lax-with-char-fold (s &optional l) (character-fold-to-regexp (replace-regexp-in-string "\t\n\r\s+" " " s) l)) And then also set search-whitespace-regexp like above. --001a11406bce2d3d9c0526d15c32 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 14 Dec 2015 12:23 am, "Juri Linkov" <juri@linkov.net> wrote:
> >
> > True. I think it might also be possible to get what you want by j= ust
> > setting the search-whitespace-regexp variable to "[ \t\r\n]+= ". That would
> > have the advantage of not removing char folding (and would reduce=
> > everything to one line).
>
> This still doesn't allow ^J in the search string to match a newlin= e.

Right. I always get confused about that variable.

> (maybe simpler
> would be to normalize the search string by turning all whitespace
> into space characters),

Yes, I think this should give you the behaviour you're l= ooking for.
Try setting search-default-regexp-function to #'my-lax-with-char-fold, = where

(defun my-lax-with-char-fold (s &optional l)
=C2=A0 (character-fold-to-regexp (replace-regexp-in-string "\t\n\r\s+&= quot; " " s) l))

And then also set search-whitespace-regexp like above.

--001a11406bce2d3d9c0526d15c32--