From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: isearch-query-replace-regexp and stuff Date: Wed, 07 Jul 2004 08:08:36 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87eknoifmv.fsf@mail.jurta.org> References: <877jth4e9u.fsf@mail.jurta.org> <87zn6dqei0.fsf@mail.jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1089177133 19283 80.91.224.253 (7 Jul 2004 05:12:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 7 Jul 2004 05:12:13 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Jul 07 07:12:04 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bi4iy-0007I2-00 for ; Wed, 07 Jul 2004 07:12:04 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bi4iy-0001NF-00 for ; Wed, 07 Jul 2004 07:12:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bi4l1-0008T1-OO for emacs-devel@quimby.gnus.org; Wed, 07 Jul 2004 01:14:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bi4kx-0008Ro-FZ for emacs-devel@gnu.org; Wed, 07 Jul 2004 01:14:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bi4kw-0008RM-Jr for emacs-devel@gnu.org; Wed, 07 Jul 2004 01:14:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bi4kw-0008RJ-H5 for emacs-devel@gnu.org; Wed, 07 Jul 2004 01:14:06 -0400 Original-Received: from [66.33.219.19] (helo=spoon.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Bi4iI-0004o6-82; Wed, 07 Jul 2004 01:11:22 -0400 Original-Received: from mail.jurta.org (80-235-33-124-dsl.mus.estpak.ee [80.235.33.124]) by spoon.dreamhost.com (Postfix) with ESMTP id 45E1B13D832; Tue, 6 Jul 2004 22:11:19 -0700 (PDT) Original-To: David Kastrup In-Reply-To: (David Kastrup's message of "06 Jul 2004 19:29:17 +0200") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) 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: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25515 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25515 David Kastrup writes: > C-M-s is quite hard to type, and if someone still decided to type it, > this means only that it was typed with the intention to start a > regexp search. Exactly! The current behavior of C-M-s to repeat the non-regexp search is not the most reasonable one. More correct would be to switch the search to regexp mode before doing the search again. I guess it works now that way because it was simpler to implement and nobody cared about handling this case specially. But we could change the behavior of C-M-s in non-regexp mode to switch to regexp mode for consistency with C-M-%. > Well, my proposal would not have "failed" in the display after the > switch, so it would be natural not to have the flag set, either. The > question is just whether one should change the display to "pending" > to indicate this change, or simply don't mention this somewhat > peculiar state at all. While looking at isearch.el I noticed that `isearch-toggle-case-fold' already sets the `isearch-adjusted' flag. It seems the purpose of this variable exactly fits into your proposal. We could set it in `isearch-toggle-regexp' and display "pending" in the echo area. That way both `isearch-toggle-regexp' and `isearch-toggle-case-fold' will be equivalent w.r.t. treating of inconsistent state after switching between case or regexp modes. Index: lisp/isearch.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v retrieving revision 1.230 diff -u -r1.230 isearch.el --- lisp/isearch.el 1 Jul 2004 09:54:51 -0000 1.230 +++ lisp/isearch.el 7 Jul 2004 03:33:21 -0000 @@ -1043,6 +1043,7 @@ (interactive) (setq isearch-regexp (not isearch-regexp)) (if isearch-regexp (setq isearch-word nil)) + (setq isearch-success t isearch-adjusted t) (isearch-update)) (defun isearch-toggle-case-fold () @@ -1055,33 +1056,27 @@ (isearch-message-prefix nil nil isearch-nonincremental) isearch-message (if isearch-case-fold-search "in" ""))) - (setq isearch-adjusted t) + (setq isearch-success t isearch-adjusted t) (sit-for 1) (isearch-update)) @@ -1841,6 +1836,7 @@ ;; If currently failing, display no ellipsis. (or isearch-success (setq ellipsis nil)) (let ((m (concat (if isearch-success "" "failing ") + (if isearch-adjusted "pending " "") (if (and isearch-wrapped (if isearch-forward (> (point) isearch-opoint) -- Juri Linkov http://www.jurta.org/emacs/