From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 81A14429E28 for ; Tue, 27 Dec 2011 08:04:50 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 T-hgKgp9XRT7 for ; Tue, 27 Dec 2011 08:04:50 -0800 (PST) Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id B29F2431FB6 for ; Tue, 27 Dec 2011 08:04:49 -0800 (PST) Received: by mail-ee0-f53.google.com with SMTP id d41so14244908eek.26 for ; Tue, 27 Dec 2011 08:04:49 -0800 (PST) Received: by 10.213.35.12 with SMTP id n12mr9089505ebd.25.1325001889081; Tue, 27 Dec 2011 08:04:49 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi. [80.220.92.23]) by mx.google.com with ESMTPS id u53sm60299769eeu.6.2011.12.27.08.04.46 (version=SSLv3 cipher=OTHER); Tue, 27 Dec 2011 08:04:48 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH v3 1/3] emacs: add inline patch fake parts through a special handler Date: Tue, 27 Dec 2011 18:04:38 +0200 Message-Id: X-Mailer: git-send-email 1.7.5.4 In-Reply-To: References: <1321657368-13872-1-git-send-email-jani@nikula.org> In-Reply-To: References: 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: Tue, 27 Dec 2011 16:04:50 -0000 Add wash generated inline patch fake parts through a special "inline-patch-fake-part" handler to distinguish them from real MIME parts. The fake parts are described as "inline patch (as text/x-diff)". Signed-off-by: Jani Nikula --- emacs/notmuch-show.el | 4 ++++ emacs/notmuch-wash.el | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index eee4da9..6ef3f90 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -585,6 +585,10 @@ current buffer, if possible." nil)) nil)))) +;; Handler for wash generated inline patch fake parts. +(defun notmuch-show-insert-part-inline-patch-fake-part (msg part content-type nth depth declared-type) + (notmuch-show-insert-part-*/* msg part "text/x-diff" nth depth "inline patch")) + (defun notmuch-show-insert-part-*/* (msg part content-type nth depth declared-type) ;; This handler _must_ succeed - it is the handler of last resort. (notmuch-show-insert-part-header nth content-type declared-type (plist-get part :filename)) diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index 1f420b2..e9f2dba 100644 --- a/emacs/notmuch-wash.el +++ b/emacs/notmuch-wash.el @@ -313,7 +313,7 @@ for error." (setq patch-end (match-beginning 0))) (save-restriction (narrow-to-region patch-start patch-end) - (setq part (plist-put part :content-type "text/x-diff")) + (setq part (plist-put part :content-type "inline-patch-fake-part")) (setq part (plist-put part :content (buffer-string))) (setq part (plist-put part :id -1)) (setq part (plist-put part :filename "inline patch")) -- 1.7.5.4