0

I am sending text to a REPL as if I had typed it in, like so:

(insert "source activate py3; hy")

How do I do the programmatic equivalent of pressing enter after inserting this string?

1
  • 1
    It looks like you asked the question, and then right away answered it. Doing that is encouraged, I believe, because it means that users who have the same question, don't have to write it themselves and they get the answer instantly. However in this case both the question and the answer are way to short. E.g. you just mention comint-sent-input - but you should also explain what it does and why that is what we want.
    – tarsius
    Commented Oct 21, 2015 at 16:44

1 Answer 1

1

For a REPL, it was simple:

(comint-send-input)
3
  • 4
    Before calling comint-send-input, you can use comint-send-string instead of using insert -- that way it gets done under-the-hood.
    – lawlist
    Commented Oct 21, 2015 at 16:04
  • That comment is autogenerated and doesn't quite match what I wanted to say, which is "please improve qa as suggested above - otherwise this should probably be deleted".
    – tarsius
    Commented Oct 21, 2015 at 16:47
  • Will when I learn more about what this does. Inserting enter was a bloody pain so not deleting this since other might wonder about the same thing. Feel free to post a better answer though :) Commented Oct 21, 2015 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.