emacscollective / borg

Assimilate Emacs packages as Git submodules
https://emacsmirror.net/manual/borg
GNU General Public License v3.0
255 stars 28 forks source link

Very simple init.el does not compile via make init-build #134

Closed pedz closed 1 year ago

pedz commented 1 year ago

I trimmed my init.el down to just

(declare-function pedz/org-require "early-init.el" (sym &optional dont-load paths))
(pedz/org-require 'pedz)

and I do make init-build and this is the output:

Initializing drones...done (42 drones in 0.039s)

--- [init.el] ---

Loading /Users/pedz/.config/emacs/init.el (source)...
Debugger entered--Lisp error: (void-function pedz/org-require)
  (pedz/org-require 'pedz)
  eval-buffer(#<buffer  *load*> nil "/Users/pedz/.config/emacs/init.el" nil t)  ; Reading at buffer position 109
  load-with-code-conversion("/Users/pedz/.config/emacs/init.el" "/Users/pedz/.config/emacs/init.el" nil nil)
  load("/Users/pedz/.config/emacs/init.el" nil nil t)
  load-file("init.el")
  borg-batch-rebuild-init()
  command-line-1(("-L" "lib/borg/" "--load" "borg" "--funcall" "borg-initialize" "--funcall" "borg-batch-rebuild-init"))
  command-line()
  normal-top-level()

make: *** [init-build] Error 255

But, if I do it by hand with emacs -Q --batch --eval '(byte-compile-file "init.el")' it works.

Update: I forgot to mention, I worked around the problem with:

(eval-when-compile
  (defun pedz/org-require (sym &optional dont-load paths)))
(pedz/org-require 'pedz)