From a99b3bfe10cb2a253f80a3647bb0c7edc0279dbe Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Wed, 16 Jan 2019 03:08:26 +0800 Subject: [PATCH] Fix #94: auth-source not initialized due to async. --- doom-modeline.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doom-modeline.el b/doom-modeline.el index 805c47b..09b5ce4 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -1920,6 +1920,10 @@ mouse-3: Describe current input method") ;; (defvar doom-modeline--github-notifications-number 0) +(defvar doom-modeline-before-github-fetch-notification-hook nil + "Hooks before fetching github notifications. +Example: + (add-hook 'doom-modeline-before-github-fetch-notification-hook #'auth-source-pass-enable)") (defun doom-modeline--github-fetch-notifications () "Fetch github notifications." (when (and doom-modeline-github @@ -1929,7 +1933,8 @@ mouse-3: Describe current input method") (require 'async nil t)) (async-start `(lambda () - ,(async-inject-variables "\\`load-path\\'") + ,(async-inject-variables "\\`\\(load-path\\|auth-sources\\)\\'") + (run-hooks 'doom-modeline-before-github-fetch-notification-hook) (require 'ghub nil t) (when (fboundp 'ghub-get) (with-timeout (10)