X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=std11-parse.el;h=9139530cb94b3a4e2a9480639619cb4b1bf016a6;hb=72048d36fa86db7062e36d46645cc42d3aa8b02f;hp=10912b096efbfabfa4a58fe39c2ba62da105942e;hpb=b85edd796cfb18fe7ad04943a7ab0825516b0f20;p=elisp%2Fapel.git diff --git a/std11-parse.el b/std11-parse.el index 10912b0..9139530 100644 --- a/std11-parse.el +++ b/std11-parse.el @@ -1,11 +1,10 @@ ;;; 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 ;; Keywords: mail, news, RFC 822, STD 11 -;; Version: -;; $Id: std11-parse.el,v 0.15 1996-11-28 19:38:27 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). @@ -34,10 +33,13 @@ ;;; (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) @@ -49,8 +51,7 @@ (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) ))) @@ -162,12 +163,12 @@ (let (token itl parsed token-value) (while (and lal (setq token (car lal)) - (if (and (setq token-value (cdr token)) - (find-non-ascii-charset-string token-value) - ) - (setq token nil) - (std11-ignored-token-p token) - )) + (or (std11-ignored-token-p token) + (if (and (setq token-value (cdr token)) + (find-non-ascii-charset-string token-value) + ) + (setq token nil) + ))) (setq lal (cdr lal)) (setq itl (cons token itl)) ) @@ -433,6 +434,24 @@ (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 ;;;