You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 27, 2018. It is now read-only.
As far as I can tell giving iy-go-to-char a numeric argument n behaves as follows:
It always searches forward for the abs(n)-th occurence of the character. One might reasonably expect positive n to search forward and negative n to search backward.
Upon repetition, that either by retyping the character or by typing ;, it moves by one occurence. The move is forward if n>0 and backwards if n<0.
Possibly the most consistent behavior possible would be:
Both the first jumps and repetitions go forward by n occurences. Here "forward n occurences" means "backwards abs(n) occurences" when n is negative.
But I see the value of point 2 above: you might include a count for the first search but if that didn't get you where you wanted to go, you probably want to adjust by one occurence forwards or backwards. But point 1 definitely seems counter-intuitive to me: why always forward even if n is negative?
I suggest changing the behavior so that negative n means even the initial search is backwards. This has the advantage that then M-- M-x iy-go-to-char would be equivalent to M-x iy-go-to-char-backward (which would then become unnecessary, if you ask me).
While I suggest changing the behavior, there might be a good reason it was designed this way, which I'd be glad to know. Even with the current behavior I would say there is a documentation bug: the documentation currently correctly states that repetitions move by one occurence instead of moving by n occurences, but it does not mention the stuff about how negative n affects the direction of search in the repetitions.
The text was updated successfully, but these errors were encountered:
As far as I can tell giving
iy-go-to-char
a numeric argumentn
behaves as follows:abs(n)
-th occurence of the character. One might reasonably expect positiven
to search forward and negativen
to search backward.;
, it moves by one occurence. The move is forward ifn>0
and backwards ifn<0
.Possibly the most consistent behavior possible would be:
n
occurences. Here "forwardn
occurences" means "backwardsabs(n)
occurences" whenn
is negative.But I see the value of point 2 above: you might include a count for the first search but if that didn't get you where you wanted to go, you probably want to adjust by one occurence forwards or backwards. But point 1 definitely seems counter-intuitive to me: why always forward even if
n
is negative?I suggest changing the behavior so that negative
n
means even the initial search is backwards. This has the advantage that thenM-- M-x iy-go-to-char
would be equivalent toM-x iy-go-to-char-backward
(which would then become unnecessary, if you ask me).While I suggest changing the behavior, there might be a good reason it was designed this way, which I'd be glad to know. Even with the current behavior I would say there is a documentation bug: the documentation currently correctly states that repetitions move by one occurence instead of moving by
n
occurences, but it does not mention the stuff about how negativen
affects the direction of search in the repetitions.The text was updated successfully, but these errors were encountered: