<div>I can reproduce the problem now:</div><div><br></div><div>1. Hit "i" to enter Insert state and type something</div><div>2. Esc to exit insert</div><div>3. Hit "." and it will work fine</div><div>3. Hit "C-x b" to switch to other buffer</div>
<div>4. Hit "." in the new buffer and "switch-buffer" command will be repeated</div><div><br></div><div><br></div><div>York</div><div><br></div><div><br></div><div>On Thu, Aug 18, 2011 at 5:14 PM, York Zhao <<a href="mailto:gtdplatform@gmail.com">gtdplatform@gmail.com</a>> wrote:</div>
<div>Hi,</div><div><br></div><div>It had happened a few times today that dot command was not repeating the previous insertion, but rather some other command, e.g. it was repeating "switch-buffer" a minute ago, and currently is repeating the "C-h k ." command. Right now it is working properly again. I don't know how to reproduce this yet.</div>
<div><br></div><div>York</div><div><br></div><div><br></div><div>On Tue, Aug 16, 2011 at 11:45 AM, York Zhao <<a href="mailto:gtdplatform@gmail.com">gtdplatform@gmail.com</a>> wrote:</div><div>Hi Frank,</div><div><br>
</div><div>Thank you very much for this. I just did a few quick tests which appeared to be working perfectly fine. I'm using auto-complet a lot every day so I will report back problems if I will notice any but my feeling is that it is going to work. Thanks again for the wonderful works.</div>
<div><br></div><div><br></div><div>York</div><div><br></div><div><br></div><div>On Tue, Aug 16, 2011 at 5:59 AM, Frank Fischer <<a href="mailto:frank.fischer@mathematik.tu-chemnitz.de">frank.fischer@mathematik.tu-chemnitz.de</a>> wrote:</div>
<div>Am Montag, 15. August 2011 schrieb Frank Fischer:</div><div>> Am Mon, 15 Aug 2011 14:54:44 -0400</div><div>></div><div>> schrieb York Zhao <<a href="mailto:gtdplatform@gmail.com">gtdplatform@gmail.com</a>>:</div>
<div>> > Hi,</div><div>> ></div><div>> > I've been having this problem for a while and it is now my biggest</div><div>> > complain to Evil because other than Evil itself, "auto-complete" is</div>
<div>> > the next thing I can't be living without.</div><div>></div><div>> In fact, the change based repeation system (in contrast to the</div><div>> key-stroke based one, I described both in another mail and it will</div>
<div>> hopefully find its way in the docs) is designed exactly for these</div><div>> cases and I'm quite confident that this is indeed not a big problem.</div><div>> I just haven't activated it yet, but I'm going to have a look at it</div>
<div>> in the next days.</div><div><br></div><div>In turned out to be a little bit more difficult than a thought.</div><div>Activating the change-based repeation for auto-complete worked well</div><div>except in one case: when the completion is done near the end of the</div>
<div>buffer. The reason is that in this case auto-complete adds a few</div><div>newlines to the end of the buffer in order to show its popup-menu</div><div>(those newlines are removed when the popup closes). The problem is that</div>
<div>these insertions/deletions are, well, buffer-changes and therefore</div><div>confused the recording. Even worse, the popup menu is triggered by a</div><div>timer and not by a command, therefore there is no command active when</div>
<div>the first buffer changes appear and this confuses the system even more.</div><div><br></div><div>Luckily, Evil had already had the ability to execute arbitrary functions</div><div>to realize a repeation, there just was no way to specify such a</div>
<div>function for a command. I added this functionality in d15b75a5. The</div><div>following code should equip auto-complete with working repeation. I'm</div><div>going to cleanup the repeation code, especially the definition of</div>
<div>user-defined repeation functions, a little bit, so don't assume this as</div><div>a stable example but feel free to test and tell us about problems.</div><div><br></div><div><br></div><div>(evil-set-command-properties 'ac-complete :repeat 'evil-ac-repeat)</div>
<div>(evil-set-command-properties 'ac-expand :repeat 'evil-ac-repeat)</div><div>(evil-set-command-properties 'ac-next :repeat 'ignore)</div><div>(evil-set-command-properties 'ac-previous :repeat 'ignore)</div>
<div><br></div><div>(defvar evil-ac-prefix-len nil</div><div>�"The length of the prefix of the current item to be completed.")</div><div><br></div><div>(defun evil-ac-repeat (flag)</div><div>�"Record the changes for auto-completion."</div>
<div>�(if (eq flag 'pre)</div><div>� � �(setq evil-ac-prefix-len (length ac-prefix))</div><div>� �;; Add change to remove the prefix</div><div>� �(evil-repeat-record-change</div><div>� � (list (- evil-ac-prefix-len) "" evil-ac-prefix-len))</div>
<div>� �;; Add change to insert the full completed text</div><div>� �(evil-repeat-record-change</div><div>� � (list (- evil-ac-prefix-len)</div><div>� � � � � (buffer-substring-no-properties (- evil-repeat-pos</div><div>� � � � � � � � � � � � � � � � � � � � � � �evil-ac-prefix-len)</div>
<div>� � � � � � � � � � � � � � � � � � � � � (point))</div><div>� � � � � 0))</div><div>� �;; Finish repeation</div><div>� �(evil-repeat-record-change)))</div><div><br></div><div><br></div><div>Hope it works,</div><div>
Frank</div><div><br></div><div>_______________________________________________</div><div>implementations-list mailing list</div><div><a href="mailto:implementations-list@lists.ourproject.org">implementations-list@lists.ourproject.org</a></div>
<div><a href="https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list">https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list</a></div><div><br></div>