[PATCH 2/2] emacs: add notmuch-show-worker function for specifying crypto processing...
authorJameson Graef Rollins <jrollins@finestructure.net>
Sun, 13 Nov 2011 19:15:21 +0000 (11:15 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:08 +0000 (09:40 -0800)
34/8ff2ac3d1a569651177003b3de593c1717bfc4 [new file with mode: 0644]

diff --git a/34/8ff2ac3d1a569651177003b3de593c1717bfc4 b/34/8ff2ac3d1a569651177003b3de593c1717bfc4
new file mode 100644 (file)
index 0000000..c7328e9
--- /dev/null
@@ -0,0 +1,115 @@
+Return-Path: <jrollins@finestructure.net>\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 03C95431FB6\r
+       for <notmuch@notmuchmail.org>; Sun, 13 Nov 2011 11:15:35 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] 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 lsQONCU9hZh9 for <notmuch@notmuchmail.org>;\r
+       Sun, 13 Nov 2011 11:15:32 -0800 (PST)\r
+Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
+       [131.215.239.19])\r
+       by olra.theworths.org (Postfix) with ESMTP id B13B9429E21\r
+       for <notmuch@notmuchmail.org>; Sun, 13 Nov 2011 11:15:32 -0800 (PST)\r
+Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+       by fire-doxen-postvirus (Postfix) with ESMTP id 786722E50D65\r
+       for <notmuch@notmuchmail.org>; Sun, 13 Nov 2011 11:15:30 -0800 (PST)\r
+X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new\r
+Received: from finestructure.net (cpe-76-174-136-149.socal.res.rr.com\r
+       [76.174.136.149]) (Authenticated sender: jrollins)\r
+       by fire-doxen-submit (Postfix) with ESMTP id A68A32E50D83\r
+       for <notmuch@notmuchmail.org>; Sun, 13 Nov 2011 11:15:28 -0800 (PST)\r
+Received: by finestructure.net (Postfix, from userid 1000)\r
+       id 44F5D1AB9; Sun, 13 Nov 2011 11:15:28 -0800 (PST)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH 2/2] emacs: add notmuch-show-worker function for specifying\r
+       crypto processing directly\r
+Date: Sun, 13 Nov 2011 11:15:21 -0800\r
+Message-Id: <1321211721-7608-3-git-send-email-jrollins@finestructure.net>\r
+X-Mailer: git-send-email 1.7.7.1\r
+In-Reply-To: <1321211721-7608-2-git-send-email-jrollins@finestructure.net>\r
+References: <87ipmo69hi.fsf@zancas.localnet>\r
+       <1321211721-7608-1-git-send-email-jrollins@finestructure.net>\r
+       <1321211721-7608-2-git-send-email-jrollins@finestructure.net>\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: Sun, 13 Nov 2011 19:15:35 -0000\r
+\r
+The main reason to introduce this new unexposed function is to allow\r
+the buffer redisplay crypto switch to behaving in a more expected way.\r
+The prefix to notmuch-show-redisplay buffer now switches the crypto\r
+processing of the current show buffer, as opposed to switching the\r
+logic of the notmuch-crypto-process-mime customization variable.  This\r
+behavior is more intuitive.\r
+---\r
+ emacs/notmuch-show.el |   20 ++++++++++++--------\r
+ 1 files changed, 12 insertions(+), 8 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 95af32a..d5c95d8 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -830,13 +830,16 @@ The optional CRYPTO-SWITCH toggles the value of the\r
+ notmuch-crypto-process-mime customization variable for this show\r
+ buffer."\r
+   (interactive "sNotmuch show: ")\r
++  (let* ((process-crypto (if crypto-switch\r
++                           (not notmuch-crypto-process-mime)\r
++                         notmuch-crypto-process-mime)))\r
++    (notmuch-show-worker thread-id parent-buffer query-context buffer-name process-crypto)))\r
++\r
++(defun notmuch-show-worker (thread-id parent-buffer query-context buffer-name process-crypto)\r
+   (let* ((buffer-name (generate-new-buffer-name\r
+                      (or buffer-name\r
+                          (concat "*notmuch-" thread-id "*"))))\r
+        (buffer (get-buffer-create buffer-name))\r
+-       (process-crypto (if crypto-switch\r
+-                           (not notmuch-crypto-process-mime)\r
+-                         notmuch-crypto-process-mime))\r
+        (inhibit-read-only t))\r
+     (switch-to-buffer buffer)\r
+     (notmuch-show-mode)\r
+@@ -882,16 +885,17 @@ buffer."\r
+   "Refresh the current view (with crypto switch if prefix given).\r
\r
+ Kills the current buffer and reruns notmuch show with the same\r
+-thread id.  If a prefix is given, the current thread is\r
+-redisplayed with the crypto switch activated, which switch the\r
+-logic of the notmuch-crypto-process-mime customization variable."\r
++thread id.  If a prefix is given, crypto processing is toggled."\r
+   (interactive "P")\r
+   (let ((thread-id notmuch-show-thread-id)\r
+       (parent-buffer notmuch-show-parent-buffer)\r
+       (query-context notmuch-show-query-context)\r
+-      (buffer-name notmuch-show-buffer-name))\r
++      (buffer-name notmuch-show-buffer-name)\r
++      (process-crypto (if crypto-switch\r
++                          (not notmuch-show-process-crypto)\r
++                        notmuch-show-process-crypto)))\r
+     (notmuch-kill-this-buffer)\r
+-    (notmuch-show thread-id parent-buffer query-context buffer-name crypto-switch)))\r
++    (notmuch-show-worker thread-id parent-buffer query-context buffer-name process-crypto)))\r
\r
+ (defvar notmuch-show-stash-map\r
+   (let ((map (make-sparse-keymap)))\r
+-- \r
+1.7.7.1\r
+\r