From 94092081db55fd58445ec5d5607e6ae011cb6502 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Tue, 14 Aug 2018 01:08:13 -0700 Subject: [PATCH] Fix running make from inside doom The `term.el` package defines an environment variable `EMACS` inside its shell process, containing the Emacs and term.el version, in a string that looks like this: `26.1 (term:0.96)`. This interferes with the `bin/doom` command, which expects that environment variable to be a path to an Emacs binary. Trying to run make inside a doom terminal thus gives you this error: ``` Emacs isn't installed make: *** [Makefile:5: all] Error 1 ``` This simple fix just checks if `$EMACS` looks like a term version string, and ignores it if so. --- bin/doom | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/doom b/bin/doom index 0b21a0382..6d55d29bd 100755 --- a/bin/doom +++ b/bin/doom @@ -1,5 +1,5 @@ #!/usr/bin/env bash -":"; EMACS=${EMACS:-emacs} # -*-emacs-lisp-*- +":"; [[ $EMACS = *"term"* ]] && EMACS=emacs || EMACS=${EMACS:-emacs} # -*-emacs-lisp-*- ":"; command -v $EMACS >/dev/null || { >&2 echo "Emacs isn't installed"; exit 1; } ":"; 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; }