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#13480: 24.3.50; `C-w' from Isearch should translate newlines to spaces Date: Sat, 19 Jan 2013 11:59:22 +0200 Organization: JURTA Message-ID: <87bocl7av5.fsf@mail.jurta.org> References: <87r4ljh54a.fsf@mail.jurta.org> <87wqva2lvg.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1358589736 26409 80.91.229.3 (19 Jan 2013 10:02:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Jan 2013 10:02:16 +0000 (UTC) Cc: 13480@debbugs.gnu.org To: Dani Moncayo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 19 11:02:34 2013 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 1TwVFx-0000Qo-Hj for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Jan 2013 11:02:33 +0100 Original-Received: from localhost ([::1]:36972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwVFg-0003uB-Nj for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Jan 2013 05:02:16 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:48682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwVFc-0003tq-3V for bug-gnu-emacs@gnu.org; Sat, 19 Jan 2013 05:02:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TwVFa-0004aY-S8 for bug-gnu-emacs@gnu.org; Sat, 19 Jan 2013 05:02:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwVFa-0004aU-OX for bug-gnu-emacs@gnu.org; Sat, 19 Jan 2013 05:02:10 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TwVGP-0008LW-Rk for bug-gnu-emacs@gnu.org; Sat, 19 Jan 2013 05:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Jan 2013 10:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13480 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13480-submit@debbugs.gnu.org id=B13480.135858975932050 (code B ref 13480); Sat, 19 Jan 2013 10:03:01 +0000 Original-Received: (at 13480) by debbugs.gnu.org; 19 Jan 2013 10:02:39 +0000 Original-Received: from localhost ([127.0.0.1]:39551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TwVG2-0008Kt-2j for submit@debbugs.gnu.org; Sat, 19 Jan 2013 05:02:38 -0500 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:35890 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TwVFz-0008Kj-0z for 13480@debbugs.gnu.org; Sat, 19 Jan 2013 05:02:36 -0500 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id B459526F9E64AC; Sat, 19 Jan 2013 02:01:41 -0800 (PST) In-Reply-To: (Dani Moncayo's message of "Sat, 19 Jan 2013 09:05:19 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.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:70021 Archived-At: > 1. It loses information that may be useful. In the future we could > want to implement a feature whereby the user can toggle the > lax-whitespace-matching behavior during an Isearch session. In fact I > think it would be a good feature (and ISTR that Drew proposed some > time ago). We already have this feature with `M-SPC'. > That feature would not be possible if we change the text > that the user supplies to search for. Yes, there is no way to restore the original text in the search string and to un-translate a space back to the newline. > 2. It is less surprising and more clean to me to see in the echo area > exactly the text I'm supplying, without translations of any kind. Then this is possible to not translate newlines to a space in the search string but process it internally with this code: (defun search-whitespace-regexp (string) "Return a regexp which ignores whitespace. Uses the value of the variable `search-whitespace-regexp'." (if (or (not (stringp search-whitespace-regexp)) (null (if isearch-regexp isearch-regexp-lax-whitespace isearch-lax-whitespace))) string ;; FIXME: this is not strictly correct implementation because it ignores ;; `subregexp-context-p' and replaces spaces inside char set group like ;; in `C-M-s M-s SPC [ ]', it converts it to ["\\(\\s-\\|\n\\)+"] ! (replace-regexp-in-string search-whitespace-regexp ;; " " search-whitespace-regexp string nil t))) (defun search-forward-lax-whitespace (string &optional bound noerror count) (re-search-forward (search-whitespace-regexp (regexp-quote string)) bound noerror count)) (defun search-backward-lax-whitespace (string &optional bound noerror count) (re-search-backward (search-whitespace-regexp (regexp-quote string)) bound noerror count)) (defun re-search-forward-lax-whitespace (regexp &optional bound noerror count) (re-search-forward (search-whitespace-regexp regexp) bound noerror count)) (defun re-search-backward-lax-whitespace (regexp &optional bound noerror count) (re-search-backward (search-whitespace-regexp regexp) bound noerror count))