#!/bin/sh
# Convert a TeXinfo or LaTeXinfo file to a GNU Emacs info file.
# The file type is determined automatically.
# [06-Mar-1996] -- update to remove absolute paths from -load options
# [04-Oct-1991] -- original version
for f in $*
do
	if grep -s '^\\input texinfo' $f
	then
		echo "Processing TeXinfo file: $f"
		emacs-19.29 -batch -funcall batch-texinfo-format $f
	elif grep -s '^\\documentstyle.*latexinfo' $f
	then
		echo "Processing LaTeXinfo file: $f"
		emacs-19.29 -batch \
			-load latexinfomd.el \
			-load latexinfo.el \
			-funcall batch-latexinfo-format \
			$f | egrep -v '^Mark set|^Done'
	else
		echo "Don't know what kind of file this is: $f"
	fi
done