[net.emacs] Problem with princ

michaelm@bcsaic.UUCP (michael b maxwell) (12/17/85)

I'm trying to use Gnuemacs in batch mode on a series of files, and I'm having 
a problem with princ.  It prints out a series of buffer-substrings, as desired,
then stops still on the screen; it finally prints out a few more substrings 
immediately before halting, but nowhere near everything it was supposed to 
print out.  Maybe a simplified (and therefore rather silly) example will help.
The command line is:
	emacs -batch foo.l -l princ.test.el -kill
The file princ.test.el contains the ff. procedure and its call:
	(defun princ-file ()
	  (goto-char 1)
	  (while (not (eobp))
	         (setq startmark (dot))
	         (forward-word 1)
	         (setq endmark (dot))
	         (princ (buffer-substring startmark endmark))))
	(princ-file)
When this runs, it prints out the first three lines or so of foo.l,
pauses, prints out one more line, and stops.
Substituting "print" or "prin1" for "princ" makes it work, although at
the cost of a bunch of quotes that I don't need...  Surrounding "princ" 
with terpri's doesn't help, either.  Seems like a buffering problem, but why 
does prin1 work?
I looked in the Gnu command summary for something like Franz Lisp's "drain",
but couldn't find anything.  What am I doing wrong?
This happens on BSD 4.2 and a Sun 2.0; also a VAX 780 with Ultrix 1.1.  
Either csh or Bourne shell.  Same thing happens if output is redirected to a 
file.  Compiling the file princ.test makes no significant difference.
-- 
Mike Maxwell
Boeing Artificial Intelligence Center
	...uw-beaver!uw-june!bcsaic!michaelm