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