(require 'custom)
(require 'gnus-util)
(require 'mail-source)
-(require 'mm-util)
(eval-and-compile
(autoload 'gnus-error "gnus-util")
(defvar nnmail-file-coding-system 'raw-text
"Coding system used in nnmail.")
-(defvar nnmail-incoming-coding-system
- mm-text-coding-system
+(defvar nnmail-incoming-coding-system 'raw-text
"Coding system used in reading inbox")
(defvar nnmail-pathname-coding-system 'binary
(let ((format-alist nil)
(after-insert-file-functions nil))
(condition-case ()
- (let ((coding-system-for-read nnmail-file-coding-system)
- (auto-mode-alist (nnheader-auto-mode-alist))
+ (let ((auto-mode-alist (nnheader-auto-mode-alist))
(pathname-coding-system nnmail-pathname-coding-system))
- (insert-file-contents file)
+ (insert-file-contents-as-coding-system
+ nnmail-file-coding-system file)
t)
(file-error nil))))
(concat dir group "/")
;; If not, we translate dots into slashes.
(concat dir
- (mm-encode-coding-string
+ (encode-coding-string
(nnheader-replace-chars-in-string group ?. ?/)
nnmail-pathname-coding-system)
"/")))
(defun nnmail-save-active (group-assoc file-name)
"Save GROUP-ASSOC in ACTIVE-FILE."
- (let ((coding-system-for-write nnmail-active-file-coding-system))
+ (let ((coding-system-for-write nnmail-active-file-coding-system)
+ (output-coding-system nnmail-active-file-coding-system))
(when file-name
(with-temp-file file-name
(nnmail-generate-active group-assoc)))))
(set-buffer (get-buffer-create " *nnmail incoming*"))
(erase-buffer)
(let ((nnheader-file-coding-system nnmail-incoming-coding-system))
- (mm-insert-file-contents incoming))
+ (nnheader-insert-file-contents incoming))
(prog1
(if (zerop (buffer-size))
0
(insert (format "Xref: %s" (system-name)))
(while group-alist
(insert (format " %s:%d"
- (mm-encode-coding-string
+ (encode-coding-string
(caar group-alist)
nnmail-pathname-coding-system)
(cdar group-alist)))
(setq value (cdr (assq value nnmail-split-abbrev-alist))))
(while (and (goto-char end-point)
(re-search-backward (cdr cached-pair) nil t))
- (when nnmail-split-tracing
- (push (cdr cached-pair) nnmail-split-trace))
- (let ((split-rest (cddr split))
- (end (match-end 0))
- ;; The searched regexp is \(\(FIELD\).*\)\(VALUE\). So,
- ;; start-of-value is the the point just before the
- ;; beginning of the value, whereas after-header-name is
- ;; the point just after the field name.
- (start-of-value (match-end 1))
- (after-header-name (match-end 2)))
+ (when nnmail-split-tracing
+ (push (cdr cached-pair) nnmail-split-trace))
+ (let ((split-rest (cddr split))
+ (end (match-end 0))
+ ;; The searched regexp is \(\(FIELD\).*\)\(VALUE\). So,
+ ;; start-of-value is the the point just before the
+ ;; beginning of the value, whereas after-header-name is
+ ;; the point just after the field name.
+ (start-of-value (match-end 1))
+ (after-header-name (match-end 2)))
;; Start the next search just before the beginning of the
;; VALUE match.
(setq end-point (1- start-of-value))
- ;; Handle - RESTRICTs
- (while (eq (car split-rest) '-)
- ;; RESTRICT must start after-header-name and
- ;; end after start-of-value, so that, for
- ;; (any "foo" - "x-foo" "foo.list")
- ;; we do not exclude foo.list just because
- ;; the header is: ``To: x-foo, foo''
- (goto-char end)
- (if (and (re-search-backward (cadr split-rest)
- after-header-name t)
- (> (match-end 0) start-of-value))
- (setq split-rest nil)
- (setq split-rest (cddr split-rest))))
- (when split-rest
- (goto-char end)
- (let ((value (nth 1 split)))
- (if (symbolp value)
- (setq value (cdr (assq value nnmail-split-abbrev-alist))))
- ;; Someone might want to do a \N sub on this match, so get the
- ;; correct match positions.
- (re-search-backward value start-of-value))
+ ;; Handle - RESTRICTs
+ (while (eq (car split-rest) '-)
+ ;; RESTRICT must start after-header-name and
+ ;; end after start-of-value, so that, for
+ ;; (any "foo" - "x-foo" "foo.list")
+ ;; we do not exclude foo.list just because
+ ;; the header is: ``To: x-foo, foo''
+ (goto-char end)
+ (if (and (re-search-backward (cadr split-rest)
+ after-header-name t)
+ (> (match-end 0) start-of-value))
+ (setq split-rest nil)
+ (setq split-rest (cddr split-rest))))
+ (when split-rest
+ (goto-char end)
+ (let ((value (nth 1 split)))
+ (if (symbolp value)
+ (setq value (cdr (assq value nnmail-split-abbrev-alist))))
+ ;; Someone might want to do a \N sub on this match, so get the
+ ;; correct match positions.
+ (re-search-backward value start-of-value))
(dolist (sp (nnmail-split-it (car split-rest)))
(unless (memq sp split-result)
(push sp split-result))))))
partial regexp)
(if (symbolp value)
(setq value (cdr (assq value nnmail-split-abbrev-alist))))
- (if (string= ".*" (substring value 0 2))
+ (if (and (>= (length value) 2)
+ (string= ".*" (substring value 0 2)))
(setq value (substring value 2)
partial ""))
(setq regexp (concat "^\\(\\("
(setq nnmail-cache-buffer
(get-buffer-create " *nnmail message-id cache*")))
(when (file-exists-p nnmail-message-id-cache-file)
- (mm-insert-file-contents nnmail-message-id-cache-file))
+ (nnheader-insert-file-contents nnmail-message-id-cache-file))
(set-buffer-modified-p nil)
(current-buffer))))
(defun nnmail-write-region (start end filename &optional append visit lockname)
"Do a `write-region', and then set the file modes."
- (let ((coding-system-for-write nnmail-file-coding-system)
- (pathname-coding-system nnmail-pathname-coding-system))
- (write-region start end filename append visit lockname)
+ (let ((pathname-coding-system nnmail-pathname-coding-system))
+
+ (write-region-as-coding-system
+ nnmail-file-coding-system start end filename append visit lockname)
(set-file-modes filename nnmail-default-file-modes)))
;;;