;;; std11-parse.el --- STD 11 parser for GNU Emacs
-;; Copyright (C) 1995,1996 Free Software Foundation, Inc.
+;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Keywords: mail, news, RFC 822, STD 11
-;; Version:
-;; $Id: std11-parse.el,v 0.16 1997-07-13 17:58:15 morioka Exp $
+;; Version: $Id: std11-parse.el,v 1.1 1998-02-04 07:21:11 morioka Exp $
;; This file is part of MU (Message Utilities).
;;;
(defconst std11-space-chars " \t\n")
-(defconst std11-spaces-regexp (concat "[" std11-space-chars "]+"))
-(defconst std11-special-chars "][()<>@,;:\\<>.\"")
+(defconst std11-spaces-regexp (` (, (concat "[" std11-space-chars "]+"))))
+(defconst std11-special-char-list '(?\] ?\[
+ ?\( ?\) ?< ?> ?@
+ ?, ?\; ?: ?\\ ?\"
+ ?.))
(defconst std11-atom-regexp
- (concat "^[^" std11-special-chars std11-space-chars "]+"))
+ (` (, (concat "^[^" std11-special-char-list std11-space-chars "]+"))))
(defun std11-analyze-spaces (string)
(if (and (string-match std11-spaces-regexp string)
(defun std11-analyze-special (str)
(if (and (> (length str) 0)
- (find (aref str 0) std11-special-chars)
- )
+ (memq (aref str 0) std11-special-char-list))
(cons (cons 'specials (substring str 0 1))
(substring str 1)
)))
(nreverse dest)
))))
+(defun std11-parse-msg-id (lal)
+ (let ((ret (std11-parse-ascii-token lal))
+ < addr-spec >)
+ (if (and ret
+ (setq < (car ret))
+ (string-equal (cdr (assq 'specials <)) "<")
+ (setq lal (cdr ret))
+ (setq ret (std11-parse-addr-spec lal))
+ (setq addr-spec (car ret))
+ (setq lal (cdr ret))
+ (setq ret (std11-parse-ascii-token lal))
+ (setq > (car ret))
+ (string-equal (cdr (assq 'specials >)) ">")
+ )
+ (cons (cons 'msg-id (cdr addr-spec))
+ (cdr ret))
+ )))
+
;;; @ end
;;;