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: [EXPERIMENTAL PATCH] Extending Isearch-repeat-forward/backward to support a prefix argument following suggesion by Juri Linkov Date: Mon, 30 Jan 2012 02:38:51 +0200 Organization: JURTA Message-ID: <87r4yiav0w.fsf@mail.jurta.org> References: <87pqe5x6ju.fsf@mail.jurta.org> <87ty3h2uvp.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1327884340 25257 80.91.229.3 (30 Jan 2012 00:45:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 30 Jan 2012 00:45:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: Gideon Stupp Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 30 01:45:40 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RrfNL-00046A-4y for ged-emacs-devel@m.gmane.org; Mon, 30 Jan 2012 01:45:39 +0100 Original-Received: from localhost ([::1]:53100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrfNJ-00081i-Qk for ged-emacs-devel@m.gmane.org; Sun, 29 Jan 2012 19:45:37 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:36415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrfNH-00081C-2e for emacs-devel@gnu.org; Sun, 29 Jan 2012 19:45:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RrfNG-0000mk-4l for emacs-devel@gnu.org; Sun, 29 Jan 2012 19:45:35 -0500 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:56139 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrfNG-0000mc-0S for emacs-devel@gnu.org; Sun, 29 Jan 2012 19:45:34 -0500 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 6AB2A451C7FF; Sun, 29 Jan 2012 16:44:24 -0800 (PST) In-Reply-To: (Gideon Stupp's message of "Sun, 29 Jan 2012 18:11:43 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (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:148026 Archived-At: > I am attaching a short patch which implements prefix arg support for > 'isearch-repeat-forward' and 'isearch-repeat-backward'. It does not contain > any visual hints or even hooks for visual support because it seems > worthwhile to test this functionality for a while before adding anything > "fancy" as you say. Negative arguments are supported in what seems to me a > reasonable way, though clearly not ideal for regex searches as point out. > > Please let me know if you think any more changes are required. It's not yet clear what is the most expected behavior. With your patch, typing `C-s a C-3 C-s C- C-3 C-s' returns the isearch point to the original position - this is good, thanks. But its behavior is not deterministic: it depends on the current search direction before calling these commands with a numeric argument. So e.g. `C-s a C-3 C-s C-r C- C-3 C-s' (where `C-r' just switches the search direction) doesn't return it to the original position. Perhaps you need to check the current direction defined in the variable `isearch-forward' and take it into account. Another question is why e.g. `C-s a C-3 C-s C-3 C-r' doesn't handle switching of search direction and does not return to the original position? In terms of implementation, the question is: why in `isearch-repeat-forward' and `isearch-repeat-backward' you don't add code that switches the current direction to the `(> arg 0)' code branch?