;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Keywords: mail, news, RFC 822
-;; This file is part of tl (Tiny Library).
+;; This file is part of MU (Message Utilities).
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
(defconst rfc822/RCS-ID
- "$Id: tl-822.el,v 7.57 1996-08-28 20:44:25 morioka Exp $")
+ "$Id: tl-822.el,v 7.66 1996-09-08 18:09:42 morioka Exp $")
(defconst rfc822/version (get-version-string rfc822/RCS-ID))
;;; @ field
;;;
-(defalias `rfc822/field-end 'std11-field-end)
-(defalias 'rfc822/get-field-body 'std11-find-field-body)
-(defalias 'rfc822/get-field-bodies 'std11-find-field-bodies)
+(defalias 'rfc822/field-end 'std11-field-end)
+(defalias 'rfc822/get-field-body 'std11-field-body)
+(defalias 'rfc822/get-field-bodies 'std11-field-bodies)
;;; @ quoting
(defconst rfc822/linear-white-space-regexp "\\(\n?[ \t]\\)+")
(defconst rfc822/quoted-pair-regexp "\\\\.")
-(defconst rfc822/non-qtext-char-list '(?\" ?\\ ?\r ?\n))
(defconst rfc822/qtext-regexp
- (concat "[^" (char-list-to-string rfc822/non-qtext-char-list) "]"))
+ (concat "[^" (char-list-to-string std11-non-qtext-char-list) "]"))
(defconst rfc822/quoted-string-regexp
(concat "\""
(regexp-*
)
"\""))
-(defun rfc822/wrap-as-quoted-string (str)
- "Wrap string STR as RFC 822 quoted-string. [tl-822.el]"
- (concat "\""
- (mapconcat (function
- (lambda (chr)
- (if (memq chr rfc822/non-qtext-char-list)
- (concat "\\" (char-to-string chr))
- (char-to-string chr)
- )
- )) str "")
- "\""))
+(defalias 'rfc822/wrap-as-quoted-string 'std11-wrap-as-quoted-string)
(defun rfc822/strip-quoted-pair (str)
(let ((dest "")
(defalias 'rfc822/parse-address 'std11-parse-address)
(defalias 'rfc822/parse-addresses 'std11-parse-addresses)
-
-(defun rfc822/addr-to-string (seq)
- (mapconcat (function
- (lambda (token)
- (if (eq (car token) 'spaces)
- ""
- (cdr token)
- )))
- seq "")
- )
-
-(defun rfc822/address-string (address)
- (cond ((eq (car address) 'group)
- (mapconcat (function rfc822/address-string)
- (nth 2 address)
- ", ")
- )
- ((eq (car address) 'mailbox)
- (let ((addr (nth 1 address)))
- (rfc822/addr-to-string
- (if (eq (car addr) 'phrase-route-addr)
- (nth 2 addr)
- (cdr addr)
- )
- )))))
-
-(defun rfc822/full-name-string (address)
- (cond ((eq (car address) 'group)
- (mapconcat (function
- (lambda (token)
- (cdr token)
- ))
- (nth 1 address) "")
- )
- ((eq (car address) 'mailbox)
- (let ((addr (nth 1 address))
- (comment (nth 2 address))
- phrase)
- (if (eq (car addr) 'phrase-route-addr)
- (setq phrase (mapconcat (function
- (lambda (token)
- (cdr token)
- ))
- (nth 1 addr) ""))
- )
- (or phrase comment)
- ))))
-
-(defun rfc822/extract-address-components (string)
- "Extract full name and canonical address from STRING.
-Returns a list of the form (FULL-NAME CANONICAL-ADDRESS).
-If no name can be extracted, FULL-NAME will be nil. [tl-822.el]"
- (let* ((structure (car (std11-parse-address-string str)))
- (phrase (rfc822/full-name-string structure))
- (address (rfc822/address-string structure))
- )
- (list phrase address)
- ))
+(defalias 'rfc822/address-string 'std11-address-string)
+(defalias 'rfc822/full-name-string 'std11-full-name-string)
+(defalias 'rfc822/extract-address-components
+ 'std11-extract-address-components)
;;; @ end