# $Id: dot-zshrc,v 2.0 1994/02/26 20:40:24 jimt Exp $

## This file contains a sample script showing how to set up ksh to
## work properly with j-shell.  Before examining this script, please
## read the comments in the file dot-tcsh; the comments in that script
## describe steps common to the scripts for all shells.

# Comments delimited by a single # are specific to zsh.

if [ "$TERM" = "emacs" ]
then
	unsetopt zle
	stty nl -echo		# Keeps ^M from echoing

	## Step A.
	emacscd="\033EmAcScd"
	emacshost="\033EmAcShost"

	## Step B.
	chpwd() { echo $emacscd $PWD }
	hostcmd() { echo $emacshost `hostname` }
	reorient() { hostcmd ; chpwd }

	## Step C.
	# In zsh, the chpwd function is called automatically anytime
	# the working directory changes, so we need no special aliases.

	## Step D.
	fake_rlogin() { rlogin $*; reorient ; }
	alias rlogin='fake_rlogin '

	fake_sh() { sh $*; reorient ; }
	alias sh=fake_sh

	fake_ksh() { ksh $*; reorient ; }
	alias ksh=fake_ksh

	fake_csh() { csh $*; reorient ; }
	alias csh=fake_csh

	fake_tcsh() { tcsh $*; reorient ; }
	alias tcsh=fake_tcsh

	fake_zsh() { zsh $*; reorient ; }
	alias zsh=fake_zsh

	fake_bash() { bash $*; reorient ; }
	alias bash=fake_bash

	fake_tcl() { tcl $*; reorient ; }
	alias tcl=fake_tcl

	## Step E.
	reorient
fi
