kaz-yos / eval-in-repl

Consistent ESS-like eval interface for various REPLs
174 stars 27 forks source link

some changes to eir-eval-in-repl-python and creation of eir-eval-in-perl #36

Open abelew opened 5 years ago

abelew commented 5 years ago

Hello, I have been wanting something like this package for a very long time so that I may have the ease of ess in arbitrary languages. I was super pleased to find it.

While playing with it in python, I had some very strange and difficult-to-reproduce problems with 'Overlapping strings detected'. I eventually hunted down my problems to python-nav-forward-*. Since I know ess a bit more than python.el, I decided to yank the logic from there and implement a python version of 'ess-eval-region-or-function-or-paragraph-and-step' (eerofopas) by mostly copy/pasting from ess.

In the process of making it work, I found myself looking at eir-eval-in-python-repl/python.el and thinking that the logic should work pretty easily with perl's various REPLs. So I did a little more copy/pasting and made eir-eval-in-perl-repl.

Finally, I added a function to eval-in-repl which is just a (cond ...) to invoke the various eval flavors depending on the current buffer's major mode.

I only about 75% finished any of these tasks though, as I needed to get back to work. If any of them are of interest, I would be happy to finish them, clean them up, and send a PR, as they are currently sitting in my fork.

I hope you are doing well.

kaz-yos commented 5 years ago

These sound very useful! I have been essentially accepting all pull requests into this repo.

abelew commented 5 years ago

Hi! I will send up a PR after we get back from camping in a couple weeks. There are still some shenanigans I need to clear up: notably when I am working in a multi-mode markdown file, sometimes my code sends the ``` along with the code block to the repl. I had this problem in ess a long time ago, so I just need to poke until I remember why.

kaz-yos commented 5 years ago

I don't currently do it or require others to do it, but I guess we should really test these things via a testing suite. I used to think it's impossible to test a very interactive package. But I'm learning elsewhere buttercup.el and with-temp-buffer can be used to examine user-facing behaviors (https://github.com/kaz-yos/stan-mode/blob/new-features/stan-mode/test-stan-mode.el). This isn't quite the interactive part, but it should be theoretically possible to emulate and test every keystroke since they are all command executions.

abelew commented 5 years ago

I just read over test-stan-mode.el, I did not fully understand what was going on, but it looks like the most awesome thing ever for working through getting these behaviors correct. Thank you for the heads up!