;; Copyright (C) 1997,98 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Tatsuya Ichikawa <t-ichi@po.shiojiri.ne.jp>
;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; Copyright (C) 1996,97,98 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
-;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Katsumi Yamaoka <yamaoka@jpl.org>
;; Keywords: mail, news, MIME
;; This file is part of GNU Emacs.
:group 'gnus-article-mime
:type 'function)
-(defcustom gnus-article-display-method-for-encoded-word
- 'gnus-article-display-message-with-encoded-word
- "*Function to display a message with MIME encoded-words.
-The function is called from the article buffer."
- :group 'gnus-article-mime
- :type 'function)
-
(defcustom gnus-article-display-method-for-traditional
'gnus-article-display-traditional-message
"*Function to display a traditional message.
(substring name (match-end 0))))))
(setq gnus-article-buffer name)
(setq gnus-original-article-buffer original)
- (setq gnus-article-mime-handle-alist nil)
;; This might be a variable local to the summary buffer.
(unless gnus-single-article-buffer
(save-excursion
(defun gnus-article-display-mime-message ()
"Article display method for MIME message."
;; called from `gnus-original-article-buffer'.
- (let ((default-mime-charset (save-excursion
- (set-buffer gnus-summary-buffer)
- default-mime-charset)))
+ (let ((charset (with-current-buffer gnus-summary-buffer
+ default-mime-charset)))
+ (make-local-variable 'default-mime-charset)
+ (setq default-mime-charset charset)
(mime-display-message mime-message-structure
- gnus-article-buffer nil gnus-article-mode-map))
+ gnus-article-buffer nil gnus-article-mode-map)
+ (make-local-variable 'default-mime-charset)
+ (setq default-mime-charset charset)
+ )
;; `mime-display-message' changes current buffer to `gnus-article-buffer'.
(make-local-variable 'mime-button-mother-dispatcher)
(setq mime-button-mother-dispatcher
(erase-buffer)
(insert-buffer-substring gnus-original-article-buffer)))
-(defun gnus-article-display-message-with-encoded-word ()
- "Article display method for message with encoded-words."
- (let ((charset (save-excursion
- (set-buffer gnus-summary-buffer)
- default-mime-charset)))
- (gnus-article-display-traditional-message)
- (let (buffer-read-only)
- (eword-decode-header charset)
- (goto-char (point-min))
- (if (search-forward "\n\n" nil t)
- (decode-mime-charset-region (match-end 0) (point-max) charset)))
- (mime-maybe-hide-echo-buffer))
- (gnus-run-hooks 'gnus-mime-article-prepare-hook))
-
(defun gnus-article-prepare (article &optional all-headers header)
"Prepare ARTICLE in article mode buffer.
ARTICLE should either be an article number or a Message-ID.
(defun gnus-article-prepare-display ()
"Make the current buffer look like a nice article."
- (let ((method (if gnus-show-mime
- (progn
- (mime-parse-buffer)
- gnus-article-display-method-for-mime)
- gnus-article-display-method-for-traditional)))
- ;; Hooks for getting information from the article.
- ;; This hook must be called before being narrowed.
+ (let ((method
+ (if gnus-show-mime
+ (progn
+ (setq mime-message-structure gnus-current-headers)
+ gnus-article-display-method-for-mime)
+ gnus-article-display-method-for-traditional)))
(gnus-run-hooks 'gnus-tmp-internal-hook)
(gnus-run-hooks 'gnus-article-prepare-hook)
;; Display message.
;; Copyright (C) 1995,96,97,98 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Tatsuya Ichikawa <t-ichi@po.shiojiri.ne.jp>
;; Keywords: news
;; This file is part of GNU Emacs.
;; [number subject from date id references chars lines xref]
(insert (format "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t\n"
(mail-header-number headers)
- (let ((subject (mail-header-subject headers)))
- (or (get-text-property 0 'raw-text subject)
- subject))
- (let ((from (mail-header-from headers)))
- (or (get-text-property 0 'raw-text from)
- from))
+ (mime-fetch-field 'Subject headers)
+ (mime-fetch-field 'From headers)
(mail-header-date headers)
(mail-header-id headers)
(or (mail-header-references headers) "")
;; Copyright (C) 1997,98 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
-;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Tatsuya Ichikawa <t-ichi@po.shiojiri.ne.jp>
+;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Tatsuya Ichikawa <t-ichi@po.shiojiri.ne.jp>
;; Keywords: mail, news, MIME, offline
;; This file is part of GNU Emacs.
;;; Code:
-(require 'gnus-sum)
-(require 'gnus-util)
-
;;; @ newsgroup default charset
;;;
(defun gnus-set-newsgroup-default-charset (newsgroup charset)
"Set CHARSET for the NEWSGROUP as default MIME charset."
(let* ((ng-regexp (concat "^" (regexp-quote newsgroup) "\\($\\|\\.\\)"))
- (pair (assoc ng-regexp gnus-newsgroup-default-charset-alist)))
+ (pair (assoc ng-regexp gnus-newsgroup-default-charset-alist))
+ )
(if pair
(setcdr pair charset)
(setq gnus-newsgroup-default-charset-alist
(cons (cons ng-regexp charset)
- gnus-newsgroup-default-charset-alist)))))
+ gnus-newsgroup-default-charset-alist))
+ )))
;;; @ localization
"Set up `default-mime-charset' of summary buffer.
It is specified by variable `gnus-newsgroup-default-charset-alist'
\(cf. function `gnus-set-newsgroup-default-charset')."
- ;; We are in `nntp-server-buffer' now.
(if (buffer-live-p gnus-summary-buffer)
- (let* ((qgroup (save-excursion
- (set-buffer gnus-summary-buffer)
- gnus-newsgroup-name))
- (rgroup (gnus-group-real-name qgroup))
- alist pair charset)
- (setq charset (catch 'found
- ;; First, use "qualified" newsgroup name.
- (setq alist gnus-newsgroup-default-charset-alist)
- (while (setq pair (car alist))
- (if (string-match (car pair) qgroup)
- (throw 'found (cdr pair)))
- (setq alist (cdr alist)))
- ;; Next, try "real" newsgroup name.
- (setq alist gnus-newsgroup-default-charset-alist)
- (while (setq pair (car alist))
- (if (string-match (car pair) rgroup)
- (throw 'found (cdr pair)))
- (setq alist (cdr alist)))))
+ (let ((charset
+ (catch 'found
+ (let ((group
+ (save-excursion
+ (set-buffer gnus-summary-buffer)
+ gnus-newsgroup-name))
+ (alist gnus-newsgroup-default-charset-alist))
+ (while alist
+ (let ((pair (car alist)))
+ (if (string-match (car pair) group)
+ (throw 'found (cdr pair))
+ ))
+ (setq alist (cdr alist)))
+ ))))
(if charset
- (progn
- (save-excursion
- ;; Set `default-mime-charset' in summary buffer.
- (set-buffer gnus-summary-buffer)
- (make-local-variable 'default-mime-charset)
- (setq default-mime-charset charset))
- ;; Also set `default-mime-charset' in current buffer.
- (make-local-variable 'default-mime-charset)
- (setq default-mime-charset charset))
- ;; Reset `default-mime-charset' in current buffer.
+ (progn
+ (save-excursion
+ (set-buffer gnus-summary-buffer)
+ (make-local-variable 'default-mime-charset)
+ (setq default-mime-charset charset))
+ (make-local-variable 'default-mime-charset)
+ (setq default-mime-charset charset))
(kill-local-variable 'default-mime-charset)))))
-(defun gnus-get-summary-default-charset ()
- "Get the value of `default-mime-charset' from summary buffer."
- (and (buffer-live-p gnus-summary-buffer)
- (save-excursion
- (set-buffer gnus-summary-buffer)
- default-mime-charset)))
-
;;; @ end
;;;
last)))
(defun gnus-request-replace-article (article group buffer &optional no-encode)
- (unless no-encode
- (save-restriction
- (message-narrow-to-head)
- (mail-encode-encoded-word-buffer))
- (message-encode-message-body))
(let ((func (car (gnus-group-name-to-method group))))
(funcall (intern (format "%s-request-replace-article" func))
article (gnus-group-real-name group) buffer)))
;;; Internal functions.
-(defun gnus-extended-version ()
- "Stringified gnus version."
- (concat gnus-product-name "/" gnus-version-number " (based on "
- gnus-original-product-name " " gnus-original-version-number ")"))
-
-(defun gnus-message-make-user-agent (&optional include-mime-info max-column)
- "Return user-agent info.
-INCLUDE-MIME-INFO the optional first argument if it is non-nil and the variable
- `mime-edit-user-agent-value' exists, the return value will include it.
-MAX-COLUMN the optional second argument if it is specified, the return value
- will be folded up in the proper way."
- (let ((user-agent (if (and include-mime-info
- (boundp 'mime-edit-user-agent-value))
- (concat (gnus-extended-version)
- " "
- mime-edit-user-agent-value)
- (gnus-extended-version))))
- (if max-column
- (let (boundary)
- (unless (natnump max-column) (setq max-column 76))
- (with-temp-buffer
- (insert " " user-agent)
- (goto-char 13)
- (while (re-search-forward "[\n\t ]+" nil t)
- (replace-match " "))
- (goto-char 13)
- (while (re-search-forward "[^ ()/]+\\(/[^ ()/]+\\)? ?" nil t)
- (while (eq ?\( (char-after (point)))
- (forward-list)
- (skip-chars-forward " "))
- (skip-chars-backward " ")
- (if (> (current-column) max-column)
- (progn
- (if (or (not boundary) (eq ?\n (char-after boundary)))
- (progn
- (setq boundary (point))
- (unless (eobp)
- (delete-char 1)
- (insert "\n ")))
- (goto-char boundary)
- (delete-char 1)
- (insert "\n ")))
- (setq boundary (point))))
- (buffer-substring 13 (point-max))))
- user-agent)))
-
(defvar gnus-article-reply nil)
(defmacro gnus-setup-message (config &rest forms)
(let ((winconf (make-symbol "gnus-setup-message-winconf"))
(add-hook 'message-header-setup-hook 'gnus-inews-insert-gcc)
(add-hook 'message-header-setup-hook 'gnus-inews-insert-archive-gcc)
(add-hook 'message-mode-hook 'gnus-configure-posting-styles)
- (add-hook 'message-mode-hook
- (lambda ()
- (setq message-user-agent (gnus-extended-version))))
(unwind-protect
(progn
,@forms)
(setq message-post-method
`(lambda (arg)
(gnus-post-method arg ,gnus-newsgroup-name)))
+ (setq message-user-agent (gnus-extended-version))
(message-add-action
`(set-window-configuration ,winconf) 'exit 'postpone 'kill)
(message-add-action
(t gnus-select-method))))
\f
+
+(defun gnus-extended-version ()
+ "Stringified gnus version."
+ (concat gnus-product-name "/" gnus-version-number " (based on "
+ gnus-original-product-name " " gnus-original-version-number ")"))
+
+(defun gnus-message-make-user-agent (&optional include-mime-info max-column)
+ "Return user-agent info.
+INCLUDE-MIME-INFO the optional first argument if it is non-nil and the variable
+ `mime-edit-user-agent-value' exists, the return value will include it.
+MAX-COLUMN the optional second argument if it is specified, the return value
+ will be folded up in the proper way."
+ (let ((user-agent (if (and include-mime-info
+ (boundp 'mime-edit-user-agent-value))
+ (concat (gnus-extended-version)
+ " "
+ mime-edit-user-agent-value)
+ (gnus-extended-version))))
+ (if max-column
+ (let (boundary)
+ (unless (natnump max-column) (setq max-column 76))
+ (with-temp-buffer
+ (insert " " user-agent)
+ (goto-char 13)
+ (while (re-search-forward "[\n\t ]+" nil t)
+ (replace-match " "))
+ (goto-char 13)
+ (while (re-search-forward "[^ ()/]+\\(/[^ ()/]+\\)? ?" nil t)
+ (while (eq ?\( (char-after (point)))
+ (forward-list)
+ (skip-chars-forward " "))
+ (skip-chars-backward " ")
+ (if (> (current-column) max-column)
+ (progn
+ (if (or (not boundary) (eq ?\n (char-after boundary)))
+ (progn
+ (setq boundary (point))
+ (unless (eobp)
+ (delete-char 1)
+ (insert "\n ")))
+ (goto-char boundary)
+ (delete-char 1)
+ (insert "\n ")))
+ (setq boundary (point))))
+ (buffer-substring 13 (point-max))))
+ user-agent)))
+
+\f
;;;
;;; Gnus Mail Functions
;;;
(if full-headers "" message-included-forward-headers)))
(message-forward post))))
-(defun gnus-summary-post-forward (&optional full-headers)
- "Forward the current article to a newsgroup.
-If FULL-HEADERS (the prefix), include full headers when forwarding."
- (interactive "P")
- (gnus-summary-mail-forward full-headers t))
-
;;; XXX: generate Subject and ``Topics''?
(defun gnus-summary-mail-digest (&optional n post)
"Digests and forwards all articles in this series."
(set-buffer gnus-original-article-buffer)
(message-resend address)))))
+(defun gnus-summary-post-forward (&optional full-headers)
+ "Forward the current article to a newsgroup.
+If FULL-HEADERS (the prefix), include full headers when forwarding."
+ (interactive "P")
+ (gnus-summary-mail-forward full-headers t))
+
(defvar gnus-nastygram-message
"The following article was inappropriately posted to %s.\n\n"
"Format string to insert in nastygrams.
(defconst gnus-header-index
;; Name to index alist.
- '(("number" 0 gnus-score-integer)
- ("subject" 1 gnus-score-string)
- ("from" 2 gnus-score-string)
- ("date" 3 gnus-score-date)
- ("message-id" 4 gnus-score-string)
- ("references" 5 gnus-score-string)
- ("chars" 6 gnus-score-integer)
- ("lines" 7 gnus-score-integer)
- ("xref" 8 gnus-score-string)
+ '(("number" 1 gnus-score-integer)
+ ("subject" 8 gnus-score-string)
+ ("from" 9 gnus-score-string)
+ ("date" 10 gnus-score-date)
+ ("message-id" 11 gnus-score-string)
+ ("references" 12 gnus-score-string)
+ ("chars" 13 gnus-score-integer)
+ ("lines" 14 gnus-score-integer)
+ ("xref" 15 gnus-score-string)
("head" -1 gnus-score-body)
("body" -1 gnus-score-body)
("all" -1 gnus-score-body)
- ("followup" 2 gnus-score-followup)
- ("thread" 5 gnus-score-thread)))
+ ("followup" 9 gnus-score-followup)
+ ("thread" 12 gnus-score-thread)))
;;; Summary mode score maps.
;; Copyright (C) 1996,97,98 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Katsumi Yamaoka <yamaoka@jpl.org>
;; Keywords: news
;; This file is part of GNU Emacs.
:group 'gnus-summary-visual
:type 'hook)
-(defcustom gnus-structured-field-decoder
- #'eword-decode-and-unfold-structured-field
- "Function to decode non-ASCII characters in structured field for summary."
- :group 'gnus-various
- :type 'function)
-
-(defcustom gnus-unstructured-field-decoder
- (function
- (lambda (string)
- (eword-decode-unstructured-field-body
- (std11-unfold-string string) 'must-unfold)
- ))
- "Function to decode non-ASCII characters in unstructured field for summary."
- :group 'gnus-various
- :type 'function)
-
-(defcustom gnus-parse-headers-hook
- '(gnus-set-summary-default-charset)
+(defcustom gnus-parse-headers-hook '(gnus-set-summary-default-charset)
"*A hook called before parsing the headers."
:group 'gnus-various
:type 'hook)
(?S ,(macroexpand '(mail-header-subject gnus-tmp-header)) ?s)
(?s gnus-tmp-subject-or-nil ?s)
(?n gnus-tmp-name ?s)
- (?A (car (cdr (funcall gnus-extract-address-components gnus-tmp-from)))
- ?s)
- (?a (or (car (funcall gnus-extract-address-components gnus-tmp-from))
+ (?A (std11-address-string
+ (car (mime-read-field 'From gnus-tmp-header))) ?s)
+ (?a (or (std11-full-name-string
+ (car (mime-read-field 'From gnus-tmp-header)))
gnus-tmp-from) ?s)
(?F gnus-tmp-from ?s)
(?x ,(macroexpand '(mail-header-xref gnus-tmp-header)) ?s)
;; Byte-compiler warning.
(defvar gnus-article-mode-map)
-;; MIME stuff.
-
-(defvar gnus-encoded-word-method-alist
- '(("chinese" mail-decode-encoded-word-string rfc1843-decode-string)
- (".*" mail-decode-encoded-word-string))
- "Alist of regexps (to match group names) and lists of functions to be applied.")
-
-(defun gnus-multi-decode-encoded-word-string (string)
- "Apply the functions from `gnus-encoded-word-method-alist' that match."
- (let ((alist gnus-encoded-word-method-alist)
- elem)
- (while (setq elem (pop alist))
- (when (string-match (car elem) gnus-newsgroup-name)
- (pop elem)
- (while elem
- (setq string (funcall (pop elem) string)))
- (setq alist nil)))
- string))
-
;; Subject simplification.
(defun gnus-simplify-whitespace (str)
"L" gnus-summary-lower-score
"\M-i" gnus-symbolic-argument
"h" gnus-summary-select-article-buffer
- "b" gnus-article-view-part
"V" gnus-summary-score-map
"X" gnus-uu-extract-map
(let ((gnus-summary-line-format-spec spec)
(gnus-newsgroup-downloadable '((0 . t))))
(gnus-summary-insert-line
- [0 "" "" "" "" "" 0 0 ""] 0 nil 128 t nil "" nil 1)
+ (make-full-mail-header 0 "" "" "" "" "" 0 0 "")
+ 0 nil 128 t nil "" nil 1)
(goto-char (point-min))
(setq pos (list (cons 'unread (and (search-forward "\200" nil t)
(- (point) 2)))))
(setq gnus-tmp-name gnus-tmp-from))
(unless (numberp gnus-tmp-lines)
(setq gnus-tmp-lines 0))
- (gnus-put-text-property
+ (gnus-put-text-property-excluding-characters-with-faces
(point)
(progn (eval gnus-summary-line-format-spec) (point))
'gnus-number gnus-tmp-number)
(defsubst gnus-nov-parse-line (number dependencies &optional force-new)
(let ((eol (gnus-point-at-eol))
(buffer (current-buffer))
- header rawtext decoded)
+ header)
;; overview: [num subject from date id refs chars lines misc]
(unwind-protect
(setq header
(make-full-mail-header
number ; number
- (progn
- (setq rawtext (gnus-nov-field) ; subject
- decoded (funcall
- gnus-unstructured-field-decoder rawtext))
- (if (string= rawtext decoded)
- rawtext
- (put-text-property 0 (length decoded) 'raw-text rawtext decoded)
- decoded))
- (progn
- (setq rawtext (gnus-nov-field) ; from
- decoded (funcall
- gnus-structured-field-decoder rawtext))
- (if (string= rawtext decoded)
- rawtext
- (put-text-property 0 (length decoded) 'raw-text rawtext decoded)
- decoded))
+ (gnus-nov-field) ; subject
+ (gnus-nov-field) ; from
(gnus-nov-field) ; date
(or (gnus-nov-field)
(nnheader-generate-fake-message-id)) ; id
(defsubst gnus-article-sort-by-author (h1 h2)
"Sort articles by root author."
(string-lessp
- (let ((extract (funcall
- gnus-extract-address-components
- (mail-header-from h1))))
- (or (car extract) (cadr extract) ""))
- (let ((extract (funcall
- gnus-extract-address-components
- (mail-header-from h2))))
- (or (car extract) (cadr extract) ""))))
+ (let ((addr (mime-read-field 'From h1)))
+ (or (std11-full-name-string addr)
+ (std11-address-string addr)
+ ""))
+ (let ((addr (mime-read-field 'From h2)))
+ (or (std11-full-name-string addr)
+ (std11-address-string addr)
+ ""))
+ ))
(defun gnus-thread-sort-by-author (h1 h2)
"Sort threads by root author."
(subst-char-in-region (point-min) (point-max) ?\t ? t)
(gnus-run-hooks 'gnus-parse-headers-hook)
(let ((case-fold-search t)
- rawtext decoded
- in-reply-to header p lines chars)
+ in-reply-to header p lines chars ctype)
(goto-char (point-min))
;; Search to the beginning of the next header. Error messages
;; do not begin with 2 or 3.
;; doesn't always go hand in hand.
(setq
header
- (vector
+ (make-full-mail-header
;; Number.
(prog1
(read cur)
(progn
(goto-char p)
(if (search-forward "\nsubject: " nil t)
- (progn
- (setq rawtext (nnheader-header-value)
- decoded (funcall
- gnus-unstructured-field-decoder rawtext))
- (if (string-equal rawtext decoded)
- rawtext
- (put-text-property 0 (length decoded) 'raw-text rawtext decoded)
- decoded))
+ (nnheader-header-value)
"(none)"))
;; From.
(progn
(goto-char p)
(if (search-forward "\nfrom: " nil t)
- (progn
- (setq rawtext (nnheader-header-value)
- decoded (funcall
- gnus-structured-field-decoder rawtext))
- (if (string-equal rawtext decoded)
- rawtext
- (put-text-property 0 (length decoded) 'raw-text rawtext decoded)
- decoded))
+ (nnheader-header-value)
"(nobody)"))
;; Date.
(progn
(goto-char p)
(and (search-forward "\nxref: " nil t)
(nnheader-header-value)))))
+ (goto-char p)
+ (if (and (search-forward "\ncontent-type: " nil t)
+ (setq ctype (nnheader-header-value)))
+ (mime-entity-set-content-type-internal
+ header (mime-parse-Content-Type ctype)))
(when (equal id ref)
(setq ref nil))
;; Copyright (C) 1996,97,98 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Tatsuya Ichikawa <t-ichi@po.shiojiri.ne.jp>
;; Keywords: mail, news, MIME
;; This file is part of GNU Emacs.
;; Copyright (C) 1995,96,97,98 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Katsumi Yamaoka <yamaoka@jpl.org>
;; Keywords: news
;; This file is part of GNU Emacs.
;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
;; Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Tatsuya Ichikawa <t-ichi@po.shiojiri.ne.jp>
+;; Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp>
;; Keywords: news, mail
;; This file is part of GNU Emacs.
(defconst gnus-product-name "T-gnus"
"Product name of this version of gnus.")
-(defconst gnus-version-number "6.10.025"
+(defconst gnus-version-number "6.10.026"
"Version number for this version of gnus.")
(defconst gnus-original-version-number "0.36"
"Version number for this version of Gnus.")
(defconst gnus-original-product-name "Pterodactyl Gnus"
- "Version number for this version of Gnus.")
+ "Product name of the original version of Gnus.")
(defconst gnus-version
- (format "%s %s (based on %s %s ; for SEMI 1.8-1.10, FLIM 1.8-1.11)"
+ (format "%s %s (based on %s %s ; for SEMI 1.10, FLIM 1.11)"
gnus-product-name gnus-version-number
gnus-original-product-name gnus-original-version-number)
"Version string for this version of gnus.")
(defcustom gnus-extract-address-components 'gnus-extract-address-components
"*Function for extracting address components from a From header.
-
-`gnus-extract-address-components' is a quite fast, and too simplistic.
-`mail-extract-address-components' works much better, but is slower.
-`std11-extract-address-components' also works better, and less slower."
+Two pre-defined function exist: `gnus-extract-address-components',
+which is the default, quite fast, and too simplistic solution, and
+`mail-extract-address-components', which works much better, but is
+slower."
:group 'gnus-summary-format
:type '(radio (function-item gnus-extract-address-components)
(function-item mail-extract-address-components)
;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
;; Keiichi Suzuki <kei-suzu@mail.wbs.ne.jp>
+;; Tatsuya Ichikawa <t-ichi@po.shiojiri.ne.jp>
+;; Katsumi Yamaoka <yamaoka@jpl.org>
;; Keywords: mail, news, MIME
;; This file is part of GNU Emacs.
(Lines)
(Expires)
(Message-ID)
- ;; (References . message-shorten-references)
(References . message-fill-header)
(User-Agent))
"Alist used for formatting headers.")
(let ((errbuf (if message-interactive
(generate-new-buffer " sendmail errors")
0))
- resend-addresses delimline)
+ resend-to-addresses delimline)
(let ((case-fold-search t))
(save-restriction
(message-narrow-to-headers)
- ;; XXX: We need to handle Resent-CC/Resent-BCC, too.
- (setq resend-addresses (message-fetch-field "resent-to")))
+ (setq resend-to-addresses (message-fetch-field "resent-to")))
;; Change header-delimiter to be what sendmail expects.
(goto-char (point-min))
(re-search-forward
;; We must not do that for a resend
;; because we would find the original addresses.
;; For a resend, include the specific addresses.
- (if resend-addresses
- (list resend-addresses)
+ (if resend-to-addresses
+ (list resend-to-addresses)
'("-t")))))
(when message-interactive
(save-excursion
"Pass the prepared message buffer to qmail-inject.
Refer to the documentation for the variable `message-send-mail-function'
to find out how to use this."
- ;; replace the header delimiter with a blank line.
+ ;; replace the header delimiter with a blank line
(goto-char (point-min))
(re-search-forward
(concat "^" (regexp-quote mail-header-separator) "\n"))
(if (or (= (following-char) ?,)
(eobp))
(when (not quoted)
- (if last
+ (if (and (> (current-column) 78)
+ last)
(save-excursion
(goto-char last)
(looking-at "[ \t]*")
(nconc message-buffer-list (list (current-buffer))))))
(defvar mc-modes-alist)
-(defvar message-get-reply-buffer-function nil)
(defun message-setup (headers &optional replybuffer actions)
(when (and (boundp 'mc-modes-alist)
(not (assq 'message-mode mc-modes-alist)))
"Start editing a reply to the article in the current buffer."
(interactive)
(let ((cur (current-buffer))
+ from subject date to cc
+ references message-id follow-to
(inhibit-point-motion-hooks t)
- from date subject mct mft mrt
- never-mct to cc
- references message-id follow-to gnus-warning)
+ mct never-mct mft mrt gnus-warning)
(save-restriction
(message-narrow-to-head)
;; Allow customizations to have their say.
(if wide to-address nil)))
(setq message-reply-headers
- (vector 0 subject from date message-id references 0 0 ""))
+ (make-full-mail-header-from-decoded-header
+ 0 subject from date message-id references 0 0 ""))
(message-setup
`((Subject . ,subject)
;;;###autoload
(defun message-followup (&optional to-newsgroups)
- "Follow up to the message in the current buffer."
+ "Follow up to the message in the current buffer.
+If TO-NEWSGROUPS, use that as the new Newsgroups line."
(interactive)
(let ((cur (current-buffer))
+ from subject date mct
+ references message-id follow-to
(inhibit-point-motion-hooks t)
- from date subject mct mft mrt
(message-this-is-news t)
- followup-to distribution newsgroups posted-to
- references message-id follow-to gnus-warning)
+ followup-to distribution newsgroups gnus-warning posted-to mft mrt)
(save-restriction
(message-narrow-to-head)
- ;; Allow customizations to have their say.
- ;; This is a followup.
(when (message-functionp message-followup-to-function)
(setq follow-to
(funcall message-followup-to-function)))
- ;; Find all relevant headers we need.
(setq from (message-fetch-field "from")
date (message-fetch-field "date" t)
subject (or (message-fetch-field "subject") "none")
(message-pop-to-buffer (message-buffer-name "followup" from newsgroups))
(setq message-reply-headers
- (vector 0 subject from date message-id references 0 0 ""))
+ (make-full-mail-header-from-decoded-header
+ 0 subject from date message-id references 0 0 ""))
(message-setup
`((Subject . ,subject)
;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
;; Lars Magne Ingebrigtsen <larsi@gnus.org>
-;; Keywords: news
+;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Katsumi Yamaoka <yamaoka@jpl.org>
+;; Keywords: mail, news, MIME
;; This file is part of GNU Emacs.
(eval-when-compile (require 'cl))
(require 'mail-utils)
+(require 'mime)
(defvar nnheader-max-head-length 4096
"*Max length of the head of articles.")
(defmacro mail-header-number (header)
"Return article number in HEADER."
- `(aref ,header 0))
+ `(mime-entity-location-internal ,header))
(defmacro mail-header-set-number (header number)
"Set article number of HEADER to NUMBER."
- `(aset ,header 0 ,number))
+ `(mime-entity-set-location-internal ,header ,number))
-(defmacro mail-header-subject (header)
- "Return subject string in HEADER."
- `(aref ,header 1))
+(defalias 'mail-header-subject 'mime-entity-decoded-subject-internal)
+(defalias 'mail-header-set-subject 'mime-entity-set-decoded-subject-internal)
-(defmacro mail-header-set-subject (header subject)
- "Set article subject of HEADER to SUBJECT."
- `(aset ,header 1 ,subject))
+(defalias 'mail-header-from 'mime-entity-decoded-from-internal)
+(defalias 'mail-header-set-from 'mime-entity-set-decoded-from-internal)
-(defmacro mail-header-from (header)
- "Return author string in HEADER."
- `(aref ,header 2))
+(defalias 'mail-header-date 'mime-entity-date-internal)
+(defalias 'mail-header-set-date 'mime-entity-set-date-internal)
-(defmacro mail-header-set-from (header from)
- "Set article author of HEADER to FROM."
- `(aset ,header 2 ,from))
+(defalias 'mail-header-message-id 'mime-entity-message-id-internal)
+(defalias 'mail-header-id 'mime-entity-message-id-internal)
+(defalias 'mail-header-set-message-id 'mime-entity-set-message-id-internal)
+(defalias 'mail-header-set-id 'mime-entity-set-message-id-internal)
-(defmacro mail-header-date (header)
- "Return date in HEADER."
- `(aref ,header 3))
+(defalias 'mail-header-references 'mime-entity-references-internal)
+(defalias 'mail-header-set-references 'mime-entity-set-references-internal)
-(defmacro mail-header-set-date (header date)
- "Set article date of HEADER to DATE."
- `(aset ,header 3 ,date))
+(defalias 'mail-header-chars 'mime-entity-chars-internal)
+(defalias 'mail-header-set-chars 'mime-entity-set-chars-internal)
-(defalias 'mail-header-message-id 'mail-header-id)
-(defmacro mail-header-id (header)
- "Return Id in HEADER."
- `(aref ,header 4))
+(defalias 'mail-header-lines 'mime-entity-lines-internal)
+(defalias 'mail-header-set-lines 'mime-entity-set-lines-internal)
-(defalias 'mail-header-set-message-id 'mail-header-set-id)
-(defmacro mail-header-set-id (header id)
- "Set article Id of HEADER to ID."
- `(aset ,header 4 ,id))
+(defalias 'mail-header-xref 'mime-entity-xref-internal)
+(defalias 'mail-header-set-xref 'mime-entity-set-xref-internal)
-(defmacro mail-header-references (header)
- "Return references in HEADER."
- `(aref ,header 5))
-
-(defmacro mail-header-set-references (header ref)
- "Set article references of HEADER to REF."
- `(aset ,header 5 ,ref))
-
-(defmacro mail-header-chars (header)
- "Return number of chars of article in HEADER."
- `(aref ,header 6))
-
-(defmacro mail-header-set-chars (header chars)
- "Set number of chars in article of HEADER to CHARS."
- `(aset ,header 6 ,chars))
-
-(defmacro mail-header-lines (header)
- "Return lines in HEADER."
- `(aref ,header 7))
-
-(defmacro mail-header-set-lines (header lines)
- "Set article lines of HEADER to LINES."
- `(aset ,header 7 ,lines))
-
-(defmacro mail-header-xref (header)
- "Return xref string in HEADER."
- `(aref ,header 8))
-
-(defmacro mail-header-set-xref (header xref)
- "Set article xref of HEADER to xref."
- `(aset ,header 8 ,xref))
+(defsubst make-full-mail-header (&optional number subject from date id
+ references chars lines xref)
+ "Create a new mail header structure initialized with the parameters given."
+ (make-mime-entity-internal
+ 'gnus number
+ nil
+ nil nil nil
+ (if subject
+ (eword-decode-and-unfold-unstructured-field subject)
+ )
+ (if from
+ (eword-decode-and-unfold-structured-field from)
+ )
+ date id references
+ chars lines xref
+ (list (cons 'Subject subject)
+ (cons 'From from))
+ ))
+
+(defsubst make-full-mail-header-from-decoded-header
+ (&optional number subject from date id references chars lines xref)
+ "Create a new mail header structure initialized with the parameters given."
+ (make-mime-entity-internal
+ 'gnus number
+ nil
+ nil nil nil
+ subject
+ from
+ date id references
+ chars lines xref))
(defun make-mail-header (&optional init)
"Create a new mail header structure initialized with INIT."
- (make-vector 9 init))
-
-(defun make-full-mail-header (&optional number subject from date id
- references chars lines xref)
- "Create a new mail header structure initialized with the parameters given."
- (vector number subject from date id references chars lines xref))
+ (make-full-mail-header init init init init init
+ init init init init))
;; fake message-ids: generation and detection
;; about twice as fast, even though it looks messier. You
;; can't have everything, I guess. Speed and elegance
;; don't always go hand in hand.
- (vector
+ (make-full-mail-header
;; Number.
(if naked
(progn
(defun nnheader-parse-nov ()
(let ((eol (gnus-point-at-eol)))
- (vector
+ (make-full-mail-header
(nnheader-nov-read-integer) ; number
(nnheader-nov-field) ; subject
(nnheader-nov-field) ; from
(princ (mail-header-number header) (current-buffer))
(insert
"\t"
- (or (mail-header-subject header) "(none)") "\t"
- (or (mail-header-from header) "(nobody)") "\t"
+ (or (mime-fetch-field 'Subject header) "(none)") "\t"
+ (or (mime-fetch-field 'From header) "(nobody)") "\t"
(or (mail-header-date header) "") "\t"
(or (mail-header-id header)
(nnmail-message-id))
;; Copyright (C) 1996,97,98 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Katsumi Yamaoka <yamaoka@jpl.org>
;; Keywords: news
;; This file is part of GNU Emacs.