Skip to content

Commit

Permalink
fix(build): prefix load paths instead of set
Browse files Browse the repository at this point in the history
Allows callers to add their own load paths. See example config for how one can
now prefix `EMACSNATIVELOADPATH` for a byte-compiled early-init.el/init.el:

https://github.com/jordanisaacs/emacs-config/blob/c3ba675888a8334f403e4304828af221fa0d5e55/flake.nix#L100

For some reason emacs expects ":" in a single value `EMACSLOADPATH`.  However,
`--prefix` escapes ":" values. To get around this, use `--set-default
EMACSLOADPATH ":"` which results in the following when no caller above adds
their own load paths: `EMACSLOADPATH=$siteLisp::` which emacs accepts.
  • Loading branch information
jordanisaacs committed Dec 20, 2024
1 parent e3584a0 commit bffeea9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkgs/emacs/wrapper.nix
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ in
${lib.optionalString (length executablePackages > 0) "--prefix PATH : ${lib.escapeShellArg (lib.makeBinPath executablePackages)}"} \
--prefix INFOPATH : ${emacs}/share/info:$out/share/info:${infoPath} \
${
lib.optionalString nativeComp "--set EMACSNATIVELOADPATH $nativeLisp:$nativeLoadPath"
lib.optionalString nativeComp "--prefix EMACSNATIVELOADPATH : $nativeLisp:$nativeLoadPath"
} \
--set EMACSLOADPATH "$siteLisp:"
--set-default EMACSLOADPATH ":" \
--prefix EMACSLOADPATH : "$siteLisp"
fi
done
''

0 comments on commit bffeea9

Please sign in to comment.