#!/bin/sh

# Make links in the directory ev to allow for more convenient use of
# environment variable shorthands for directories in emacs.

dirabbrevfile=~/emacs/lisp/evdirabbrevs.el

rm -f ~/ev/*

echo "(setq evdirabbrevs\
      '(" > $dirabbrevfile

setenv | sed -n 's:^\([a-zA-Z+-9_]*\)=\(/[a-zA-Z+-9_]*/[a-zA-Z+-9_/]*\)$:evlinksinternal '"$dirabbrevfile"' \2 \1:p' | grep -v 'PWD$' | sort -r | csh -f

echo '      ))' >> $dirabbrevfile
