From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Interpretation of a space in regexp isearch? Date: Wed, 29 Aug 2012 11:28:51 +0300 Organization: JURTA Message-ID: <87txvm9jv8.fsf@mail.jurta.org> References: <502B2845.9070200@yandex.ru> <878vdgiv2d.fsf@gnu.org> <87r4qu8ffq.fsf@gnu.org> <87haro6v5y.fsf@gnu.org> <87k3wjto4o.fsf@mail.jurta.org> <874nnmry9v.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1346229574 16556 80.91.229.3 (29 Aug 2012 08:39:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Aug 2012 08:39:34 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 29 10:39:35 2012 Return-path: Envelope-to: ged-emacs-devel@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 1T6doE-0007ya-ET for ged-emacs-devel@m.gmane.org; Wed, 29 Aug 2012 10:39:34 +0200 Original-Received: from localhost ([::1]:43836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6doC-0003dG-6W for ged-emacs-devel@m.gmane.org; Wed, 29 Aug 2012 04:39:32 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6do9-0003cZ-7g for emacs-devel@gnu.org; Wed, 29 Aug 2012 04:39:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6do3-0001i6-Jk for emacs-devel@gnu.org; Wed, 29 Aug 2012 04:39:29 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:59035 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6dnx-0001gT-8q; Wed, 29 Aug 2012 04:39:17 -0400 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 4E97E451CC2A; Wed, 29 Aug 2012 01:39:15 -0700 (PDT) In-Reply-To: <874nnmry9v.fsf@gnu.org> (Chong Yidong's message of "Wed, 29 Aug 2012 14:46:20 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 69.163.218.105 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152887 Archived-At: >>> The magic of `C-q SPC' is missing for non-regexp searches though. >> >> `C-q SPC' inserts "[ ]" in regexp search. The problem for non-regexp >> search is how to avoid quoting "[ ]" in `regexp-quote'. > > Good point. Here's how to handle this: when isearch-regexp is nil, make > isearch-process-search-string call regexp-quote for each addition to the > search string; then have isearch-quote-char suppress quoting by passing > an optional arg to isearch-process-search-string. > > Then in isearch-search-fun-default, we can use re-search-forward for > plain isearch as well, since the search string will have been > appropriately quoted when processed. See attached patch. Unfortunately, this will expose the regexp used in non-regexp search in such cases as editing the search string with M-e or repeating the previous search from the search ring. All special regexp characters will be displayed as quoted with \. This will mean that there is no more plain non-regexp search from the user's point of view.