branch: elpa/dracula-theme
commit f98f9bd54e965e8676ee15ce8b4ecbeae01341ed
Author: Étienne Deparis <[email protected]>
Commit: Étienne Deparis <[email protected]>
Improve a little test script
---
start_emacs_test.sh | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/start_emacs_test.sh b/start_emacs_test.sh
index 013650c..55e7cdd 100755
--- a/start_emacs_test.sh
+++ b/start_emacs_test.sh
@@ -1,21 +1,23 @@
#!/usr/bin/env sh
ARGS=
-TERM_TEST=no
-COLOR=256color
+COLOR=
for arg in $*; do
case $arg in
- 256) COLOR=256color ;;
- 88) COLOR=88color ;;
- 16) COLOR=16color ;;
- *)
- [ "$arg" = '-nw' ] && TERM_TEST=yes
- ARGS="$ARGS $arg"
- ;;
+ 256|-nw) COLOR=256color ;;
+ 88) COLOR=88color ;;
+ 16) COLOR=16color ;;
+ *) ARGS="$ARGS $arg" ;;
esac
done
-[ "$TERM_TEST" = 'yes' ] && export TERM=xterm-$COLOR
[ -z "$EMACS" ] && EMACS=emacs
+if [ -n "$COLOR" ]; then
+ export TERM=xterm-$COLOR
+ echo "Run in terminal as $TERM"
+ EMACS="$EMACS -nw"
+else
+ echo "Run as a graphical window"
+fi
$EMACS -Q --debug-init -l test-profile.el $ARGS