X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=std11.el;h=9227ad0cb20851e8273002b17946db2c934d1f41;hb=333b197a9aecfb8fe5cea0e4a1e1d2ba675d7322;hp=97f9359784b2efa09a1a9a66e56936026adb3e48;hpb=03a49791badf61ed36a383bf04182c5ee2661cf7;p=elisp%2Fflim.git diff --git a/std11.el b/std11.el index 97f9359..9227ad0 100644 --- a/std11.el +++ b/std11.el @@ -1,6 +1,6 @@ ;;; std11.el --- STD 11 functions for GNU Emacs -;; Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc. +;; Copyright (C) 1995,96,97,98,99,2000,01,02 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko ;; Keywords: mail, news, RFC 822, STD 11 @@ -44,9 +44,7 @@ The optional argument BOUNDs the search; it is a buffer position." (if (re-search-forward "^$" bound t) (goto-char (1- (match-beginning 0))) (end-of-line) - )) - (point) - ) + (point)))) ;;;###autoload (defun std11-fetch-field (name) @@ -289,6 +287,11 @@ be the result." ) ;; (defconst std11-spaces-regexp ;; (eval-when-compile (concat "[" std11-space-char-list "]+"))) + +(defconst std11-non-atom-regexp + (eval-when-compile + (concat "[" std11-special-char-list std11-space-char-list "]"))) + (defconst std11-atom-regexp (eval-when-compile (concat "[^" std11-special-char-list std11-space-char-list "]+"))) @@ -313,13 +316,21 @@ be the result." )) (defun std11-analyze-atom (string start) - (if (and (string-match std11-atom-regexp string start) - (= (match-beginning 0) start)) - (let ((end (match-end 0))) - (cons (cons 'atom (substring string start end)) - ;;(substring string end) - end) - ))) + (if (string-match std11-non-atom-regexp string start) + (if (> (match-beginning 0) start) + (cons (cons 'atom (substring string start (match-beginning 0))) + (match-beginning 0)) + nil) + (cons (cons 'atom (substring string start)) + (length string))) + ;; (if (and (string-match std11-atom-regexp string start) + ;; (= (match-beginning 0) start)) + ;; (let ((end (match-end 0))) + ;; (cons (cons 'atom (substring string start end)) + ;; ;;(substring string end) + ;; end) + ;; )) + ) (defun std11-check-enclosure (string open close &optional recursive from) (let ((len (length string))