fix(magit): remove lazy emacsqlite build hack
This was resolved upstream some time ago and is now a source of errors (void-variable emacsql-sqlite-executable errors) if forge were ever bumped (which it was, yesterday, in1a05e2f
). Ref: magit/forge@398ca3a17a Amend:1a05e2fa64
This commit is contained in:
parent
36385091e8
commit
7afc21a652
1 changed files with 1 additions and 29 deletions
|
@ -157,35 +157,7 @@ Only has an effect in GUI Emacs.")
|
||||||
:map magit-remote-section-map [remap magit-browse-thing] #'forge-browse-remote
|
:map magit-remote-section-map [remap magit-browse-thing] #'forge-browse-remote
|
||||||
:map magit-branch-section-map [remap magit-browse-thing] #'forge-browse-branch))
|
:map magit-branch-section-map [remap magit-browse-thing] #'forge-browse-branch))
|
||||||
(set-popup-rule! "^\\*?[0-9]+:\\(?:new-\\|[0-9]+$\\)" :size 0.45 :modeline t :ttl 0 :quit nil)
|
(set-popup-rule! "^\\*?[0-9]+:\\(?:new-\\|[0-9]+$\\)" :size 0.45 :modeline t :ttl 0 :quit nil)
|
||||||
(set-popup-rule! "^\\*\\(?:[^/]+/[^ ]+ #[0-9]+\\*$\\|Issues\\|Pull-Requests\\|forge\\)" :ignore t)
|
(set-popup-rule! "^\\*\\(?:[^/]+/[^ ]+ #[0-9]+\\*$\\|Issues\\|Pull-Requests\\|forge\\)" :ignore t))
|
||||||
|
|
||||||
(defadvice! +magit--forge-get-repository-lazily-a (&rest _)
|
|
||||||
"Make `forge-get-repository' return nil if the binary isn't built yet.
|
|
||||||
This prevents emacsql getting compiled, which appears to come out of the blue
|
|
||||||
and blocks Emacs for a short while."
|
|
||||||
:before-while #'forge-get-repository
|
|
||||||
(file-executable-p emacsql-sqlite-executable))
|
|
||||||
|
|
||||||
(defadvice! +magit--forge-build-binary-lazily-a (&rest _)
|
|
||||||
"Make `forge-dispatch' only build emacsql if necessary.
|
|
||||||
Annoyingly, the binary gets built as soon as Forge is loaded. Since we've
|
|
||||||
disabled that in `+magit--forge-get-repository-lazily-a', we must manually
|
|
||||||
ensure it is built when we actually use Forge."
|
|
||||||
:before #'forge-dispatch
|
|
||||||
(unless (file-executable-p emacsql-sqlite-executable)
|
|
||||||
(emacsql-sqlite-compile 2)
|
|
||||||
(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! code-review
|
(use-package! code-review
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue