3

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

7

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.

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.