Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 9E18B431FD0 for ; Thu, 2 Jun 2011 10:06:33 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.921 X-Spam-Level: X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5 tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DVmCY2V1IKrE for ; Thu, 2 Jun 2011 10:06:32 -0700 (PDT) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by olra.theworths.org (Postfix) with ESMTP id 435E2431FB6 for ; Thu, 2 Jun 2011 10:06:32 -0700 (PDT) Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1]) by fire-doxen-postvirus (Postfix) with ESMTP id D3CDC32806D; Thu, 2 Jun 2011 09:59:43 -0700 (PDT) X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new Received: from servo.finestructure.net (cpe-98-149-172-122.socal.res.rr.com [98.149.172.122]) (Authenticated sender: jrollins) by fire-doxen-submit (Postfix) with ESMTP id 09BEE2E50E71; Thu, 2 Jun 2011 09:59:40 -0700 (PDT) Received: by servo.finestructure.net (Postfix, from userid 1000) id 8E181AD8; Thu, 2 Jun 2011 10:06:27 -0700 (PDT) From: Jameson Graef Rollins To: Notmuch Mail Subject: [PATCH] emacs: Fix handling of message/rfc822 parts. Date: Thu, 2 Jun 2011 10:06:26 -0700 Message-Id: <1307034386-6107-1-git-send-email-jrollins@finestructure.net> X-Mailer: git-send-email 1.7.4.4 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jun 2011 17:06:33 -0000 After the recent part-handling overhaul, emacs handling of message/rfc822 parts broke, not outputting the message contents. This "fixes" then handling as is, but there are still problems with how notmuch is outputting message parts that needs to be addressed (for instance, message headers are not being output at the moment). This also indicates that we need a test for output of message parts in emacs. --- emacs/notmuch-show.el | 27 ++++++++++++++++----------- 1 files changed, 16 insertions(+), 11 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 9837c7a..714200a 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -516,21 +516,26 @@ current buffer, if possible." t) (defun notmuch-show-insert-part-message/rfc822 (msg part content-type nth depth declared-type) - (let* ((message-part (plist-get part :content)) - (inner-parts (plist-get message-part :content))) - (notmuch-show-insert-part-header nth declared-type content-type nil) - ;; Override `notmuch-message-headers' to force `From' to be - ;; displayed. - (let ((notmuch-message-headers '("From" "Subject" "To" "Cc" "Date"))) - (notmuch-show-insert-headers (plist-get part :headers))) - ;; Blank line after headers to be compatible with the normal - ;; message display. - (insert "\n") + (notmuch-show-insert-part-header nth declared-type content-type nil) + (let ((inner-parts (plist-get part :content)) + (start (point))) + (if (plist-member part :headers) + (progn + ;; Override `notmuch-message-headers' to force `From' to be + ;; displayed. + (let ((notmuch-message-headers '("From" "Subject" "To" "Cc" "Date"))) + (notmuch-show-insert-headers (plist-get part :headers))) + ;; Blank line after headers to be compatible with the normal + ;; message display. + (insert "foo\n"))) ;; Show all of the parts. (mapc (lambda (inner-part) (notmuch-show-insert-bodypart msg inner-part depth)) - inner-parts)) + inner-parts) + + (when notmuch-show-indent-multipart + (indent-rigidly start (point) 1))) t) (defun notmuch-show-insert-part-text/plain (msg part content-type nth depth declared-type) -- 1.7.4.4