From 6b625e96b555eddc666bf831bea8e73fc2a8fab2 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 28 May 2018 14:27:14 +0200 Subject: [PATCH] bin/doom: add support for custom emacs binary (EMACS envvar) --- bin/doom | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/doom b/bin/doom index e1f1d74e7..b90ef48b5 100755 --- a/bin/doom +++ b/bin/doom @@ -1,11 +1,12 @@ #!/usr/bin/env bash -":"; command -v emacs >/dev/null || { >&2 echo "Emacs isn't installed"; exit 1; } # -*-emacs-lisp-*- -":"; VERSION=$(emacs --version | head -n1) +":"; EMACS=${EMACS:-emacs} +":"; command -v $EMACS >/dev/null || { >&2 echo "Emacs isn't installed"; exit 1; } # -*-emacs-lisp-*- +":"; VERSION=$($EMACS --version | head -n1) ":"; [[ $VERSION == *\ 2[0-2].[0-1].[0-9] ]] && { echo "You're running $VERSION"; echo "That version is too old to run Doom. Check your PATH"; echo; exit 2; } ":"; DOOMDIR=$(dirname "${BASH_SOURCE:-${(%):-%x}}")/.. -":"; [[ $1 == doc || $1 == doctor ]] && { cd "$DOOMDIR"; exec emacs --script bin/doom-doctor; exit 0; } -":"; [[ $1 == run ]] && { cd "$DOOMDIR"; shift; exec emacs -q --no-splash -l bin/doom "$@"; exit 0; } -":"; exec emacs --script "$0" -- $@ +":"; [[ $1 == doc || $1 == doctor ]] && { cd "$DOOMDIR"; exec $EMACS --script bin/doom-doctor; exit 0; } +":"; [[ $1 == run ]] && { cd "$DOOMDIR"; shift; exec $EMACS -q --no-splash -l bin/doom "$@"; exit 0; } +":"; exec $EMACS --script "$0" -- $@ ":"; exit 0 (defun usage ()