2015-10-01 03:40:09 -04:00
|
|
|
;;; defuns-spaceline.el
|
|
|
|
|
2016-05-25 00:11:07 -04:00
|
|
|
(defvar doom-env-version-hook '()
|
|
|
|
"Hook that runs whenever the environment version changes (e.g. rbenv/pyenv)")
|
|
|
|
|
2015-10-01 03:40:09 -04:00
|
|
|
;;;###autoload
|
2016-05-20 22:37:30 -04:00
|
|
|
(defun doom|spaceline-env-update ()
|
|
|
|
(when doom--env-command
|
|
|
|
(let ((default-directory (doom/project-root)))
|
|
|
|
(let ((s (shell-command-to-string doom--env-command)))
|
|
|
|
(setq doom--env-version (if (string-match "[ \t\n\r]+\\'" s)
|
2015-12-11 16:51:04 -05:00
|
|
|
(replace-match "" t t s)
|
2016-05-25 00:11:07 -04:00
|
|
|
s))
|
|
|
|
(run-hook-with-args 'doom-env-version-hook doom--env-version)))))
|
2015-10-01 03:40:09 -04:00
|
|
|
|
2016-05-13 00:26:36 -04:00
|
|
|
;;;###autoload
|
2016-05-20 22:37:30 -04:00
|
|
|
(defun doom/-flycheck-count (state)
|
2016-05-13 00:26:36 -04:00
|
|
|
"Return flycheck information for the given error type STATE."
|
|
|
|
(when (flycheck-has-current-errors-p state)
|
|
|
|
(if (eq 'running flycheck-last-status-change)
|
|
|
|
"?"
|
|
|
|
(cdr-safe (assq state (flycheck-count-errors flycheck-current-errors))))))
|
|
|
|
|
2015-10-01 03:40:09 -04:00
|
|
|
(provide 'defuns-spaceline)
|
|
|
|
;;; defuns-spaceline.el ends here
|