Subject: vm-pop and text crash box files

From: [email-masked]
Date: Mon, 30 Dec 1996 15:27:00 -0500

GNUemacs 19.34 on Win95; VM 5.96 (beta).

When vm-pop reads messages, it accumulates them in a scratch buffer
and then writes the buffer to the VM crash box.  NTemacs can decide on
whether a file is binary or text (in the DOS sense) based on a regexp
look at the filename.  Unfortunately, this doesn't work (as far as I
can tell) with buffers not affiliated with files.  The end result is
that when VM does the write-region in to the crash box, there is a
good chance of it treating it like a text file, thereby putting back
the extra CRs that vm-pop goes to the trouble to strip.  (Whether it
treats the crash box as binary or text depends on individual
configuration.)

My workaround for this is to explicitly type the buffer as binary when
it is created.  I now have a section like this in vm-pop.el's
vm-pop-move-mail:

	  ;; get the trace buffer
	  (setq process-buffer
		(get-buffer-create (format "trace of POP session to %s" host)))
	  ;; clear the trace buffer of old output
	  (save-excursion
	    (set-buffer process-buffer)
		;; [email-masked] ... make trace buffer binary to avoid extra ^M crud
		(if (boundp 'buffer-file-type)
			(setq buffer-file-type t))
		;; [email-masked]
	    (erase-buffer))

If anyone knows of a solution for this that doesn't require changing
VM code (e.g., a way to type buffers by buffer name instead of
filename), I'd love to hear it.
-- 
  [email-masked]                    LZ 1C-320
  [email-masked]      (Voice/Fax) +1.908.576.2932
  AT&T Labs       /       AT&T WorldNet Service

---

From: [email-masked]
Date: Mon, 6 Jan 1997 10:30:41 -0500

gv> There is no way to type buffers by name instead of filename.  But
gv> why do the contents of the scratch buffer have to be written out
gv> as binary?

Strictly speaking, they don't.

But, I have the filename typing set to treat all my mailboxes as
binary.  That way, they mail folder format is exactly identical to the
UNIX version.  I have often just copied a mail folder one way or the
other.

As far as I know, VM behaves OK if the file is text, but when I claim
it to be binary, it displays the extra ^Ms.
-- 
  [email-masked]                    LZ 1C-320
  [email-masked]      (Voice/Fax) +1.908.576.2932
  AT&T Labs       /       AT&T WorldNet Service