From a1ddbd5320f7fbecb9b711b1ba010d76328c2707 Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Fri, 1 Sep 2000 16:17:47 +0000 Subject: [PATCH] (imap-parse-flag-list): Rewrite. --- lisp/ChangeLog | 2 ++ lisp/imap.el | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6aa825b8b..20dd6173e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2000-09-01 Simon Josefsson + * imap.el (imap-parse-flag-list): Rewrite. + * nnimap.el (nnimap-retrieve-headers-from-file): Ignore errors. * imap.el (imap-parse-flag-list): Hack. diff --git a/lisp/imap.el b/lisp/imap.el index 105fc4db8..29213c186 100644 --- a/lisp/imap.el +++ b/lisp/imap.el @@ -2179,15 +2179,15 @@ Return nil if no complete line has arrived." ;; ; revisions of this specification. (defun imap-parse-flag-list () - (let ((str (buffer-substring (point) (search-forward ")" nil t))) - pos) - (while (setq pos (string-match "\\\\" str (and pos (+ 2 pos)))) - (setq str (replace-match "\\\\" nil t str))) - ;; xxx ugly. rewrite not to use `read' at all. - (when (= (length (symbol-name (read "A?A"))) 1) - (while (setq pos (string-match "\\?" str (and pos (+ 2 pos)))) - (setq str (replace-match "\\?" nil t str)))) - (mapcar 'symbol-name (read str)))) + (let (flag-list start) + (when (eq (char-after) ?\() + (imap-forward) + (while (and (not (eq (char-before) ?\))) + (setq start (point)) + (> (skip-chars-forward "^ )" (gnus-point-at-eol)) 0)) + (push (buffer-substring start (point)) flag-list) + (imap-forward)) + (nreverse flag-list)))) ;; envelope = "(" env-date SP env-subject SP env-from SP env-sender SP ;; env-reply-to SP env-to SP env-cc SP env-bcc SP -- 2.25.1