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
    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 Oct 21 '15 at 16:44

For a REPL, it was simple:

  • 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 Oct 21 '15 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 Oct 21 '15 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 :) – 24HrRevengeTherapist Oct 21 '15 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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