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: Mon, 14 Dec 2015 02:23:34 +0200 Organization: LINKOV.NET Message-ID: <87r3ipoofk.fsf@mail.linkov.net> References: <87wpsk7dcs.fsf@mail.linkov.net> <87d1ubz3w9.fsf@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1450053863 22854 80.91.229.3 (14 Dec 2015 00:44:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Dec 2015 00:44:23 +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 Mon Dec 14 01:44: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 1a8HFL-00079X-3X for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Dec 2015 01:44:11 +0100 Original-Received: from localhost ([::1]:57150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8HFK-0000yU-Ho for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Dec 2015 19:44:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8HFF-0000tZ-4v for bug-gnu-emacs@gnu.org; Sun, 13 Dec 2015 19:44:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8HFC-0001A2-JN for bug-gnu-emacs@gnu.org; Sun, 13 Dec 2015 19:44:04 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8HFC-00019y-Ge for bug-gnu-emacs@gnu.org; Sun, 13 Dec 2015 19:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1a8HFC-0004HN-CE for bug-gnu-emacs@gnu.org; Sun, 13 Dec 2015 19:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Dec 2015 00:44: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.145005381216385 (code B ref 22147); Mon, 14 Dec 2015 00:44:02 +0000 Original-Received: (at 22147) by debbugs.gnu.org; 14 Dec 2015 00:43:32 +0000 Original-Received: from localhost ([127.0.0.1]:50751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a8HEi-0004GC-Ja for submit@debbugs.gnu.org; Sun, 13 Dec 2015 19:43:32 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:37406 helo=homiemail-a18.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a8HEg-0004G4-KT for 22147@debbugs.gnu.org; Sun, 13 Dec 2015 19:43:31 -0500 Original-Received: from homiemail-a18.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTP id 7B97925006C; Sun, 13 Dec 2015 16:43:29 -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-a18.g.dreamhost.com (Postfix) with ESMTPA id 93500250069; Sun, 13 Dec 2015 16:43:28 -0800 (PST) In-Reply-To: (Artur Malabarba's message of "Sun, 13 Dec 2015 00:29:23 +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:109961 Archived-At: >> Thanks, setting search-default-regexp-mode to #'search-whitespace-regexp >> gives the same effect. >> >> One drawback is that then it removes char-fold search. > > 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. I often paste multi-line texts into the search string and need to ignore differences in newlines usually caused by text re-filling. What the mentioned regexp function does is replacing all whitespace in the search string with the regexp that matches whitespace (also it's possible to replace whitespace with a space character and then use search-spaces-regexp to match this space character using the regexp in search-whitespace-regexp). By analogy with char-folding, this means symmetric whitespace folding. When char-fold-symmetric causes all members of a folding equivalence class to be treated equivalently, lax-whitespace-symmetric could treat only whitespace character equivalently. >> Do you have a plan to combine lax-whitespace search with char-fold search? > > Char-folding is perfectly compatible with the regular lax-whitespace. Could char-folding already do the described above (maybe simpler would be to normalize the search string by turning all whitespace into space characters), or better first implement char-fold-symmetric and then use it for whitespace characters?