summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2011-01-31 13:50:07 +0100
committerJulien Danjou <julien@danjou.info>2011-01-31 13:50:07 +0100
commit395a49fac882241194d89963e54b9293dabd157b (patch)
tree567d75b17e743a6ac292899f0b93d57206e367e8
parent3f1be76100441d3bff7bc7f723c386f60bc10243 (diff)
Split lines
Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r--offlineimap.el37
1 files changed, 19 insertions, 18 deletions
diff --git a/offlineimap.el b/offlineimap.el
index ee703fd..c3eac20 100644
--- a/offlineimap.el
+++ b/offlineimap.el
@@ -229,24 +229,25 @@ This is used when `offlineimap-mode-line-style' is set to 'symbol."
(defun offlineimap-process-filter (process msg)
"Filter PROCESS output MSG."
- (let* ((msg-data (split-string msg ":"))
- (msg-type (nth 0 msg-data))
- (action (nth 1 msg-data))
- (thread-name (nth 2 msg-data))
- (buffer (process-buffer process)))
- (when (buffer-live-p buffer)
- (with-current-buffer buffer
- (offlineimap-insert process
- (offlineimap-propertize-face
- msg-type
- action
- (concat thread-name "::" action "\n")))
- (let ((comint-buffer-maximum-size offlineimap-buffer-maximum-size))
- (comint-truncate-buffer))))
- (process-put process :last-msg-type msg-type)
- (process-put process :last-action action)
- (offlineimap-update-mode-line process)
- (run-hook-with-args 'offlineimap-event-hooks msg-type action)))
+ (dolist (msg-line (nbutlast (split-string msg "[\n\r]+")))
+ (let* ((msg-data (split-string (car msg-lines) ":"))
+ (msg-type (nth 0 msg-data))
+ (action (nth 1 msg-data))
+ (thread-name (nth 2 msg-data))
+ (buffer (process-buffer process)))
+ (when (buffer-live-p buffer)
+ (with-current-buffer buffer
+ (offlineimap-insert process
+ (offlineimap-propertize-face
+ msg-type
+ action
+ (concat thread-name "::" action "\n")))
+ (let ((comint-buffer-maximum-size offlineimap-buffer-maximum-size))
+ (comint-truncate-buffer))))
+ (process-put process :last-msg-type msg-type)
+ (process-put process :last-action action)
+ (offlineimap-update-mode-line process)
+ (run-hook-with-args 'offlineimap-event-hooks msg-type action))))
(defun offlineimap-process-sentinel (process state)
"Monitor STATE change of PROCESS."