porterjamesj/virtualenvwrapper.el

question: is it possible to give arguments to emacs hooks?

Opened this issue · 0 comments

hello, I am a beginner with elisp
I wrote this binding (and for what I need to do it works...) anyway I had to create the directory of the new virtualenv, so my 2 questions are:

  • why that folder isn't created by venv-mkvirtualenv-using itself?
  • venv-premkvirtualenv-hook was likely a better place to place that folder creation, but how could I get the name of the virtualenv there?
(global-set-key (kbd "C-. m")
                (lambda ()
                        (interactive)
			(let ((interpeter (if (string= (read-string "PY Interpeter:") "36")
			                       "/home/castix/.pyenv/versions/3.6.3/bin/python3"
			                       "python"))
			      (name (read-string "Name:")))
			     (make-directory (concat venv-location name))
                             (venv-mkvirtualenv-using interpeter name))))