fix(cli): site file loader

I had missed the fact that -Q implies not only
--no-site-file (intended), but --no-site-lisp (unintended). Without the
latter, no site-lisp directory is left in load-path, and any attempt to
load it after-the-fact (which I do in core-cli.el) will fail. Thanks to
@yamanq for noticing this!

Fix: #6473
Fix: #4198
Co-authored-by: Yaman Qalieh <yamanq@users.noreply.github.com>
This commit is contained in:
Henrik Lissner 2022-06-21 22:38:06 +02:00
parent 681d40ab58
commit 3b3c008b1b
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
2 changed files with 9 additions and 7 deletions

View file

@ -22,7 +22,9 @@ case "$EMACS" in
*) EMACS="${EMACS:-emacs}" ;;
esac
TMPDIR="${TMPDIR:-$($EMACS -Q --batch --eval '(princ (temporary-file-directory))' 2>/dev/null)}"
emacs="$EMACS -q --no-site-file --no-x-resources --no-splash --batch"
TMPDIR="${TMPDIR:-$($emacs --eval '(princ (temporary-file-directory))' 2>/dev/null)}"
if [ -z "$TMPDIR" ]; then
>&2 echo "Error: failed to run Emacs with command '$EMACS'"
>&2 echo
@ -41,10 +43,9 @@ tmpfile="$TMPDIR/doomscript.${__DOOMPID}"
target="$1"
shift
$EMACS -Q --batch \
--load "$EMACSDIR/core/core-cli" \
--load "$target" \
-- "$@" || exit=$?
$emacs --load "$EMACSDIR/core/core-cli" \
--load "$target" \
-- "$@" || exit=$?
# Execute exit-script, if requested (to simulate execve)
if [ "${exit:-0}" -eq 254 ]; then
sh "${tmpdir}/doom.${__DOOMPID}.${__DOOMSTEP}.sh" "$0" "$@" && true