Importing pgnus-0.69
[elisp/gnus.git-] / lisp / nnmail.el
index c852ad8..7151f6f 100644 (file)
@@ -454,6 +454,11 @@ parameter.  It should return nil, `warn' or `delete'."
   :group 'nnmail
   :type '(repeat symbol))
 
+(defcustom nnmail-split-header-length-limit 1024
+  "Header lines longer than this limit are excluded from the split function."
+  :group 'nnmail
+  :type 'integer)
+
 ;;; Internal variables.
 
 (defvar nnmail-split-history nil
@@ -496,6 +501,15 @@ parameter.  It should return nil, `warn' or `delete'."
 (defvar nnmail-file-coding-system 'binary
   "Coding system used in nnmail.")
 
+(defvar nnmail-file-coding-system-1 
+  (if (string-match "nt" system-configuration)
+      '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)
@@ -1002,7 +1016,8 @@ FUNC will be called with the buffer narrowed to each mail."
       ;; 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))
@@ -1053,8 +1068,8 @@ FUNC will be called with the group name to determine the article number."
        (goto-char (point-min))
        (while (not (eobp))
          (end-of-line)
-         (if (> (current-column) 1024)
-             (gnus-delete-line)
+         (if (> (current-column) nnmail-split-header-length-limit)
+             (delete-region (point) (progn (end-of-line) (point)))
            (forward-line 1)))
        ;; Allow washing.
        (goto-char (point-min))