Skip to content
This repository has been archived by the owner on Dec 27, 2018. It is now read-only.

Numeric arguments behave unintuitively #3

Open
oantolin opened this issue Jun 22, 2014 · 0 comments
Open

Numeric arguments behave unintuitively #3

oantolin opened this issue Jun 22, 2014 · 0 comments
Labels

Comments

@oantolin
Copy link

As far as I can tell giving iy-go-to-char a numeric argument n behaves as follows:

  1. 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.
  2. 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.

@doitian doitian added the ready label Oct 27, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants