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: Word search (was: First two elements of search-ring shown twice in minibuffer when using M-p multiple times?) Date: Mon, 10 Mar 2008 19:12:02 +0200 Organization: JURTA Message-ID: <87d4q25w95.fsf_-_@jurta.org> References: <87myp99rd3.fsf@jurta.org> <87od9n36ew.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205170253 22998 80.91.229.12 (10 Mar 2008 17:30:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Mar 2008 17:30:53 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 10 18:31:21 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JYlqA-0000aK-Vt for ged-emacs-devel@m.gmane.org; Mon, 10 Mar 2008 18:31:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYlpc-000147-Ly for ged-emacs-devel@m.gmane.org; Mon, 10 Mar 2008 13:30:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYloJ-0000F6-EC for emacs-devel@gnu.org; Mon, 10 Mar 2008 13:29:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYloF-0000Ck-FK for emacs-devel@gnu.org; Mon, 10 Mar 2008 13:29:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYloF-0000CY-6p for emacs-devel@gnu.org; Mon, 10 Mar 2008 13:29:11 -0400 Original-Received: from relay02.kiev.sovam.com ([62.64.120.197]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JYloE-0005lO-NK for emacs-devel@gnu.org; Mon, 10 Mar 2008 13:29:11 -0400 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay02.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1JYlo4-000GMu-KO; Mon, 10 Mar 2008 19:29:08 +0200 In-Reply-To: (Stefan Monnier's message of "Mon, 10 Mar 2008 10:31:38 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-unknown-linux-gnu) X-Scanner-Signature: 669e5d776fa0e81a52da9f410dfff76f X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2374 [Mar 9 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 11 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release X-detected-kernel: by monty-python.gnu.org: FreeBSD 6.x (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:92074 Archived-At: >> It also gets rid of all trickery used to read the first character >> typed in the minibuffer (that removes another set of problems; >> see related old bug reports). It adds a new backward-compatible >> command `isearch-edit-string-set-word' bound to C-w in the minibuffer >> that calls `kill-region' when the mark is active, and otherwise does >> word search after exiting `isearch-edit-string' (the mark is not active >> when `isearch-edit-string' just created the minibuffer, and without >> the mark `kill-region' would fail anyway). > >> This preserves the behavior described in the Emacs manual: > >> `C-s C-w WORDS ' >> Search for WORDS, ignoring details of punctuation. > > This seems unrelated, right? This is slightly related, but now I see it can be installed with a separate patch. > It looks like a good change. But I wonder why we don't use an approach > similar to the M-r binding to isearch-toggle-regexp. Keeping C-w to specify word search in the minibuffer is necessary for backward compatibility. When we find a better method to toggle word search, we could remove the description of the old method from the manual, and remove its code in later releases. > Of course, we'd rather not eat yet-another key (e.g. bind M-w to > isearch-toggle-word), but maybe we could change isearch-toggle-regexp > into isearch-cycle-regexp-word, such that the command cycles between > plain/regexp/word searches. One disadvantage of M-r is that it's not mnemonic to toggle word search. OTOH, it is convenient to cycle between search types. We could also add another keybinding to separately toggle only word search `M-s w' and regexp search `M-s r'. Their key sequences are longer than `M-r' but they will allow specifying the exact search type. -- Juri Linkov http://www.jurta.org/emacs/