Refactor.

This commit is contained in:
Vincent Zhang 2019-10-13 20:48:14 +08:00
parent bc046daea2
commit e9cd72fd2a
2 changed files with 8 additions and 12 deletions

View file

@ -351,8 +351,8 @@ If you think it's helpful for you, please consider pay a cup of coffee for me. T
<img
src="https://user-images.githubusercontent.com/140797/65818854-44204900-e248-11e9-9cc5-3e6339587cd8.png"
alt="Alipay" width="150"/>
&nbsp;&nbsp;
alt="Alipay" width="120"/>
&nbsp;&nbsp;&nbsp;&nbsp;
<img
src="https://user-images.githubusercontent.com/140797/65818844-366ac380-e248-11e9-931c-4bd872d0566b.png"
alt="Wechat" width="150"/>
alt="Wechat" width="120"/>

View file

@ -88,6 +88,7 @@
(declare-function anzu--reset-status 'anzu)
(declare-function anzu--where-is-here 'anzu)
(declare-function async-inject-variables 'async)
(declare-function async-start 'async)
(declare-function avy-traverse 'avy)
(declare-function avy-tree 'avy)
(declare-function aw-update 'ace-window)
@ -142,6 +143,7 @@
(declare-function flymake-running-backends 'flymake)
(declare-function flymake-show-diagnostics-buffer 'flymake)
(declare-function flymake-start 'flymake)
(declare-function grip-browse-preview 'grip-mode)
(declare-function grip-mode 'grip-mode)
(declare-function helm-candidate-number-at-point 'helm)
(declare-function helm-get-candidate-number 'helm)
@ -1773,16 +1775,12 @@ Example:
(defun doom-modeline--github-fetch-notifications ()
"Fetch GitHub notifications."
(when (and doom-modeline-github
(fboundp 'async-start))
;; load `async' if it exists but is not loaded
(unless (fboundp 'async-inject-variables)
(require 'async nil t))
(require 'async nil t))
(async-start
`(lambda ()
,(async-inject-variables "\\`\\(load-path\\|auth-sources\\|doom-modeline-before-github-fetch-notification-hook\\)\\'")
(run-hooks 'doom-modeline-before-github-fetch-notification-hook)
(require 'ghub nil t)
(when (fboundp 'ghub-get)
(when (require 'ghub nil t)
(with-timeout (10)
(ignore-errors
(if (ghub--token ghub-default-host
@ -2344,9 +2342,7 @@ mouse-2: Stop preview"
'mouse-face '(:box 0)
'local-map (let ((map (make-sparse-keymap)))
(define-key map [mode-line mouse-1]
(lambda ()
(interactive)
(browse-url (format "http://localhost:%d" grip-port))))
#'grip-browse-preview)
(define-key map [mode-line mouse-2]
#'grip-mode)
map)))