Add doom-env-version-hook

This commit is contained in:
Henrik Lissner 2016-05-25 00:11:07 -04:00
parent 3af24222b3
commit a4060ac9f4
2 changed files with 10 additions and 2 deletions

View file

@ -1,5 +1,8 @@
;;; defuns-spaceline.el
(defvar doom-env-version-hook '()
"Hook that runs whenever the environment version changes (e.g. rbenv/pyenv)")
;;;###autoload
(defun doom|spaceline-env-update ()
(when doom--env-command
@ -7,7 +10,8 @@
(let ((s (shell-command-to-string doom--env-command)))
(setq doom--env-version (if (string-match "[ \t\n\r]+\\'" s)
(replace-match "" t t s)
s))))))
s))
(run-hook-with-args 'doom-env-version-hook doom--env-version)))))
;;;###autoload
(defun doom/-flycheck-count (state)