* nnimap.el (nnimap-unfold-quoted-lines): Refactor out.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Thu, 25 Nov 2010 22:52:35 +0000 (23:52 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Thu, 25 Nov 2010 22:52:35 +0000 (23:52 +0100)
lisp/ChangeLog
lisp/nnimap.el

index 85d900b..529ae98 100644 (file)
@@ -1,3 +1,7 @@
+2010-11-25  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * nnimap.el (nnimap-unfold-quoted-lines): Refactor out.
+
 2010-11-25  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * shr.el (shr-insert): Fix the way to fold lines.
index 86bba98..825f6a4 100644 (file)
@@ -180,13 +180,7 @@ textual parts.")
          (when (eobp)
            (return)))
        (setq article (match-string 1))
-       ;; Unfold quoted {number} strings.
-       (while (re-search-forward "[^]][ (]{\\([0-9]+\\)}\r\n"
-                                 (1+ (line-end-position)) t)
-         (setq size (string-to-number (match-string 1)))
-         (delete-region (+ (match-beginning 0) 2) (point))
-         (setq string (delete-region (point) (+ (point) size)))
-         (insert (format "%S" string)))
+       (nnimap-unfold-quoted-lines)
        (setq bytes (nnimap-get-length)
              lines nil)
        (beginning-of-line)
@@ -216,6 +210,15 @@ textual parts.")
        (insert ".")
        (forward-line 1)))))
 
+(defun nnimap-unfold-quoted-lines ()
+  ;; Unfold quoted {number} strings.
+  (while (re-search-forward "[^]][ (]{\\([0-9]+\\)}\r\n"
+                           (1+ (line-end-position)) t)
+    (setq size (string-to-number (match-string 1)))
+    (delete-region (+ (match-beginning 0) 2) (point))
+    (setq string (delete-region (point) (+ (point) size)))
+    (insert (format "%S" string))))
+
 (defun nnimap-get-length ()
   (and (re-search-forward "{\\([0-9]+\\)}" (line-end-position) t)
        (string-to-number (match-string 1))))