Fix "fatal: no names found" errors on 'doom rebuild'
Some packages that depend on org (like elfeed) will load the built-in org early in the rebuild/package install process, which causes org to define org-release and org-git-version, sometimes overwriting our stubs for it. Without our hack, org call 'git describe' in the org repo in an attempt to determine the installed version, which won't work in a sparse clone. To ensure future definitions never overwrite ours, we advise them as well. Also moves magit-version hack to its autoload file, for consistency with org's hacks.
This commit is contained in:
parent
c8d6ab823b
commit
9ab49be564
4 changed files with 19 additions and 14 deletions
|
@ -1,5 +1,19 @@
|
|||
;;; lang/org/autoload/org.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; HACK A necessary hack because org requires a compilation step after being
|
||||
;; cloned, and during that compilation a org-version.el is generated with these
|
||||
;; two functions, which return the output of a 'git describe ...' call in the
|
||||
;; repo's root. Of course, this command won't work in a sparse clone, and more
|
||||
;; than that, initiating these compilation step is a hassle, so...
|
||||
;;;###autoload (defun +org--release-a () "9.3")
|
||||
;;;###autoload (fset 'org-release #'+org--release-a)
|
||||
;;;###autoload (fset 'org-git-version #'ignore)
|
||||
|
||||
;; Org itself may override the above if it's loaded too early by packages that
|
||||
;; depend on it, so we have to advise it once again:
|
||||
;;;###autoload (advice-add #'org-release :override #'+org--release-a)
|
||||
;;;###autoload (advice-add #'org-git-version :override #'ignore)
|
||||
|
||||
;;
|
||||
;;; Helpers
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue