1 Return-Path: <jrollins@servo.finestructure.net>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 18249431FD0
\r
6 for <notmuch@notmuchmail.org>; Sun, 29 May 2011 11:56:36 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5
\r
12 tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3]
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id ihfG6PiLDruN for <notmuch@notmuchmail.org>;
\r
17 Sun, 29 May 2011 11:56:35 -0700 (PDT)
\r
18 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu
\r
20 by olra.theworths.org (Postfix) with ESMTP id 1DDDA431FB6
\r
21 for <notmuch@notmuchmail.org>; Sun, 29 May 2011 11:56:35 -0700 (PDT)
\r
22 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])
\r
23 by earth-doxen-postvirus (Postfix) with ESMTP id 694A866E03C1;
\r
24 Sun, 29 May 2011 11:56:33 -0700 (PDT)
\r
25 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new
\r
26 Received: from servo.finestructure.net (cpe-98-149-172-122.socal.res.rr.com
\r
27 [98.149.172.122]) (Authenticated sender: jrollins)
\r
28 by earth-doxen-submit (Postfix) with ESMTP id 64EA066E0011;
\r
29 Sun, 29 May 2011 11:56:26 -0700 (PDT)
\r
30 Received: by servo.finestructure.net (Postfix, from userid 1000)
\r
31 id 10B39A4; Sun, 29 May 2011 11:56:27 -0700 (PDT)
\r
32 From: Jameson Graef Rollins <jrollins@finestructure.net>
\r
33 To: Notmuch Mail <notmuch@notmuchmail.org>
\r
34 Subject: [PATCH 2/2] emacs: add notmuch-show-worker function for specifying
\r
35 crypto processing directly
\r
36 Date: Sun, 29 May 2011 11:56:23 -0700
\r
37 Message-Id: <1306695383-18651-2-git-send-email-jrollins@finestructure.net>
\r
38 X-Mailer: git-send-email 1.7.4.4
\r
39 In-Reply-To: <1306695383-18651-1-git-send-email-jrollins@finestructure.net>
\r
40 References: <1306627784-3401-2-git-send-email-jrollins@finestructure.net>
\r
41 <1306695383-18651-1-git-send-email-jrollins@finestructure.net>
\r
42 X-BeenThere: notmuch@notmuchmail.org
\r
43 X-Mailman-Version: 2.1.13
\r
45 List-Id: "Use and development of the notmuch mail system."
\r
46 <notmuch.notmuchmail.org>
\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
50 List-Post: <mailto:notmuch@notmuchmail.org>
\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
54 X-List-Received-Date: Sun, 29 May 2011 18:56:36 -0000
\r
56 The main reason to introduce this new unexposed function is to allow
\r
57 the buffer redisplay crypto switch to behaving in a more expected way.
\r
58 The prefix to notmuch-show-redisplay buffer now switches the crypto
\r
59 processing of the current show buffer, as opposed to switching the
\r
60 logic of the notmuch-crypto-process-mime customization variable. This
\r
61 behavior is more intuitive.
\r
63 emacs/notmuch-show.el | 20 ++++++++++++--------
\r
64 1 files changed, 12 insertions(+), 8 deletions(-)
\r
66 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
67 index 6e0d454..3a075a4 100644
\r
68 --- a/emacs/notmuch-show.el
\r
69 +++ b/emacs/notmuch-show.el
\r
70 @@ -811,13 +811,16 @@ The optional CRYPTO-SWITCH toggles the value of the
\r
71 notmuch-crypto-process-mime customization variable for this show
\r
73 (interactive "sNotmuch show: ")
\r
74 + (let* ((process-crypto (if crypto-switch
\r
75 + (not notmuch-crypto-process-mime)
\r
76 + notmuch-crypto-process-mime)))
\r
77 + (notmuch-show-worker thread-id parent-buffer query-context buffer-name process-crypto)))
\r
79 +(defun notmuch-show-worker (thread-id parent-buffer query-context buffer-name process-crypto)
\r
80 (let* ((buffer-name (generate-new-buffer-name
\r
82 (concat "*notmuch-" thread-id "*"))))
\r
83 (buffer (get-buffer-create buffer-name))
\r
84 - (process-crypto (if crypto-switch
\r
85 - (not notmuch-crypto-process-mime)
\r
86 - notmuch-crypto-process-mime))
\r
87 (inhibit-read-only t))
\r
88 (switch-to-buffer buffer)
\r
90 @@ -864,16 +867,17 @@ buffer."
\r
91 "Refresh the current view (with crypto switch if prefix given).
\r
93 Kills the current buffer and reruns notmuch show with the same
\r
94 -thread id. If a prefix is given, the current thread is
\r
95 -redisplayed with the crypto switch activated, which switch the
\r
96 -logic of the notmuch-crypto-process-mime customization variable."
\r
97 +thread id. If a prefix is given, crypto processing is toggled."
\r
99 (let ((thread-id notmuch-show-thread-id)
\r
100 (parent-buffer notmuch-show-parent-buffer)
\r
101 (query-context notmuch-show-query-context)
\r
102 - (buffer-name notmuch-show-buffer-name))
\r
103 + (buffer-name notmuch-show-buffer-name)
\r
104 + (process-crypto (if crypto-switch
\r
105 + (not notmuch-show-process-crypto)
\r
106 + notmuch-show-process-crypto)))
\r
107 (notmuch-kill-this-buffer)
\r
108 - (notmuch-show thread-id parent-buffer query-context buffer-name crypto-switch)))
\r
109 + (notmuch-show-worker thread-id parent-buffer query-context buffer-name process-crypto)))
\r
111 (defvar notmuch-show-stash-map
\r
112 (let ((map (make-sparse-keymap)))
\r