Commit a56a1cce authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen Committed by Katsumi Yamaoka
Browse files

nnimap.el (nnimap-unfold-quoted-lines): Refactor out.

nnimap.el (nnimap-last-response-string): Unfold quoted lines, if they exist.
parent 5a973d51
2010-11-25 Lars Magne Ingebrigtsen <larsi@gnus.org>
* nnimap.el (nnimap-unfold-quoted-lines): Refactor out.
(nnimap-last-response-string): Unfold quoted lines, if they exist.
2010-11-25 Katsumi Yamaoka <yamaoka@jpl.org> 2010-11-25 Katsumi Yamaoka <yamaoka@jpl.org>
   
* shr.el (shr-insert): Fix the way to fold lines. * shr.el (shr-insert): Fix the way to fold lines.
......
...@@ -180,13 +180,7 @@ textual parts.") ...@@ -180,13 +180,7 @@ textual parts.")
(when (eobp) (when (eobp)
(return))) (return)))
(setq article (match-string 1)) (setq article (match-string 1))
;; Unfold quoted {number} strings. (nnimap-unfold-quoted-lines)
(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)))
(setq bytes (nnimap-get-length) (setq bytes (nnimap-get-length)
lines nil) lines nil)
(beginning-of-line) (beginning-of-line)
...@@ -216,6 +210,15 @@ textual parts.") ...@@ -216,6 +210,15 @@ textual parts.")
(insert ".") (insert ".")
(forward-line 1))))) (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 () (defun nnimap-get-length ()
(and (re-search-forward "{\\([0-9]+\\)}" (line-end-position) t) (and (re-search-forward "{\\([0-9]+\\)}" (line-end-position) t)
(string-to-number (match-string 1)))) (string-to-number (match-string 1))))
...@@ -1602,6 +1605,13 @@ textual parts.") ...@@ -1602,6 +1605,13 @@ textual parts.")
(save-excursion (save-excursion
(forward-line 1) (forward-line 1)
(let ((end (point))) (let ((end (point)))
;; Unfold quoted {num} lines, if they exist.
(when (search-backward "}" nil t)
(save-excursion
(save-restriction
(narrow-to-region (point-min) end)
(goto-char (point-min))
(nnimap-unfold-quoted-lines))))
(forward-line -1) (forward-line -1)
(when (not (bobp)) (when (not (bobp))
(forward-line -1) (forward-line -1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment