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: Thu, 17 Jan 2013 23:27:49 +0200 Organization: JURTA Message-ID: <87r4ljh54a.fsf@mail.jurta.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1358458229 27490 80.91.229.3 (17 Jan 2013 21:30:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Jan 2013 21:30:29 +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 Thu Jan 17 22:30:47 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 1Tvx2o-0008Ep-I7 for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Jan 2013 22:30:42 +0100 Original-Received: from localhost ([::1]:57575 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tvx2X-0000Ui-SX for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Jan 2013 16:30:25 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tvx2U-0000U8-Cq for bug-gnu-emacs@gnu.org; Thu, 17 Jan 2013 16:30:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tvx2T-0007mT-1R for bug-gnu-emacs@gnu.org; Thu, 17 Jan 2013 16:30:22 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tvx2S-0007mL-Tv for bug-gnu-emacs@gnu.org; Thu, 17 Jan 2013 16:30:20 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tvx37-0003tc-W6 for bug-gnu-emacs@gnu.org; Thu, 17 Jan 2013 16:31: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: Thu, 17 Jan 2013 21:31: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.135845824214950 (code B ref 13480); Thu, 17 Jan 2013 21:31:01 +0000 Original-Received: (at 13480) by debbugs.gnu.org; 17 Jan 2013 21:30:42 +0000 Original-Received: from localhost ([127.0.0.1]:37422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tvx2n-0003t5-EC for submit@debbugs.gnu.org; Thu, 17 Jan 2013 16:30:42 -0500 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:48196 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tvx2h-0003sp-Ag for 13480@debbugs.gnu.org; Thu, 17 Jan 2013 16:30:37 -0500 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 783DF201D40739; Thu, 17 Jan 2013 13:29:50 -0800 (PST) In-Reply-To: (Dani Moncayo's message of "Thu, 17 Jan 2013 21:39:29 +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:69945 Archived-At: > So I propose that the command `isearch-yank-word-or-char' (C-w in > Isearch) DTRT in this case, i.e., when `search-whitespace-regexp' is > non-nil, translate the into a simple space when pulling text > from the buffer into the search string. It makes sense to translate the into a simple space only when `search-whitespace-regexp' contains such as e.g. (setq search-whitespace-regexp "\\(\\s-\\|\n\\)+") Otherwise, the translated space won't match . It is possible to do this with the patch below. But then you might also want to translate the into a space in `isearch-yank-line' as well? And maybe also in `isearch-yank-kill'? === modified file 'lisp/isearch.el' --- lisp/isearch.el 2013-01-16 21:45:20 +0000 +++ lisp/isearch.el 2013-01-17 21:27:35 +0000 @@ -1837,7 +1837,14 @@ (defun isearch-yank-internal (jumpform) (save-excursion (and (not isearch-forward) isearch-other-end (goto-char isearch-other-end)) - (buffer-substring-no-properties (point) (funcall jumpform))))) + (if (if isearch-regexp + isearch-regexp-lax-whitespace + isearch-lax-whitespace) + (replace-regexp-in-string + search-whitespace-regexp + " " + (buffer-substring-no-properties (point) (funcall jumpform)) nil t) + (buffer-substring-no-properties (point) (funcall jumpform)))))) (defun isearch-yank-char-in-minibuffer (&optional arg) "Pull next character from buffer into end of search string in minibuffer."