#!/bin/sh 
# 
# Usage: launch_emacs.sh <filename>
# 
# lincvs GNU/emacs launcher, the one true editor for the 
# one true cvs GUI ;-) 
# 
if [ $# -gt 0 ] 
then 
# 	try to start the emacsclient 
	emacsclient "$@" 
	returnvalue=$? 
# 	was emacs running in server mode? 
	if [ $returnvalue -ne 2 -a $returnvalue -ne 0 ] 
	then 
# 		no => start emacs and gnuserv 
		echo "emacs -funcall server-start" "$@" "&" 
		emacs -funcall server-start "$@" & 
	fi 
else 
	echo "Usage: " $0 " filename" 
fi


syntax highlighted by Code2HTML, v. 0.9.1