0

I execute a command M-x pyvenv-workon

It is called twice as below, wonder why

The first call stack trace shows the correct path to the virtualenv

  spacemacs//python-setup-shell("/Users/littlehome/virtualenvs/can")
  funcall(spacemacs//python-setup-shell "/Users/littlehome/virtualenvs/can")
  spacemacs/python-setup-everything("/Users/littlehome/virtualenvs/can")
  apply(spacemacs/python-setup-everything "/Users/littlehome/virtualenvs/can")
  pyvenv-activate("/Users/littlehome/virtualenvs/can")
  apply(#f(compiled-function (name) "Activate a virtual environment from $WORKON_HOME.\n\nIf the virtual environment NAME is already active, this function\ndoes not try to reactivate the environment." (interactive #f(compiled-function () #<bytecode -0x12a7cc692c045eca>)) #<bytecode 0xdc7dd672f6e05f>) "can")
  pyvenv-workon("can")
  funcall-interactively(pyvenv-workon "can")
  call-interactively(pyvenv-workon record nil)
  command-execute(pyvenv-workon record)
  helm-M-x-execute-command(pyvenv-workon)
  helm-execute-selection-action-1()
  helm-execute-selection-action()
  helm-internal
  apply
  helm
  apply
  helm
  helm-M-x-read-extended-command
  helm-M-x(nil)
  funcall-interactively(helm-M-x nil)
  call-interactively(helm-M-x)
  (let ((completion-styles completion-styles)) (add-to-list 'completion-styles 'flex t) (call-interactively 'helm-M-x))
  spacemacs/helm-M-x-fuzzy-matching()
  funcall-interactively(spacemacs/helm-M-x-fuzzy-matching)
  call-interactively(spacemacs/helm-M-x-fuzzy-matching nil nil)
  command-execute(spacemacs/helm-M-x-fuzzy-matching)

Whereas 2nd call (which is called automatically, and I don't know why it's getting called) doesn't have the correct path

  spacemacs//python-setup-shell("can")
  funcall(spacemacs//python-setup-shell "can")
  spacemacs/python-setup-everything("can")
  apply(spacemacs/python-setup-everything "can")
  pyvenv-workon("can")
  funcall-interactively(pyvenv-workon "can")
  call-interactively(pyvenv-workon record nil)
  command-execute(pyvenv-workon record)
  helm-M-x-execute-command(pyvenv-workon)
  helm-execute-selection-action-1()
  helm-execute-selection-action()
  helm-internal
  apply
  helm
  apply
  helm
  helm-M-x-read-extended-command
  helm-M-x(nil)
  funcall-interactively(helm-M-x nil)
  call-interactively(helm-M-x)
  (let ((completion-styles completion-styles)) (add-to-list 'completion-styles 'flex t) (call-interactively 'helm-M-x))
  spacemacs/helm-M-x-fuzzy-matching()
  funcall-interactively(spacemacs/helm-M-x-fuzzy-matching)
  call-interactively(spacemacs/helm-M-x-fuzzy-matching nil nil)
  command-execute(spacemacs/helm-M-x-fuzzy-matching)

--

  • edit

Turns out pyvenv-workon has 2 same defadvice attached to it.

0

Your Answer

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

Browse other questions tagged or ask your own question.