tools/magit: init forge after building emacsql

This commit is contained in:
Henrik Lissner 2019-10-03 11:41:42 -04:00
parent 03f6b3e77c
commit 0e6c015d60
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -96,9 +96,18 @@ ensure it is built when we actually use Forge."
:before #'forge-dispatch
(unless (file-executable-p emacsql-sqlite-executable)
(emacsql-sqlite-compile 2)
(unless (file-executable-p emacsql-sqlite-executable)
(message (concat "Failed to build emacsql; forge may not work correctly.\n"
"See *Compile-Log* buffer for details"))))))
(if (not (file-executable-p emacsql-sqlite-executable))
(message (concat "Failed to build emacsql; forge may not work correctly.\n"
"See *Compile-Log* buffer for details"))
;; HACK Due to changes upstream, forge doesn't initialize completely if
;; it doesn't find `emacsql-sqlite-executable', so we have to do it
;; manually after installing it.
(setq forge--sqlite-available-p t)
(magit-add-section-hook 'magit-status-sections-hook 'forge-insert-pullreqs nil t)
(magit-add-section-hook 'magit-status-sections-hook 'forge-insert-issues nil t)
(after! forge-topic
(dolist (hook forge-bug-reference-hooks)
(add-hook hook #'forge-bug-reference-setup)))))))
(use-package! magit-todos