Updates to use emacsclient and daemon

This commit is contained in:
Salar Rahmanian 2020-11-28 15:08:09 -08:00
parent 0e1b18cb0d
commit 095e7b7232
5 changed files with 61 additions and 4 deletions

18
run-emacsclient Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
if [ -z "$EMACSCLIENT_OPTS" ]; then
EMACSCLIENT_OPTS="-nc"
fi
if [ $# -eq 0 ]; then
COMMAND='/Users/salar/.nix-profile/bin/emacsclient '$EMACSCLIENT_OPTS' -e "(if (display-graphic-p) (x-focus-frame nil))"'
else
COMMAND='/Users/salar/.nix-profile/bin/emacsclient '$EMACSCLIENT_OPTS' "$@"'
fi
if [ -z "$(shopt | grep login_shell)" ]; then
echo "$COMMAND" | exec bash --login -s "$@"
else
eval "exec $COMMAND"
fi