[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/gnus/ietf-drums.el [emacs-unicode-2]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/gnus/ietf-drums.el [emacs-unicode-2] |
Date: |
Thu, 09 Sep 2004 17:20:16 -0400 |
Index: emacs/lisp/gnus/ietf-drums.el
diff -c emacs/lisp/gnus/ietf-drums.el:1.8.4.1
emacs/lisp/gnus/ietf-drums.el:1.8.4.2
*** emacs/lisp/gnus/ietf-drums.el:1.8.4.1 Fri Mar 12 00:02:58 2004
--- emacs/lisp/gnus/ietf-drums.el Thu Sep 9 09:36:26 2004
***************
*** 1,5 ****
! ;;; ietf-drums.el --- functions for parsing RFC822bis headers
! ;; Copyright (C) 1998, 1999, 2000, 2002
;; Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <address@hidden>
--- 1,5 ----
! ;;; ietf-drums.el --- Functions for parsing RFC822bis headers
! ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
;; Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <address@hidden>
***************
*** 27,32 ****
--- 27,42 ----
;; Messages". This library is based on
;; draft-ietf-drums-msg-fmt-05.txt, released on 1998-08-05.
+ ;; Pending a real regression self test suite, Simon Josefsson added
+ ;; various self test expressions snipped from bug reports, and their
+ ;; expected value, below. I you believe it could be useful, please
+ ;; add your own test cases, or write a real self test suite, or just
+ ;; remove this.
+
+ ;; <address@hidden>
+ ;; (ietf-drums-parse-address "'foo' <address@hidden>")
+ ;; => ("address@hidden" . "'foo'")
+
;;; Code:
(eval-when-compile (require 'cl))
***************
*** 64,73 ****
(modify-syntax-entry ?> ")" table)
(modify-syntax-entry ?@ "w" table)
(modify-syntax-entry ?/ "w" table)
! (modify-syntax-entry ?= " " table)
! (modify-syntax-entry ?* " " table)
! (modify-syntax-entry ?\; " " table)
! (modify-syntax-entry ?\' " " table)
table))
(defun ietf-drums-token-to-list (token)
--- 74,87 ----
(modify-syntax-entry ?> ")" table)
(modify-syntax-entry ?@ "w" table)
(modify-syntax-entry ?/ "w" table)
! (modify-syntax-entry ?* "_" table)
! (modify-syntax-entry ?\; "_" table)
! (modify-syntax-entry ?\' "_" table)
! (if (featurep 'xemacs)
! (let ((i 128))
! (while (< i 256)
! (modify-syntax-entry i "w" table)
! (setq i (1+ i)))))
table))
(defun ietf-drums-token-to-list (token)
***************
*** 200,224 ****
(defun ietf-drums-parse-addresses (string)
"Parse STRING and return a list of MAILBOX / DISPLAY-NAME pairs."
! (with-temp-buffer
! (ietf-drums-init string)
! (let ((beg (point))
! pairs c)
! (while (not (eobp))
! (setq c (char-after))
! (cond
! ((memq c '(?\" ?< ?\())
! (forward-sexp 1))
! ((eq c ?,)
! (push (ietf-drums-parse-address (buffer-substring beg (point)))
! pairs)
! (forward-char 1)
! (setq beg (point)))
! (t
! (forward-char 1))))
! (push (ietf-drums-parse-address (buffer-substring beg (point)))
! pairs)
! (nreverse pairs))))
(defun ietf-drums-unfold-fws ()
"Unfold folding white space in the current buffer."
--- 214,251 ----
(defun ietf-drums-parse-addresses (string)
"Parse STRING and return a list of MAILBOX / DISPLAY-NAME pairs."
! (if (null string)
! nil
! (with-temp-buffer
! (ietf-drums-init string)
! (let ((beg (point))
! pairs c address)
! (while (not (eobp))
! (setq c (char-after))
! (cond
! ((memq c '(?\" ?< ?\())
! (condition-case nil
! (forward-sexp 1)
! (error
! (skip-chars-forward "^,"))))
! ((eq c ?,)
! (setq address
! (condition-case nil
! (ietf-drums-parse-address
! (buffer-substring beg (point)))
! (error nil)))
! (if address (push address pairs))
! (forward-char 1)
! (setq beg (point)))
! (t
! (forward-char 1))))
! (setq address
! (condition-case nil
! (ietf-drums-parse-address
! (buffer-substring beg (point)))
! (error nil)))
! (if address (push address pairs))
! (nreverse pairs)))))
(defun ietf-drums-unfold-fws ()
"Unfold folding white space in the current buffer."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/gnus/ietf-drums.el [emacs-unicode-2],
Miles Bader <=