Skip to content

Commit

Permalink
fix(pyenv): ensure before enabling it globally (daemon hanging issue)
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Jan 18, 2024
1 parent f76a571 commit 5984552
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions modules/me-prog.el
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,16 @@

(use-package pyenv
:straight (:host github :repo "aiguofer/pyenv.el")
:hook (minemacs-first-python-file . global-pyenv-mode)
:hook (minemacs-first-python-file . +global-pyenv-mode-maybe)
:custom
(pyenv-show-active-python-in-modeline nil))
(pyenv-show-active-python-in-modeline nil)
:config
(defun +global-pyenv-mode-maybe (&optional arg)
"Enable `pyenv-global-mode' if it can be enabled."
(interactive (list (if current-prefix-arg (prefix-numeric-value current-prefix-arg) 'toggle)))
(if (file-executable-p pyenv-executable)
(global-pyenv-mode arg)
(+log! "The %S file doesn't exist or is not executable, `pyenv' cannot be enabled."))))

(use-package gitlab-ci-mode
:straight t)
Expand Down

0 comments on commit 5984552

Please sign in to comment.