--- /dev/null
+Return-Path: <dme@dme.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id B29AB6DE02C9\r
+ for <notmuch@notmuchmail.org>; Sun, 3 Apr 2016 09:04:51 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.166\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.166 tagged_above=-999 required=5\r
+ tests=[AWL=-0.099, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,\r
+ RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,\r
+ RCVD_IN_MSPIKE_WL=-0.01, SPF_NEUTRAL=0.652, UNPARSEABLE_RELAY=0.001]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id FN2v-1jDnmOi for <notmuch@notmuchmail.org>;\r
+ Sun, 3 Apr 2016 09:04:43 -0700 (PDT)\r
+Received: from mail-lb0-f193.google.com (mail-lb0-f193.google.com\r
+ [209.85.217.193])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 1EA2F6DE0159\r
+ for <notmuch@notmuchmail.org>; Sun, 3 Apr 2016 09:04:43 -0700 (PDT)\r
+Received: by mail-lb0-f193.google.com with SMTP id vk4so17542234lbb.1\r
+ for <notmuch@notmuchmail.org>; Sun, 03 Apr 2016 09:04:43 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=dme-org.20150623.gappssmtp.com; s=20150623;\r
+ h=from:to:subject:date:message-id;\r
+ bh=hs2+c7+ittloHbrCI7LyEvlOjwlNMaLEMSlwazQ1T6c=;\r
+ b=wv3PdNpmM4v16JutHnUzftWEcWiZvUVxkWI7wGROQCfBuDVR0RLwsmxFnyQR7jbEPk\r
+ 6iz6v3Eh7wfwiENLtAkaHg87FTxCdFvhUoOb8tKWHlLMvRifg4lnu6Dho1QXEuCz2/JM\r
+ nv6NLZhByRrWSabiJaMETtaW5BL3H0YDL393/W3YFf+E+9f6lMo+93Fxw7VzorptG3ew\r
+ JdRrYgwPoXYFOIlqhRrKUHzrXFfFLscMmgvh/kgO7HxFF9tOkBj2WokIwGQvCk5M3TRe\r
+ yU4myUjPShlj35nRc7/+XD7MBY3AaRgq7nQ1Bgyq1gZBDLQbp52KV88ARLQEWNsZ/39z\r
+ ZBjw==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:subject:date:message-id;\r
+ bh=hs2+c7+ittloHbrCI7LyEvlOjwlNMaLEMSlwazQ1T6c=;\r
+ b=cQdZhli/TRDw6Solt+uJDs/VuMPVQIyZ7NIDMiBQdzD5D0l7J5v2k0jjELaRnIZN9W\r
+ amsHAYH+CObb/NoelQTepokr1zI289Tqvb5o5h+Yyi/KF74DnqF9xkokg56/zXXaSuBh\r
+ VEjWNM5TqBZkiPx4y/bmt43jEWw+ANZD0CrTfWf1mpPQsd4m8QgaEwdoRxEXo64fdxiI\r
+ tWzbQYaZYcT2R4xwuLnNSNoCrKh9mJSouMCyJgmQtPP1JogIzVloHu2/BvYQgBLAkGk8\r
+ WrIibXgUv2AcK5el8IF8QpDIa4/ExowpCgvCNdsALyWqAZ1muz5t1gACFGW+KYOORXh7\r
+ +ITQ==\r
+X-Gm-Message-State:\r
+ AD7BkJKyomXbLv2XrV+BDLHVdN8T781mw2gUiua79gpMLCiEfjo5d/CS7LLiL2cTYoVAoA==\r
+X-Received: by 10.28.136.211 with SMTP id k202mr8055209wmd.93.1459699481369;\r
+ Sun, 03 Apr 2016 09:04:41 -0700 (PDT)\r
+Received: from disaster-area.hh.sledj.net\r
+ ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])\r
+ by smtp.gmail.com with ESMTPSA id gk4sm24351438wjd.7.2016.04.03.09.04.39\r
+ for <notmuch@notmuchmail.org>\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sun, 03 Apr 2016 09:04:39 -0700 (PDT)\r
+Received: from localhost (disaster-area.hh.sledj.net [local])\r
+ by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 47376ba4\r
+ for <notmuch@notmuchmail.org>; Sun, 3 Apr 2016 16:04:38 +0000 (UTC)\r
+From: David Edmondson <dme@dme.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3] Allow content preference based on message content.\r
+Date: Sun, 3 Apr 2016 17:04:37 +0100\r
+Message-Id: <1459699478-21167-1-git-send-email-dme@dme.org>\r
+X-Mailer: git-send-email 2.1.4\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 03 Apr 2016 16:04:51 -0000\r
+\r
+\r
+Allow content preference based on message content.\r
+\r
+An example configuration might be:\r
+\r
+ (defun dme:determine-discouraged (msg)\r
+ (let* ((headers (plist-get msg :headers))\r
+ (from (or (plist-get headers :From) "")))\r
+ (cond\r
+ ((string-match "9195404@capita-intouch.co.uk" from)\r
+ '("text/plain"))\r
+ (t\r
+ '("text/html" "multipart/related")))))\r
+\r
+ (setq notmuch-multipart/alternative-discouraged\r
+ 'dme:determine-discouraged)\r
+\r
+This would discourage text/html and multipart/related generally, but\r
+discourage text/plain should the message be sent from\r
+9195404@capita-intouch.co.uk.\r
+\r
+v2:\r
+- Remove the simple evaluation variant based on feedback.\r
+\r
+v3:\r
+- Merge forward.\r
+- Update the example to allow for a nil msg (which should no longer\r
+ happen, but it's good to be safe).\r
+\r
+\r
+David Edmondson (1):\r
+ emacs: Allow part preferences to depend on message content.\r
+\r
+ emacs/notmuch-lib.el | 20 ++++++++++++++++----\r
+ emacs/notmuch-show.el | 2 +-\r
+ 2 files changed, 17 insertions(+), 5 deletions(-)\r
+\r
+-- \r
+2.1.4\r
+\r