From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#22147: Obsolete search-forward-lax-whitespace Date: Tue, 15 Dec 2015 01:58:11 +0200 Organization: LINKOV.NET Message-ID: <87zixcblno.fsf@mail.linkov.net> References: <87wpsk7dcs.fsf@mail.linkov.net> <87d1ubz3w9.fsf@mail.linkov.net> <87r3ipoofk.fsf@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1450139662 5491 80.91.229.3 (15 Dec 2015 00:34:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Dec 2015 00:34:22 +0000 (UTC) Cc: 22147@debbugs.gnu.org To: Artur Malabarba Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 15 01:34:11 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 1a8dZC-0000Y7-A0 for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Dec 2015 01:34:10 +0100 Original-Received: from localhost ([::1]:34457 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8dZB-0003dS-D5 for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Dec 2015 19:34:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8dZ6-0003as-Bt for bug-gnu-emacs@gnu.org; Mon, 14 Dec 2015 19:34:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8dZ4-00077d-7h for bug-gnu-emacs@gnu.org; Mon, 14 Dec 2015 19:34:04 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8dZ4-00077J-57 for bug-gnu-emacs@gnu.org; Mon, 14 Dec 2015 19:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1a8dZ3-0000OT-P0 for bug-gnu-emacs@gnu.org; Mon, 14 Dec 2015 19:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Dec 2015 00:34:01 +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.14501396401505 (code B ref 22147); Tue, 15 Dec 2015 00:34:01 +0000 Original-Received: (at 22147) by debbugs.gnu.org; 15 Dec 2015 00:34:00 +0000 Original-Received: from localhost ([127.0.0.1]:52020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a8dZ2-0000OD-8p for submit@debbugs.gnu.org; Mon, 14 Dec 2015 19:34:00 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:38467 helo=homiemail-a100.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a8dYz-0000O5-TB for 22147@debbugs.gnu.org; Mon, 14 Dec 2015 19:33:58 -0500 Original-Received: from homiemail-a100.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTP id D98EC31A070; Mon, 14 Dec 2015 16:33:56 -0800 (PST) Original-Received: from localhost.linkov.net (m83-180-31-224.cust.tele2.ee [83.180.31.224]) (Authenticated sender: jurta@jurta.org) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTPA id ECB9E31A061; Mon, 14 Dec 2015 16:33:55 -0800 (PST) In-Reply-To: (Artur Malabarba's message of "Mon, 14 Dec 2015 01:11:59 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu) 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:109999 Archived-At: >> (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, search-default-regexp-mode definitely needs to be renamed to search-default-regexp-function ;-) > 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. Thanks for the suggestion. Since it works, then maybe better generalize it to allow a mode that supports normalization of the search string, that also will do symmetric char-folding, where e.g. searching for =E2=80=9C=C3=A4=E2=80=9D will match =E2=80=9Ca=E2= =80=9D, etc.