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: Tue, 15 Dec 2015 10:15:56 +0000 Message-ID: References: <87wpsk7dcs.fsf@mail.linkov.net> <87d1ubz3w9.fsf@mail.linkov.net> <87r3ipoofk.fsf@mail.linkov.net> <87zixcblno.fsf@mail.linkov.net> Reply-To: bruce.connor.am@gmail.com 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 1450174645 25019 80.91.229.3 (15 Dec 2015 10:17:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Dec 2015 10:17:25 +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 Tue Dec 15 11:17:16 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 1a8mfT-00062N-5i for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Dec 2015 11:17:15 +0100 Original-Received: from localhost ([::1]:36033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8mfS-0001dp-IU for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Dec 2015 05:17:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8mfK-0001cq-Gd for bug-gnu-emacs@gnu.org; Tue, 15 Dec 2015 05:17:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8mfG-0001AG-9c for bug-gnu-emacs@gnu.org; Tue, 15 Dec 2015 05:17:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44613) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8mfG-0001A6-60 for bug-gnu-emacs@gnu.org; Tue, 15 Dec 2015 05:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1a8mfF-0005Gr-KW for bug-gnu-emacs@gnu.org; Tue, 15 Dec 2015 05:17:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Artur Malabarba Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Dec 2015 10:17: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.145017456420166 (code B ref 22147); Tue, 15 Dec 2015 10:17:01 +0000 Original-Received: (at 22147) by debbugs.gnu.org; 15 Dec 2015 10:16:04 +0000 Original-Received: from localhost ([127.0.0.1]:52215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a8meK-0005FB-J1 for submit@debbugs.gnu.org; Tue, 15 Dec 2015 05:16:04 -0500 Original-Received: from mail-lb0-f169.google.com ([209.85.217.169]:34965) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a8meI-0005EP-Hq for 22147@debbugs.gnu.org; Tue, 15 Dec 2015 05:16:03 -0500 Original-Received: by mail-lb0-f169.google.com with SMTP id u9so2517525lbp.2 for <22147@debbugs.gnu.org>; Tue, 15 Dec 2015 02:16:02 -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:content-transfer-encoding; bh=jPwqd+preRZXrWxGo2Mo28HmBku6yjFze8j6BVER1J0=; b=XpYO2pJKAuuoZVkVgxo89liqb0hoy98F195AKiJ+/7hpCrMe7tRnzZDXE7QYUqBXZJ QmBfGQEp9raQaGcj0k+qnZZhaI4Fpk9p9Sgca8XOPRckox9l4fgdnHRy2Okk+OGKyRdi fuDZdsrfdA4mXCqg8MBd8+Par98Ty8Ho4cuJRqk7xTwh3Fexhu30NsfuDPrE6plyMB8+ GeCpUokLSCSoXYhdJTG9sNeG1pVf7SZw+hpTci+2UXHFc3yYtwAVeeVQo9vgVtnMwhO6 EIYc0ORmMxcUsxoa3vVcK28xfC9SKbw+GheXr0WBsIpmx9lqRwjMfiFph71FDQQJtat5 1lNA== X-Received: by 10.112.168.133 with SMTP id zw5mr15244974lbb.95.1450174556735; Tue, 15 Dec 2015 02:15:56 -0800 (PST) Original-Received: by 10.112.202.99 with HTTP; Tue, 15 Dec 2015 02:15:56 -0800 (PST) In-Reply-To: <87zixcblno.fsf@mail.linkov.net> X-Google-Sender-Auth: x71ecHuSJr30qhsKUFPN1jcOLjA 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:110011 Archived-At: 2015-12-14 23:58 GMT+00:00 Juri Linkov : >>> (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 ;-) Like I said on the devel thread, not sure about this. The only reason I got this wrong on all the above messages is that I wrote every single one of them from my phone. :-) >> 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. I don't know what you mean. IIUC, the current framework already supports a "normalizing mode", which is what we just did here, isn't it?