Why does this not work the first time it's called?

Frank Fischer frank-fischer at shadow-soft.de
Sun Jan 27 19:46:52 CET 2013


On 2013-01-27, Guido Van Hoecke <guivho at gmail.com> wrote:
> I have a file that I want to visit, go to the second character of the
> fourth word, and enter replace mode:
>
> (defun guivho-test(name-of-file)
>   "Visit file, goto fourth word, second char and enter replace mode"
>   (interactive "fName of file: ")
>   (find-file name-of-file)
>   (beginning-of-line)
>   (evil-forward-WORD-begin 3)
>   (evil-forward-char)
>   (evil-replace-state))
>
> Test-file contents:
>
> line1 word1 word2 word3
> line2 word1 word2 word3
> line3 word1 word2 word3
> line4 word1 word2 word3
>
> I do not understand why the last the evil-forward-char and the
> evil-replace-state do not work when the file is not yet loaded, but do
> work if the guivho-test is executed from the buffer that already has the
> file. The first run leaves the cursor on the begin of the fourth word,
> ans it remains in normal mode; executing it again does advance the extra
> character and switches to replace mode.

I can't reproduce that, in all my tests everything works
as expected. Which evil version and Emacs version do you use? What
happens if you test with "make emacs" from evil's source? 

Best regards,
Frank




More information about the implementations-list mailing list