Hi! So I have an implementation of RFC1345 digraphs that I’ve been using with viper/vimpulse. I would like to donate it to Evil and figured I might as well write the integration patch as well. There does, however, not seem to be any insert mode commands yet, so I don’t have an example to follow. If this is something that’s coming, then I can wait. If I have, however, failed to read the source properly, could someone please point me in the right direction? Thanks!
On 2011-05-17 15:51 +0200, Nikolai Weibull wrote:
So I have an implementation of RFC1345 digraphs that I’ve been using with viper/vimpulse. I would like to donate it to Evil and figured I might as well write the integration patch as well. There does, however, not seem to be any insert mode commands yet, so I don’t have an example to follow.
Thank you for your interest in Evil! Insert commands are bound in `evil-insert-state-map', which currently contains only the command for exiting to Normal state: (define-key evil-insert-state-map (kbd "ESC") 'evil-normal-state) All state bindings are defined in evil-maps.el. The Insert commands themselves should go in evil-insert.el. -- Vegard
On Thu, May 19, 2011 at 14:49, Vegard Øye <[email protected]> wrote:
On 2011-05-17 15:51 +0200, Nikolai Weibull wrote:
So I have an implementation of RFC1345 digraphs that I’ve been using with viper/vimpulse. I would like to donate it to Evil and figured I might as well write the integration patch as well. There does, however, not seem to be any insert mode commands yet, so I don’t have an example to follow.
Thank you for your interest in Evil! Insert commands are bound in `evil-insert-state-map', which currently contains only the command for exiting to Normal state:
(define-key evil-insert-state-map (kbd "ESC") 'evil-normal-state)
All state bindings are defined in evil-maps.el. The Insert commands themselves should go in evil-insert.el.
OK, I’ve created a merge request on gitorious: https://gitorious.org/evil/evil/merge_requests/1 I only wrote one test. I would appreciate it if you wrote some more so that I can learn by example. Also, please tell me if you want something other than merge requests on gitorious. Thanks!
On 2011-05-19 19:23 +0200, Nikolai Weibull wrote:
OK, I’ve created a merge request on gitorious:
https://gitorious.org/evil/evil/merge_requests/1
I only wrote one test. I would appreciate it if you wrote some more so that I can learn by example. Also, please tell me if you want something other than merge requests on gitorious.
Wow, it looks like you have done a very throughout job of implementing digraphs. Do you want digraph.el to be part of Evil, or do you want to distribute it as a standalone library? If the former, it should be renamed to evil-digraphs.el and loaded in evil.el, and I may make some modifications to it. If the latter, I would appreciate a license tag (for example, GPLv2) to make it clear that the file is freely distributable. With regard to testing, most of our tests fall into the "vimgolf" category: performing a key sequence on a test buffer. The main benefit of such tests is that they are implementation independent. Of course, the implementation should be tested too, and a common approach is to feed values into a function and compare the output with the expected output. `digraph-find' could be tested in this way, e.g., (ert-deftest test-digraph-find () "Test `digraph-find'" (should (eq (digraph-find ?L ?F) ?\n)) (should (eq (digraph-find ?S ?P) ?\ ))) This is also a good way to check edge cases, such as incomplete or invalid input. (Should it throw an error? Then verify it with `should-error'.) I haven't handled merge requests on Gitorious before; the common approach has been to commit the changes locally, export the commit with "git format-patch", and post the patch on the mailing list. Anyhow, I'll merge once I receive a reply to the questions above. -- Vegard
Hi! Sorry about the late reply. I had the weekend off e-mail. On Sun, May 22, 2011 at 12:34, Vegard Øye <[email protected]> wrote:
On 2011-05-19 19:23 +0200, Nikolai Weibull wrote:
OK, I’ve created a merge request on gitorious:
https://gitorious.org/evil/evil/merge_requests/1
I only wrote one test. I would appreciate it if you wrote some more so that I can learn by example. Also, please tell me if you want something other than merge requests on gitorious.
Wow, it looks like you have done a very throughout job of implementing digraphs. Do you want digraph.el to be part of Evil, or do you want to distribute it as a standalone library? If the former, it should be renamed to evil-digraphs.el and loaded in evil.el, and I may make some modifications to it. If the latter, I would appreciate a license tag (for example, GPLv2) to make it clear that the file is freely distributable.
I hereby place it in the public domain, so please add it as evil-digraphs.el. You may make any modifications you deem necessary, like removing the unneeded function digraph-read. I’d love to see my name in some AUTHORS or CONTRIBUTORS file, though :-).
With regard to testing, most of our tests fall into the "vimgolf" category: performing a key sequence on a test buffer. The main benefit of such tests is that they are implementation independent. Of course, the implementation should be tested too, and a common approach is to feed values into a function and compare the output with the expected output. `digraph-find' could be tested in this way, e.g.,
(ert-deftest test-digraph-find () "Test `digraph-find'" (should (eq (digraph-find ?L ?F) ?\n)) (should (eq (digraph-find ?S ?P) ?\ )))
This is also a good way to check edge cases, such as incomplete or invalid input. (Should it throw an error? Then verify it with `should-error'.)
OK, thanks. The tests ran really slow on my computer (around 1.5 minutes). Any way of speeding them up?
I haven't handled merge requests on Gitorious before; the common approach has been to commit the changes locally, export the commit with "git format-patch", and post the patch on the mailing list. Anyhow, I'll merge once I receive a reply to the questions above.
OK, I’ll do that in the future.
On 2011-05-23 17:10 +0200, Nikolai Weibull wrote:
On Sun, May 22, 2011 at 12:34, Vegard Øye wrote:
Do you want digraph.el to be part of Evil, or do you want to distribute it as a standalone library?
I hereby place it in the public domain, so please add it as evil-digraphs.el. You may make any modifications you deem necessary, like removing the unneeded function digraph-read.
Done in commit cacedaf. :)
I’d love to see my name in some AUTHORS or CONTRIBUTORS file, though :-).
Of course! We hadn't really thought of that yet, but commit 2aa19af adds a comment header to evil.el.
The tests ran really slow on my computer (around 1.5 minutes). Any way of speeding them up?
That's strange; on my not-so-recent Ubuntu machine, "time make test" clocks in at roughly 12 seconds. What's your system and Emacs version?
I haven't handled merge requests on Gitorious before; the common approach has been to commit the changes locally, export the commit with "git format-patch", and post the patch on the mailing list.
OK, I’ll do that in the future.
Actually, just continue doing things via Gitorious. That takes some load off the mailing list. -- Vegard
participants (2)
-
Nikolai Weibull -
Vegard Øye