#!/bin/sh
#
# Usage: ed-tkdesk [file ...]
# Opens a new editor window, and loads files if any are given.

if [ $# -gt 0 ]; then
  FILES=
  for f in $@; do
    if [ -z "`echo $f | egrep '^[/~]|^\+[1-90]+$'`" ]; then
      FILES="$FILES `pwd`/$f"
    else
      FILES="$FILES $f"
    fi
  done
  tkdeskclient "cd `pwd`; dsk_edit `echo $FILES`; cd" >/dev/null
else
  tkdeskclient 'dsk_edit "New File"' >/dev/null
fi
