[PATCH 01/11] emacs: Remove redundant NTH argument from `notmuch-get-bodypart-content'.
authorAustin Clements <amdragon@MIT.EDU>
Mon, 21 Apr 2014 18:37:38 +0000 (14:37 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:01:48 +0000 (10:01 -0800)
68/4de6698f5ad7391357c5841e334ec1db5a8af5 [new file with mode: 0644]

diff --git a/68/4de6698f5ad7391357c5841e334ec1db5a8af5 b/68/4de6698f5ad7391357c5841e334ec1db5a8af5
new file mode 100644 (file)
index 0000000..8ac1225
--- /dev/null
@@ -0,0 +1,154 @@
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 14090431FDB\r
+       for <notmuch@notmuchmail.org>; Mon, 21 Apr 2014 11:38:09 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id y4JtoyugfJSW for <notmuch@notmuchmail.org>;\r
+       Mon, 21 Apr 2014 11:38:04 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu\r
+       [18.9.25.12])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id F0BA0431FBD\r
+       for <notmuch@notmuchmail.org>; Mon, 21 Apr 2014 11:37:58 -0700 (PDT)\r
+X-AuditID: 1209190c-f794a6d000000c27-5b-5355658534ec\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       (using TLS with cipher AES256-SHA (256/256 bits))\r
+       (Client did not present a certificate)\r
+       by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 7F.C9.03111.58565535; Mon, 21 Apr 2014 14:37:57 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id s3LIbupp022316; \r
+       Mon, 21 Apr 2014 14:37:56 -0400\r
+Received: from drake.dyndns.org\r
+       (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [216.15.114.40]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s3LIbs7B029708\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Mon, 21 Apr 2014 14:37:56 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1WcJ6I-0003ks-AL; Mon, 21 Apr 2014 14:37:54 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 01/11] emacs: Remove redundant NTH argument from\r
+       `notmuch-get-bodypart-content'.\r
+Date: Mon, 21 Apr 2014 14:37:38 -0400\r
+Message-Id: <1398105468-14317-2-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.9.1\r
+In-Reply-To: <1398105468-14317-1-git-send-email-amdragon@mit.edu>\r
+References: <1398105468-14317-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsUixG6nrtuaGhpsMO2JlcX1mzOZHRg9nq26\r
+       xRzAGMVlk5Kak1mWWqRvl8CV8W3yIbaCy7IVb64fY25gvCHRxcjJISFgInF7+nMWCFtM4sK9\r
+       9WxdjFwcQgKzmSRezjnPDuFsZJSY/voPM4Rzh0mi88VcFghnLqNEy6HHjCD9bAIaEtv2Lwez\r
+       RQSkJXbenc3axcjBwSygJvGnSwUkLCyQIHH9QgsziM0ioCpxfe1csHJeAQeJ1eePMkKcISdx\r
+       8thkVhCbU8BRom31S3YQWwioZsPeNUwTGPkXMDKsYpRNya3SzU3MzClOTdYtTk7My0st0jXU\r
+       y80s0UtNKd3ECAobTkmeHYxvDiodYhTgYFTi4ZUwCA0WYk0sK67MPcQoycGkJMr7KgooxJeU\r
+       n1KZkVicEV9UmpNafIhRgoNZSYR3vSZQjjclsbIqtSgfJiXNwaIkzvvW2ipYSCA9sSQ1OzW1\r
+       ILUIJivDwaEkwWuXAtQoWJSanlqRlplTgpBm4uAEGc4DNDwKpIa3uCAxtzgzHSJ/ilFRSpyX\r
+       MRkoIQCSyCjNg+uFxfUrRnGgV4R53UHaeYApAa77FdBgJqDBT7aEgAwuSURISTUwTjmqO7VO\r
+       4ckJ3iTuzQu7dS/xRrxe7bO41H6ZzMW7W+VqM6WZ5jgcj4gTuXzUeILCaTVWC+8ky8ueN7mj\r
+       rb833dZ8xrZdsbKdRZSp6t9Sq5RNXAtsX06/f7nx4jaFOxvt6zzWRJSUCng7fJ23qEDk8lRR\r
+       16M/9b8KHvGcdEtQXN22YL7qGR0bJZbijERDLeai4kQAdDgMBsYCAAA=\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 21 Apr 2014 18:38:09 -0000\r
+\r
+This can be derived from the PART argument (which is arguably\r
+canonical), so there's no sense in giving the caller an extra foot\r
+gun.\r
+---\r
+ emacs/notmuch-lib.el  | 9 +++++----\r
+ emacs/notmuch-show.el | 6 +++---\r
+ 2 files changed, 8 insertions(+), 7 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+index 2941da3..35b9065 100644\r
+--- a/emacs/notmuch-lib.el\r
++++ b/emacs/notmuch-lib.el\r
+@@ -518,9 +518,10 @@ (defun notmuch-get-bodypart-internal (query part-number process-crypto)\r
+         (apply 'call-process (append (list notmuch-command nil (list t nil) nil) args))\r
+         (buffer-string))))))\r
\r
+-(defun notmuch-get-bodypart-content (msg part nth process-crypto)\r
++(defun notmuch-get-bodypart-content (msg part process-crypto)\r
+   (or (plist-get part :content)\r
+-      (notmuch-get-bodypart-internal (notmuch-id-to-query (plist-get msg :id)) nth process-crypto)))\r
++      (notmuch-get-bodypart-internal (notmuch-id-to-query (plist-get msg :id))\r
++                                   (plist-get part :id) process-crypto)))\r
\r
+ ;; Workaround: The call to `mm-display-part' below triggers a bug in\r
+ ;; Emacs 24 if it attempts to use the shr renderer to display an HTML\r
+@@ -536,7 +537,7 @@ (defun notmuch-get-bodypart-content (msg part nth process-crypto)\r
+       (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)\r
+       (ad-activate 'mm-shr)))\r
\r
+-(defun notmuch-mm-display-part-inline (msg part nth content-type process-crypto)\r
++(defun notmuch-mm-display-part-inline (msg part content-type process-crypto)\r
+   "Use the mm-decode/mm-view functions to display a part in the\r
+ current buffer, if possible."\r
+   (let ((display-buffer (current-buffer)))\r
+@@ -552,7 +553,7 @@ (defun notmuch-mm-display-part-inline (msg part nth content-type process-crypto)\r
+       ;; test whether we are able to inline it (which includes both\r
+       ;; capability and suitability tests).\r
+       (when (mm-inlined-p handle)\r
+-        (insert (notmuch-get-bodypart-content msg part nth process-crypto))\r
++        (insert (notmuch-get-bodypart-content msg part process-crypto))\r
+         (when (mm-inlinable-p handle)\r
+           (set-buffer display-buffer)\r
+           (mm-display-part handle)\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index df10d4b..949ac09 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -695,7 +695,7 @@ (defun notmuch-show-insert-part-text/plain (msg part content-type nth depth butt\r
+   (let ((start (if button\r
+                  (button-start button)\r
+                (point))))\r
+-    (insert (notmuch-get-bodypart-content msg part nth notmuch-show-process-crypto))\r
++    (insert (notmuch-get-bodypart-content msg part notmuch-show-process-crypto))\r
+     (save-excursion\r
+       (save-restriction\r
+       (narrow-to-region start (point-max))\r
+@@ -704,7 +704,7 @@ (defun notmuch-show-insert-part-text/plain (msg part content-type nth depth butt\r
\r
+ (defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth button)\r
+   (insert (with-temp-buffer\r
+-          (insert (notmuch-get-bodypart-content msg part nth notmuch-show-process-crypto))\r
++          (insert (notmuch-get-bodypart-content msg part notmuch-show-process-crypto))\r
+           ;; notmuch-get-bodypart-content provides "raw", non-converted\r
+           ;; data. Replace CRLF with LF before icalendar can use it.\r
+           (goto-char (point-min))\r
+@@ -756,7 +756,7 @@ (defun notmuch-show-insert-part-text/html (msg part content-type nth depth butto\r
\r
+ (defun notmuch-show-insert-part-*/* (msg part content-type nth depth button)\r
+   ;; This handler _must_ succeed - it is the handler of last resort.\r
+-  (notmuch-mm-display-part-inline msg part nth content-type notmuch-show-process-crypto)\r
++  (notmuch-mm-display-part-inline msg part content-type notmuch-show-process-crypto)\r
+   t)\r
\r
+ ;; Functions for determining how to handle MIME parts.\r
+-- \r
+1.9.1\r
+\r