#!/bin/zsh if [ $# -eq 0 ]; then # No file specified PARAM= ECPARAM=("-e" "(new-frame)") else PARAM=$* ECPARAM=$* fi if ! /opt/local/bin/emacsclient $ECPARAM; then sleep 5 exec emacs -f server-start $PARAM fi