[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EXPERIMENTAL PATCH] Extending Isearch-repeat-forward/backward to su

From: Juri Linkov
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (x86_64-pc-linux-gnu)

> 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?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]