Source

vm / vm-pop.el

Diff from to

File vm-pop.el

 	  (setq process-buffer
 		(generate-new-buffer (format "trace of POP session to %s"
 					     host)))
-	  ;; Tell XEmacs/MULE not to mess with the text.
-	  (and vm-xemacs-mule-p
-	       (set-buffer-file-coding-system 'binary t))
-	  ;; clear the trace buffer of old output
 	  (save-excursion
 	    (set-buffer process-buffer)
 	    (buffer-disable-undo process-buffer)
-	    (erase-buffer))
-	  ;; open the connection to the server
-	  (setq process (open-network-stream "POP" process-buffer host port))
-	  (and (null process) (throw 'done nil))
-	  (process-kill-without-query process)
-	  (save-excursion
-	    (set-buffer process-buffer)
+	    ;; clear the trace buffer of old output
+	    (erase-buffer)
+	    ;; Tell MULE not to mess with the text.
+	    (if (or vm-xemacs-mule-p vm-fsfemacs-mule-p)
+		(set-buffer-file-coding-system 'binary t))
+	    (insert "starting POP session " (current-time-string) "\n")
+	    (insert (format "connecting to %s:%s\n" host port))
+	    ;; open the connection to the server
+	    (setq process (open-network-stream "POP" process-buffer host port))
+	    (and (null process) (throw 'done nil))
+	    (insert "connected\n")
+	    (process-kill-without-query process)
 	    (make-local-variable 'vm-pop-read-point)
-	    (setq vm-pop-read-point (point-min))
+	    (setq vm-pop-read-point (point))
 	    (if (null (setq greeting (vm-pop-read-response process t)))
 		(progn (delete-process process)
 		       (throw 'done nil)))
     ;; the CRLF or the LF newline convention is used on the inbox
     ;; associated with this crashbox.  This setting assumes the LF
     ;; newline convention is used.
-    (let ((buffer-file-type t))
+    (let ((buffer-file-type t)
+	  (selective-display nil))
       (write-region start end crash t 0))
     (delete-region start end)
     t ))
 	(save-excursion
 	  (setq buffer (generate-new-buffer "*vm-work*"))
 	  (set-buffer buffer)
+	  ;; call-process-region calls write-region.
+	  ;; don't let it do CR -> LF translation.
+	  (setq selective-display nil)
 	  (insert string)
 	  (call-process-region (point-min) (point-max)
 			       "/bin/sh" t buffer nil