unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jameson Graef Rollins <jrollins@finestructure.net>
To: Notmuch Mail <notmuch@notmuchmail.org>
Subject: [PATCH 2/2] emacs: add notmuch-show-worker function for specifying crypto processing directly
Date: Sun, 29 May 2011 11:56:23 -0700	[thread overview]
Message-ID: <1306695383-18651-2-git-send-email-jrollins@finestructure.net> (raw)
In-Reply-To: <1306695383-18651-1-git-send-email-jrollins@finestructure.net>

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 6e0d454..3a075a4 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -811,13 +811,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)
@@ -864,16 +867,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.4.4

  reply	other threads:[~2011-05-29 18:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-29  0:09 [PATCH 1/2] emacs: add notmuch-show-refresh-view function Jameson Graef Rollins
2011-05-29  0:09 ` [PATCH 2/2] emacs: Unbind M-RET as display of thread with crypto switch Jameson Graef Rollins
2011-05-29 18:56   ` [PATCH 1/2] emacs: add documentation for notmuch-show crypto-switch option Jameson Graef Rollins
2011-05-29 18:56     ` Jameson Graef Rollins [this message]
2011-05-31 17:06       ` [PATCH] emacs: update notmuch-crypto-process-mime config variable documentation Jameson Graef Rollins
2011-11-12 21:12   ` [PATCH 2/2] emacs: Unbind M-RET as display of thread with crypto switch Jameson Graef Rollins
2011-11-13  2:29     ` David Bremner
2011-11-13 19:15       ` Jameson Graef Rollins
2011-11-13 19:15         ` [PATCH 1/2] emacs: add documentation for notmuch-show crypto-switch option Jameson Graef Rollins
2011-11-13 19:15           ` [PATCH 2/2] emacs: add notmuch-show-worker function for specifying crypto processing directly Jameson Graef Rollins
2011-10-06 13:35 ` [PATCH 1/2] emacs: add notmuch-show-refresh-view function David Bremner
2011-10-06 17:38   ` Jameson Graef Rollins
2011-10-06 13:50 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1306695383-18651-2-git-send-email-jrollins@finestructure.net \
    --to=jrollins@finestructure.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).