(imap-parse-flag-list): Rewrite.
authorSimon Josefsson <jas@extundo.com>
Fri, 1 Sep 2000 16:17:47 +0000 (16:17 +0000)
committerSimon Josefsson <jas@extundo.com>
Fri, 1 Sep 2000 16:17:47 +0000 (16:17 +0000)
lisp/ChangeLog
lisp/imap.el

index 6aa825b..20dd617 100644 (file)
@@ -1,5 +1,7 @@
 2000-09-01  Simon Josefsson  <simon@josefsson.org>
 
+       * imap.el (imap-parse-flag-list): Rewrite.
+
        * nnimap.el (nnimap-retrieve-headers-from-file): Ignore errors.
 
        * imap.el (imap-parse-flag-list): Hack.
index 105fc4d..29213c1 100644 (file)
@@ -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