I'm using virtualenvwrapper.el to load Python virtualenvs during emacs sessions. I would like emacs to start with a default one, so I don't have to load it manually every time.

To load it manually, I use

M-x venv-workon RET

Virtualenv to swich to: myvirtualenv RET

How can I do this through init.el?

1 Answer 1


Interactive simply provides a way to call the function via M-x. You can use venv-workon normally, like any other emacs-lisp function. Here's an example:

 (require 'virtualenvwrapper)
 (venv-workon "my-python-project")

For more detail on what interactive does, see Using Interactive from the Elisp docs. Essentially, interactive marks a function as a command and defines how arguments passed to a command should be parsed.

  • It works perfectly for the shell. Now how can I assign it for flycheck use?
    – dmvianna
    Dec 17, 2014 at 0:35

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.