From 0e6c015d607201bbc848a7c0e09c07284c34e92b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 3 Oct 2019 11:41:42 -0400 Subject: [PATCH] tools/magit: init forge after building emacsql --- modules/tools/magit/config.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/tools/magit/config.el b/modules/tools/magit/config.el index 761ba8fe4..ae27d0952 100644 --- a/modules/tools/magit/config.el +++ b/modules/tools/magit/config.el @@ -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