From owner-ntemacs-users@trout  Thu Apr 10 15:36:05 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Thu" "10" "April" "1997" "14:57:41" "-0700" "Chris McMahan" "cmcmahan@teknowledge.com" nil "245" "Re: file name completion" "^From:" nil nil "4" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id PAA08334 for <voelker@june.cs.washington.edu>; Thu, 10 Apr 1997 15:36:05 -0700
Received: from trout.cs.washington.edu (trout.cs.washington.edu [128.95.1.178]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id PAA30254 for <voelker@joker.cs.washington.edu>; Thu, 10 Apr 1997 15:36:00 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by trout.cs.washington.edu (8.8.5+CS/7.2ws+) with ESMTP id OAA21399 for <ntemacs-users@trout.cs.washington.edu>; Thu, 10 Apr 1997 14:57:44 -0700 (PDT)
Received: from argon.Teknowledge.COM (argon.Teknowledge.COM [128.136.240.8]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with ESMTP id OAA04842 for <ntemacs-users@cs.washington.edu>; Thu, 10 Apr 1997 14:57:43 -0700
Received: from URANIUM.teknowledge.com (uranium.Teknowledge.COM [128.136.10.200]) by argon.Teknowledge.COM (8.7.1/8.7.1) with SMTP id OAA20031; Thu, 10 Apr 1997 14:57:41 -0700 (PDT)
Message-Id: <199704102157.OAA20031@argon.Teknowledge.COM>
In-Reply-To: <9704101949.AA02898@teqila.gte.com>
References: <9704101949.AA02898@teqila.gte.com>
From: Chris McMahan <cmcmahan@Teknowledge.COM>
To: js01@gte.com (John Seltzer)
Cc: ntemacs-users@cs.washington.edu
Subject: Re: file name completion
Date: Thu, 10 Apr 1997 14:57:41 -0700 (PDT)

Sorry for the length of this post, but I think it may be useful to
others as well.

I too am using tcsh within emacs on NT4.0, with no problems

I've got the following environment variable set, which causes emacs to
use tcsh as the shell: 
  ESHELL c:/Utils/Unix_tools/bin/tcsh.exe

Here's a copy of the relevant parts of my .emacs, as well as my
.tcshrc

-----------------------------------.emacs-----------------------------------
;;;; --------------------------------------------------
;;;; Set up the shell for the shell mode
(defun my-shell-mode-hook ()
  (interactive)
  (setq shell-completion-fignore '("~" "#" "%" ".class"))
  (setq comint-completion-addsuffix '("/" . " "))
  (setq completion-ignored-extensions '(".o" ".elc" "~" ".bin" ".bak"
".obj" ".map" ".dvi" ".toc" ".log" ".aux" ".a" ".ln" ".lof" ".blg"
".bbl" ".glo" ".idx" ".lot" ".fmt" ".class"))
)
(setq shell-mode-hook nil)
(add-hook 'shell-mode-hook 'my-shell-mode-hook)


-----------------------------------.tchsrc-----------------------------------
#set verbose
# 	set environmental variables
#	setenv EDITOR vi.exe
#	setenv PAGER /usr/bin/less
#	setenv DISPLAY unix:0
	setenv LESS "-B -c -h4 -i -M -q -x4"
	setenv SHELL C:/Utils/Unix_tools/bin/tcsh.exe

if ($?PROCESSOR_ARCHITECTURE) then
	setenv USER  $USERNAME
	setenv LOGNAME $USER
	setenv HOSTNAME $COMPUTERNAME
endif

	umask 077

if (! $?prompt) then	# Everything else is interactive
	exit(0)
endif

#tcsh-specific stuff
if ($?tcsh) then
# 	bindkey -v 
	set autolist
	set savedirs=100
	set listlinks
	set tperiod=15
	set autocorrect
	set pushdtohome
	set visiblebell

	set ellipsis
	set rmstar

#	set prompt='%{f9%}%/%{gg%}(%{f2%}%?%{gg%})\>'
#	set prompt="%{71%}[%t][%/]>%{gg%} "
#	set prompt="%{1e%}[%t]%/>%{gg%} "
	set prompt="[%t]%/> "

	if ($?loginsh) set correct=all

	set prompt3 = '%{fc%}Do you mean: %R ?(y|n|e)%{gg%} '
#	set printexitvalue
	set complete=enhance

	complete which 'p/*/c/'
	complete where 'p/*/c/'
	complete start 'p/*/c/'
	complete cd 'p/1/d/'
	complete pushd 'p/1/d/'
	complete popd 'p/1/d/'
	complete tar 'n/-tvf/t:*.tar/' 'n/-xvf/t:*.tar/' 
	complete winhlp32 'p/*/f:*.HLP/'
	complete pkunzip 'p/*/f:*.{ZIP,zip}/'
	complete pkzip 'p/*/f:*.{zip,ZIP}/'
	complete nmake 'p/*/f:*.MAK/'
	complete bindkey 'p/*/b/'

# complex completions

set noglob
    complete gzip	c/--/"(stdout to-stdout decompress uncompress \
			force help list license no-name quiet recurse \
			suffix test verbose version fast best)"/ \
			c/-/"(c d f h l L n q r S t v V 1 2 3 4 5 6 7 8 9 -)"/\
			n/{-S,--suffix}/x:'<file_name_suffix>'/ \
			n/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
			N/{-d,--{de,un}compress}/f:*.{gz,Z,z,zip,taz,tgz}/ \
			n/*/f:^*.{gz,Z,z,zip,taz,tgz}/
    complete {gunzip,ungzip} c/--/"(stdout to-stdout force help list license \
			no-name quiet recurse suffix test verbose version)"/ \
			c/-/"(c f h l L n q r S t v V -)"/ \
			n/{-S,--suffix}/x:'<file_name_suffix>'/ \
			n/*/f:*.{gz,Z,z,zip,taz,tgz}/
    complete mv		c/--/"(backup force interactive update verbose suffix \
			version-control help version)"/ \
			c/-/"(b f i u v S V -)"/ \
			n/{-S,--suffix}/x:'<suffix>'/ \
			n/{-V,--version-control}/"(t numbered nil existing \
			never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/
    complete cp		c/--/"(archive backup no-dereference force interactive \
			link preserve symbolic-link update verbose parents \
			one-file-system recursive suffix version-control help \
			version)"/ c/-/"(a b d f i l p r s u v x P R S V -)"/ \
			n/-*r/d/ n/{-S,--suffix}/x:'<suffix>'/ \
			n/{-V,--version-control}/"(t numbered nil existing \
			never simple)"/ n/-/f/ N/-/d/ p/1/f/ p/2/d/ n/*/f/

    complete net p/1/"(accounts computer config continue file group \
			help helpmsg localgroup name pause print send session \
			share start statistics stop time use user view)"/ \
			n/config/"(server workstation)"/ \
#			C/\/user\:/"(pss-windsnet\amold redmond\amold)"/ \
			n/help/"(accounts computer config continue file group \
			help helpmsg localgroup name pause print send session \
			share start statistics stop time use user view)"/ 

    complete cl c@-@"(O G F C D E P  U u I X v Z \? c H J nologo T V \
			w W Y M  L link)"@ \
#			n@-link@'`cmd /c dir /b e:\lang\msdev\lib`'@ \
			n@-link@'`ls -1 e:/lang/msdev/lib`'@ \
			c/-O/"(1 2 a b d g i p s t w x y)"/ \
			c/-G/"(3 4 5 B d r z e s f y h X)"/ \
			c/-F/"(a A d e m o p r R)"/ \
			c/-Z/"(i 7 d p a e g l z)"/ \
			c/-M/"(T D L)"/ \
			n@*@f:*.{c,C,cpp,CPP}@
unset noglob
#end completions

	bindkey -b ^W backward-delete-word
	bindkey -b ^U backward-kill-line
	bindkey -b M-g list-glob
	bindkey -b M-* expand-glob
	bindkey -b M-w normalize-command
	bindkey -b M-/ which-command

# NT specific bindkey extensions
	bindkey -b N-up up-history
	bindkey -b N-down down-history
	bindkey -b N-right forward-char
	bindkey -b N-left backward-char
	bindkey -b N-del delete-char
	bindkey -b N-ins overwrite-mode
	bindkey -b N-1 which-command
	bindkey -b N-2 expand-history
	bindkey -b N-3 complete-word-raw
	bindkey -b N-home beginning-of-line
	bindkey -b N-end end-of-line

#csh stuff
else 
	set sedstr = "s:/[^/]*/[^/]*/[^/]*/::"
	set prompt="`echo $cwd | sed -e 's:/[^/]*/[^/]*/[^/]*/::'`>"
	alias cd ' cd \!*; set prompt=`echo $cwd | sed -e "$sedstr"`\>'
	alias pushd ' pushd \!*; set prompt=`echo $cwd | sed -e "$sedstr"`\>'
	alias popd ' popd \!*; set prompt=`echo $cwd | sed -e "$sedstr"`\>'
endif

#common to tcsh and csh


set notify
set path=($path .)
set cdpath=( C:/ D:/ E:/ H:/samples )
set noclobber
set filec
set history=(1000) 
#"%h  %T   %{a2%}%R%{gg%}\n")
#set histdup=all
set savehist=50
set ignoreeof
set fignore =(.obj .pdb .bsc .ilk .idb  .OBJ .PDB .BSC .ILK .IDB)


alias	ls  ls -F 
alias 	h   history

#
# use the win32gnu utils for the following. or the win32sdk ones if you prefer.
# PLEASE don't alias them to the posix utils in the reskit..
#
alias 	rm 	'c:/Utils/Unix_tools/bin/rm.exe -i'
alias   RM      'c:/Utils/Unix_tools/bin/rm.exe -f'
alias 	rd	'c:/Utils/Unix_tools/bin/rmdir.exe'
alias 	md	'c:/Utils/Unix_tools/bin/mkdir.exe'
alias 	mv	'c:/Utils/Unix_tools/bin/mv.exe -i'
alias   cp  	'c:/Utils/Unix_tools/bin/cp.exe -i'

# set up the alias list to use
alias find	'rkfind'
alias dir	'ls -asFC'
alias l 	'ls -sFC'
alias ll	'ls -lagF'
alias lw	'ls -sFC'

alias winhelp   'start winhlp32'

alias explore   'start c:/Program\ Files/Plus\\!/Microsoft\ Internet/IEXPLORE'

alias emacs	'emacs -nw'
alias wemacs	'start c:/emacs-19.33/bin/gnuclientw.exe -F'
alias winzip	'start c:/Utils/WinZip/WINZIP32.EXE'

alias fix       'set prompt = "[%t] %/> "'
alias fancy     'set prompt="%{1b%}[%t]%{1e%}%/>%{gg%} "'




John Seltzer writes:
 > I just started using shell mode in NT emacs for the first time (19.34.1)
 > I'm using Reed Kotler's tcsh.exe, but I don't think this matters.
 > 
 > When I use the TAB key in the shell buffer to get file name completion,
 > it only works if I start from the drive name.
 > (e.g. tabing on , cd c:/unixTools/reed
 > yields 
 > c:/unixTools/reedKotler
 > 
 > However, if I am cwd is currently c:/unixTools, and I do something like:
 > 
 > cd ../reed
 > 
 > I get the following error in the minibuffer:
 > No completions of ..\reed
 > 
 > *** Notice the change in direction of the slash.
 > 
 > ***** However, If I invoke tcsh in my MSDOS window, the file name
 > completion works perfectly well.
 > 
 > So, the problem seems to be an emacs setup issue.
 > 
 > -- 
 > John Seltzer (js01@gte.com)
 > 

