mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-27 11:09:52 +00:00
[Optimize] Check github notifications asynchronously and enable it by default.
This commit is contained in:
parent
ea39dce5f0
commit
8fc06950ce
1 changed files with 7 additions and 7 deletions
|
@ -127,7 +127,7 @@ The icons may not be showed correctly in terminal and on Windows.")
|
||||||
(defvar doom-modeline-lsp t
|
(defvar doom-modeline-lsp t
|
||||||
"Whether display `lsp' state or not. Non-nil to display in mode-line.")
|
"Whether display `lsp' state or not. Non-nil to display in mode-line.")
|
||||||
|
|
||||||
(defvar doom-modeline-github nil
|
(defvar doom-modeline-github t
|
||||||
"Whether display github notifications or not. Requires `ghub' package.")
|
"Whether display github notifications or not. Requires `ghub' package.")
|
||||||
|
|
||||||
(defvar doom-modeline-github-interval (* 30 60)
|
(defvar doom-modeline-github-interval (* 30 60)
|
||||||
|
@ -203,8 +203,6 @@ It returns a file name which can be used directly as argument of
|
||||||
(declare-function face-remap-remove-relative 'face-remap)
|
(declare-function face-remap-remove-relative 'face-remap)
|
||||||
(declare-function flycheck-count-errors 'flycheck)
|
(declare-function flycheck-count-errors 'flycheck)
|
||||||
(declare-function flycheck-list-errors 'flycheck)
|
(declare-function flycheck-list-errors 'flycheck)
|
||||||
(declare-function get-current-persp 'persp-mode)
|
|
||||||
(declare-function ghubp-get-notifications 'ghub+)
|
|
||||||
(declare-function iedit-find-current-occurrence-overlay 'iedit-lib)
|
(declare-function iedit-find-current-occurrence-overlay 'iedit-lib)
|
||||||
(declare-function iedit-prev-occurrence 'iedit-lib)
|
(declare-function iedit-prev-occurrence 'iedit-lib)
|
||||||
(declare-function image-get-display-property 'image-mode)
|
(declare-function image-get-display-property 'image-mode)
|
||||||
|
@ -218,7 +216,6 @@ It returns a file name which can be used directly as argument of
|
||||||
(declare-function project-current 'project)
|
(declare-function project-current 'project)
|
||||||
(declare-function project-roots 'project)
|
(declare-function project-roots 'project)
|
||||||
(declare-function projectile-project-root 'projectile)
|
(declare-function projectile-project-root 'projectile)
|
||||||
(declare-function safe-persp-name 'persp-mode)
|
|
||||||
(declare-function symbol-overlay-assoc 'symbol-overlay)
|
(declare-function symbol-overlay-assoc 'symbol-overlay)
|
||||||
(declare-function symbol-overlay-get-list 'symbol-overlay)
|
(declare-function symbol-overlay-get-list 'symbol-overlay)
|
||||||
(declare-function symbol-overlay-get-symbol 'symbol-overlay)
|
(declare-function symbol-overlay-get-symbol 'symbol-overlay)
|
||||||
|
@ -1554,10 +1551,13 @@ mouse-3: Describe current input method")
|
||||||
(defun doom-modeline-github-fetch-notifications ()
|
(defun doom-modeline-github-fetch-notifications ()
|
||||||
"Fetch github notifications."
|
"Fetch github notifications."
|
||||||
(if (and doom-modeline-github
|
(if (and doom-modeline-github
|
||||||
|
(fboundp 'async-start)
|
||||||
(fboundp 'ghub-get))
|
(fboundp 'ghub-get))
|
||||||
|
(async-start
|
||||||
(setq doom-modeline--github-notifications-number
|
(setq doom-modeline--github-notifications-number
|
||||||
(length (ignore-errors
|
(length
|
||||||
(ghub-get "/notifications" nil :query '((notifications . "true"))))))))
|
(ignore-errors
|
||||||
|
(ghub-get "/notifications" nil :query '((notifications . "true")))))))))
|
||||||
|
|
||||||
(run-with-timer 30
|
(run-with-timer 30
|
||||||
doom-modeline-github-interval
|
doom-modeline-github-interval
|
||||||
|
|
Loading…
Reference in a new issue