From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/19776 Path: main.gmane.org!not-for-mail From: Shenghuo ZHU Newsgroups: gmane.emacs.gnus.general Subject: Re: weirdness wrt file-coding Date: 09 Dec 1998 13:58:22 -0500 Organization: Computer Dept of U Rochester Sender: owner-ding@hpc.uh.edu Message-ID: <5b67blf8hd.fsf@brandy.cs.rochester.edu> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 X-Trace: main.gmane.org 1035158064 13326 80.91.224.250 (20 Oct 2002 23:54:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:54:24 +0000 (UTC) Return-Path: Original-Received: from gizmo.hpc.uh.edu (gizmo.hpc.uh.edu [129.7.102.31]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id OAA18679 for ; Wed, 9 Dec 1998 14:00:53 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@sina.hpc.uh.edu [129.7.3.5]) by gizmo.hpc.uh.edu (8.9.1/8.9.1) with ESMTP id MAA20509; Wed, 9 Dec 1998 12:58:58 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 09 Dec 1998 12:59:00 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id MAA11994 for ; Wed, 9 Dec 1998 12:58:46 -0600 (CST) Original-Received: from cayuga.cs.rochester.edu (cayuga.cs.rochester.edu [192.5.53.209]) by sclp3.sclp.com (8.8.5/8.8.5) with SMTP id NAA18632 for ; Wed, 9 Dec 1998 13:58:34 -0500 (EST) Original-Received: from slate.cs.rochester.edu (slate.cs.rochester.edu [192.5.53.101]) by cayuga.cs.rochester.edu (8.6.9/O) with ESMTP id NAA02866 for ; Wed, 9 Dec 1998 13:58:24 -0500 Original-Received: from brandy.cs.rochester.edu (brandy.cs.rochester.edu [192.5.53.199]) by slate.cs.rochester.edu (8.6.9/O) with ESMTP id NAA00480 for ; Wed, 9 Dec 1998 13:58:23 -0500 Original-Received: (from zsh@localhost) by brandy.cs.rochester.edu (SMI-8.6/N++) id NAA29425; Wed, 9 Dec 1998 13:58:23 -0500 Original-To: ding@gnus.org X-Attribution: ZSH X-Face: 'IF:e51ib'Qbl^(}l^&4-J`'P!@[4~O|&k#:@Gld#b/]oMq&`&FVY._3+b`mzp~Jeve~/#/ ERD!OTe<86UhyN=l`mrPY)M7_}`Ktt\K+58Z!hu7>qU,i.N7TotU[FYE(f1;}`g2xj!u*l`^&=Q!g{ *q|ddto|nkt"$r,K$[)"|6,elPH= GJ6Q In-Reply-To: Fabrice POPINEAU's message of "09 Dec 1998 14:26:15 +0100" User-Agent: Gnus/5.070065 (Pterodactyl Gnus v0.65) Emacs/20.3 Precedence: list X-Majordomo: 1.94.jlt7 Original-Lines: 96 Xref: main.gmane.org gmane.emacs.gnus.general:19776 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:19776 >>>>> "FP" == Fabrice POPINEAU writes: FP> Using xemacs-21.0b57 and xemacs-21.2b5 (NT, compiled natively), I FP> can only report weirdness due to incorrect file type guessing or FP> conversion in gnus. I'm using pgnus-0.65. The file retrieved by FP> movemail is put into ~/.gnus-crash-box and parsed in the buffer FP> named " *nnmail incoming*". FP> But the parsing fails before the end of the file (function FP> nnmail-process-babyl-mail-format, re-search-forward returns nil, FP> delete-region is then called with 0 :-( ). FP> Switching to the buffer shows that there are '^M' at the end of FP> each line. Toggling the file coding to 'noconv' manually, and FP> then rewriting .gnus-crash-box enables to read the messages FP> correctly next time gnus is run. FP> It acts like if the file was read in text mode, but the conversion FP> binary -> text failed, and the specified file-coding is text FP> anyway. FP> At first, I thought it was apel playing with file-coding, and that FP> just removing 'tm' use from gnus-setup would do the trick. But FP> unfortunately, there is a deeper problem. Try this patch. A new variable mm-text-coding-system is added. It is no-conversion in XEmacs (Unix or NT), raw-text in Emacs, raw-text-dos in NTEmacs (I guess raw-text != raw-text-dos in NTEmacs). -- Shenghuo ChangeLog: Wed Dec 9 13:30:29 1998 Shenghuo ZHU * mm-util.el (mm-running-ntemacs): New variable. (mm-text-coding-system): Ditto. * nnmail.el (nnmail-incoming-coding-system): Ditto. (nnmail-split-incoming): Use nnmail-incoming-coding-system. :- cut ------------- --- mm-util.el 1998/12/09 16:40:43 1.1 +++ mm-util.el 1998/12/09 18:30:18 @@ -26,10 +26,25 @@ (defvar mm-running-xemacs (string-match "XEmacs" emacs-version)) +(defvar mm-running-ntemacs + (and (not mm-running-xemacs) + (string-match "nt" system-configuration))) + (defvar mm-binary-coding-system (if mm-running-xemacs 'binary 'no-conversion) "100% binary coding system.") + +(defvar mm-text-coding-system + (cond + ((not (fboundp 'coding-system-p)) nil) + (mm-running-xemacs ;; XEmacs + (and (coding-system-p 'no-conversion) 'no-conversion)) + (mm-running-ntemacs ;; NTEmacs + (and (coding-system-p 'raw-text-dos) 'raw-text-dos)) + ((coding-system-p 'raw-text) 'raw-text) ;; Emacs + (t nil)) + "100% text coding system, for removing ^M.") (defvar mm-default-coding-system nil "The default coding system to use.") --- nnmail.el 1998/12/09 18:31:41 1.1 +++ nnmail.el 1998/12/09 18:36:06 @@ -501,6 +501,10 @@ 'raw-text-dos 'binary) "Another coding system used in nnmail.") +(defvar nnmail-incoming-coding-system + mm-text-coding-system + "Coding system used in reading inbox") + (defun nnmail-find-file (file) "Insert FILE in server buffer safely." (set-buffer nntp-server-buffer) @@ -1007,7 +1011,8 @@ ;; Insert the incoming file. (set-buffer (get-buffer-create " *nnmail incoming*")) (erase-buffer) - (nnheader-insert-file-contents incoming) + (let ((nnheader-file-coding-system nnmail-incoming-coding-system)) + (nnheader-insert-file-contents incoming)) (unless (zerop (buffer-size)) (goto-char (point-min)) (save-excursion (run-hooks 'nnmail-prepare-incoming-hook))