aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.el
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-16 14:53:02 -0800
committerGravatar Carl Worth <cworth@cworth.org>2009-11-16 14:53:02 -0800
commitea484f0ebf3f25fbc701b061f36e2fe167057cc3 (patch)
tree678a0785d2362febdba879a2b6778cb8ddc83361 /notmuch.el
parentc004e1e04b9d1b80ea65b26d65a9ec20641cc64c (diff)
notmuch.el: Insert a newline if the last line of a part is missing one.
I think there's a GMime bug that we're getting parts decoded without a final newline (the encoded parts seem to have them just fine). We can workaround the bug easily enough by finding a part-closing delimiter that is not at the beginning of a line, and if so, just insert a newline. Without this, the one-line-summary of the next message would continue on the same line as the last line of the previous message, (and this would often happen for mailing-list messages where mailman would add an extra part for its signature block).
Diffstat (limited to 'notmuch.el')
-rw-r--r--notmuch.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/notmuch.el b/notmuch.el
index 6d609dba..f1523ac0 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -464,11 +464,15 @@ which this thread was originally shown."
(let ((beg (point-marker)))
(re-search-forward notmuch-show-part-end-regexp)
(let ((end (copy-marker (match-beginning 0))))
+ (goto-char end)
+ (if (not (bolp))
+ (insert "\n"))
(indent-rigidly beg end depth)
(notmuch-show-markup-citations-region beg end depth)
; Advance to the next part (if any) (so the outer loop can
; determine whether we've left the current message.
- (re-search-forward notmuch-show-part-begin-regexp nil t))))
+ (if (re-search-forward notmuch-show-part-begin-regexp nil t)
+ (beginning-of-line)))))
(goto-char end)))
(defun notmuch-show-markup-parts-region (beg end depth)