# ;$Id: nmh.txt,v 1.1 2004/09/02 21:21:00 root Exp $ # nmh folder completion # run 'folders -fast -recurse > ~/Mail/.folders' # for this to work. # # version info # # 1.0 first version, works for me. # 1.1 change the COMPREPLY based on suggestion from # Steve Simmons to make it more portable _nmh () { local cur folder newfolder COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} newfolder=() folder=`echo $cur | sed -e 's|/|\\\/|g' -e 's/^+//'` COMPREPLY=($(awk '{if ($1 ~ /^'$folder'/) print "+"$1}' $(mhpath +)/.folders)) return 0 } complete -F _nmh folder refile