;;; 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 <tomo@m17n.org>
;; Keywords: mail, news, RFC 822, STD 11
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Code:
(if (re-search-forward "^$" bound t)
(goto-char (1- (match-beginning 0)))
(end-of-line)
- ))
- (point)
- )
+ (point))))
;;;###autoload
(defun std11-fetch-field (name)
))
(setq i (1+ i))
)
- (concat dest (substring string b))
- ))
+ ;; unlimited patch by simm-emacs@fan.gr.jp
+ ;; Mon, 10 Jan 2000 13:03:02 +0900
+ (if mime-decode-unlimited
+ (eword-encode-string (concat dest (substring string b)))
+ (concat dest (substring string b)))))
(defconst std11-non-qtext-char-list '(?\" ?\\ ?\r ?\n))
+;; unlimited patch by simm-emacs@fan.gr.jp
+;; Mon, 10 Jan 2000 13:03:02 +0900
+(defvar std11-filename-coding-system nil
+ "Define coding-system for non-ASCII filename when send.
+Set this variable coding system symbol (ie. 'iso-2022-jp) or nil.
+If non-nil, std11-wrap-as-quoted-string use encode-coding-string.")
+
(defun std11-wrap-as-quoted-string (string)
"Wrap STRING as RFC 822 quoted-string."
(concat "\""
- (std11-wrap-as-quoted-pairs string std11-non-qtext-char-list)
+ ;; unlimited patch by simm-emacs@fan.gr.jp
+ ;; Mon, 10 Jan 2000 13:03:02 +0900
+ (if std11-filename-coding-system
+ (encode-coding-string string std11-filename-coding-system)
+ (std11-wrap-as-quoted-pairs string std11-non-qtext-char-list))
"\""))
(defun std11-strip-quoted-pair (string)
)
;; (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 "]+")))
))
(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))
(cons (cons 'word elt) rest)
)))))
-(defun std11-parse-word-or-comment (lal)
+(defun std11-parse-word-or-comment-or-period (lal)
(let ((ret (std11-parse-token-or-comment lal)))
(if ret
(let ((elt (car ret))
)
((assq 'comment elt)
(cons (cons 'comment-word elt) rest)
+ )
+ ((string-equal (cdr (assq 'specials elt)) ".")
+ (cons (cons 'period elt) rest)
))
))))
(defun std11-parse-phrase (lal)
(let (ret phrase)
- (while (setq ret (std11-parse-word-or-comment lal))
+ (while (setq ret (std11-parse-word-or-comment-or-period lal))
(setq phrase (append phrase (cdr (car ret))))
(setq lal (cdr ret))
)
((eq name 'comment) "")
((eq name 'quoted-string)
(concat "\"" (cdr token) "\""))
+ ((eq name 'domain-literal)
+ (concat "[" (cdr token) "]"))
(t (cdr token)))
)))
seq "")