From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Word search Date: Mon, 10 Mar 2008 14:34:35 -0400 Message-ID: References: <87myp99rd3.fsf@jurta.org> <87od9n36ew.fsf@jurta.org> <87d4q25w95.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 1205174174 5989 80.91.229.12 (10 Mar 2008 18:36:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Mar 2008 18:36:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 10 19:36:39 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 1JYmqD-0001OE-3v for ged-emacs-devel@m.gmane.org; Mon, 10 Mar 2008 19:35:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYmpe-0000ip-OP for ged-emacs-devel@m.gmane.org; Mon, 10 Mar 2008 14:34:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYmpb-0000ik-CC for emacs-devel@gnu.org; Mon, 10 Mar 2008 14:34:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYmpY-0000iY-WD for emacs-devel@gnu.org; Mon, 10 Mar 2008 14:34:38 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYmpY-0000iV-PR for emacs-devel@gnu.org; Mon, 10 Mar 2008 14:34:36 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JYmpY-0005Co-Ms for emacs-devel@gnu.org; Mon, 10 Mar 2008 14:34:36 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhQHAIsc1UfO+JwVQWdsb2JhbACQdgEBAR4IEpk0gQc X-IronPort-AV: E=Sophos;i="4.25,475,1199682000"; d="scan'208";a="15802161" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 10 Mar 2008 14:34:35 -0400 Original-Received: from pastel.home ([206.248.156.21]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id QVS44835; Mon, 10 Mar 2008 14:34:35 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 39D65805A; Mon, 10 Mar 2008 14:34:35 -0400 (EDT) In-Reply-To: <87d4q25w95.fsf_-_@jurta.org> (Juri Linkov's message of "Mon, 10 Mar 2008 19:12:02 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:92082 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. Backward compatibility with old elisp packages is important. Backward compatibility with old Emacs users is a bit less important. >> 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. Using M-s as a prefix might be a good idea. What do others think? Stefan