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

Guido Van Hoecke guivho at gmail.com
Mon Jan 28 08:53:34 CET 2013


Hi Frank,

On 27 January 2013 19:46, Frank Fischer <frank-fischer at shadow-soft.de> wrote:
> 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


$ emacs-version
GNU Emacs 24.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
 of 2012-08-27 on bob.porkrind.org

$ evil-version
Evil version 0.1

> happens if you test with "make emacs" from evil's source?

I just pulled in the current source and the behaviour is not changed:
works the second time (from the file's buffer), not the first time

Let me use this opportunity to praise evil. This is a terrific
implementation of the vim paradigm and truly unites the best of the two
best editors in the world. I particularly admire the seamless
integration, it is indeed way better than any previous vi emulations
I've been through before.


Kind regards,



Guido

(P.S. Sorry about the org-version mixup in my previous reply)

--
They are cold-blooded. They are completely ruthless about protecting
what they have. The only thing they connect to is the money aspect of
life.  Let's face it: That's the American way.
		-- Jeffery M. Johnson, regional chairman of the District
		   of Columbia United Way, speaking of drug dealers.

http://vanhoecke.org ... and go2 places!



More information about the implementations-list mailing list