mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-23 19:19:50 +00:00
Optimize: inject load-path var and add timeout for async process.
This commit is contained in:
parent
e116b3e840
commit
834f59c2ef
1 changed files with 10 additions and 8 deletions
|
@ -186,6 +186,7 @@ It returns a file name which can be used directly as argument of
|
|||
|
||||
(declare-function anzu--reset-status 'anzu)
|
||||
(declare-function anzu--where-is-here 'anzu)
|
||||
(declare-function async-inject-variables 'async)
|
||||
(declare-function avy-traverse 'avy)
|
||||
(declare-function avy-tree 'avy)
|
||||
(declare-function aw-update 'ace-window)
|
||||
|
@ -1565,14 +1566,15 @@ mouse-3: Describe current input method")
|
|||
(if (and doom-modeline-github
|
||||
(fboundp 'async-start))
|
||||
(async-start
|
||||
(lambda ()
|
||||
(package-initialize)
|
||||
`(lambda ()
|
||||
,(async-inject-variables "\\`load-path\\'")
|
||||
(require 'ghub nil t)
|
||||
(when (fboundp 'ghub-get)
|
||||
(with-timeout (10)
|
||||
(ghub-get "/notifications"
|
||||
nil
|
||||
:query '((notifications . "true"))
|
||||
:noerror t)))
|
||||
:noerror t))))
|
||||
(lambda (result)
|
||||
(setq doom-modeline--github-notifications-number
|
||||
(length result))))))
|
||||
|
|
Loading…
Reference in a new issue