From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/19857 Path: main.gmane.org!not-for-mail From: Fabrice POPINEAU Newsgroups: gmane.emacs.gnus.general Subject: Re: weirdness wrt file-coding Date: 14 Dec 1998 14:29:21 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: <5b67blf8hd.fsf@brandy.cs.rochester.edu> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 X-Trace: main.gmane.org 1035158130 13743 80.91.224.250 (20 Oct 2002 23:55:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:55:30 +0000 (UTC) Cc: ding@gnus.org 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 IAA26568 for ; Mon, 14 Dec 1998 08:27:23 -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 HAA04132; Mon, 14 Dec 1998 07:26:45 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 14 Dec 1998 07:26:53 -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 HAA01906 for ; Mon, 14 Dec 1998 07:26:44 -0600 (CST) Original-Received: from esemetz.ese-metz.fr (esemetz.ese-metz.fr [193.48.224.212]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id IAA26555 for ; Mon, 14 Dec 1998 08:26:31 -0500 (EST) Original-Received: from NEUROMANCER.ese-metz.fr (neuromancer.ese-metz.fr [193.48.224.95]) by esemetz.ese-metz.fr (8.9.1a/8.9.1) with SMTP id OAA19367; Mon, 14 Dec 1998 14:26:42 +0100 Original-To: Shenghuo ZHU In-Reply-To: Shenghuo ZHU's message of "09 Dec 1998 13:58:22 -0500" User-Agent: Gnus/5.070065 (Pterodactyl Gnus v0.65) XEmacs/21.0(beta60) (Poitou60) Precedence: list X-Majordomo: 1.94.jlt7 Original-Lines: 79 Xref: main.gmane.org gmane.emacs.gnus.general:19857 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:19857 Shenghuo ZHU writes: > 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). Great ! I was looking for something along these lines, and it seems to work ok. Not extensively tested, but got some hundred of messages tight as expected. Thanks, Fabrice > 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)) >