* [PATCH 1/2] emacs: add notmuch-show-refresh-view function
@ 2011-05-29 0:09 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
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Jameson Graef Rollins @ 2011-05-29 0:09 UTC (permalink / raw)
To: Notmuch Mail
This function, like the equivalent for notmuch-search, just refreshes
the current show view. Like in notmuch-search, this new function is
bound to "=". If a prefix is given then the rediplay happens with the
crypto-switch set, which displays the thread with the opposite logic
of whatever is set in the notmuch-crypto-process-mime customization
variable.
---
emacs/notmuch-show.el | 42 +++++++++++++++++++++++++++++++++++-------
1 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index a25ad99..3b35b81 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -780,8 +780,14 @@ current buffer, if possible."
"Insert the forest of threads FOREST."
(mapc '(lambda (thread) (notmuch-show-insert-thread thread 0)) forest))
+(defvar notmuch-show-thread-id nil)
+(make-variable-buffer-local 'notmuch-show-thread-id)
(defvar notmuch-show-parent-buffer nil)
(make-variable-buffer-local 'notmuch-show-parent-buffer)
+(defvar notmuch-show-query-context nil)
+(make-variable-buffer-local 'notmuch-show-query-context)
+(defvar notmuch-show-buffer-name nil)
+(make-variable-buffer-local 'notmuch-show-buffer-name)
;;;###autoload
(defun notmuch-show (thread-id &optional parent-buffer query-context buffer-name crypto-switch)
@@ -801,17 +807,23 @@ which the message thread is shown. If it is nil (which occurs
when the command is called interactively) the argument to the
function is used. "
(interactive "sNotmuch show: ")
- (let ((buffer (get-buffer-create (generate-new-buffer-name
- (or buffer-name
- (concat "*notmuch-" thread-id "*")))))
- (process-crypto (if crypto-switch
- (not notmuch-crypto-process-mime)
- notmuch-crypto-process-mime))
- (inhibit-read-only t))
+ (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)
+
+ (setq notmuch-show-thread-id thread-id)
(setq notmuch-show-parent-buffer parent-buffer)
+ (setq notmuch-show-query-context query-context)
+ (setq notmuch-show-buffer-name buffer-name)
(setq notmuch-show-process-crypto process-crypto)
+
(erase-buffer)
(goto-char (point-min))
(save-excursion
@@ -844,6 +856,21 @@ function is used. "
(notmuch-show-mark-read)))
+(defun notmuch-show-refresh-view (&optional crypto-switch)
+ "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."
+ (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))
+ (notmuch-kill-this-buffer)
+ (notmuch-show thread-id parent-buffer query-context buffer-name crypto-switch)))
+
(defvar notmuch-show-stash-map
(let ((map (make-sparse-keymap)))
(define-key map "c" 'notmuch-show-stash-cc)
@@ -875,6 +902,7 @@ function is used. "
(define-key map "V" 'notmuch-show-view-raw-message)
(define-key map "v" 'notmuch-show-view-all-mime-parts)
(define-key map "c" 'notmuch-show-stash-map)
+ (define-key map "=" 'notmuch-show-refresh-view)
(define-key map "h" 'notmuch-show-toggle-headers)
(define-key map "-" 'notmuch-show-remove-tag)
(define-key map "+" 'notmuch-show-add-tag)
--
1.7.4.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/2] emacs: Unbind M-RET as display of thread with crypto switch.
2011-05-29 0:09 [PATCH 1/2] emacs: add notmuch-show-refresh-view function Jameson Graef Rollins
@ 2011-05-29 0:09 ` Jameson Graef Rollins
2011-05-29 18:56 ` [PATCH 1/2] emacs: add documentation for notmuch-show crypto-switch option 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-10-06 13:35 ` [PATCH 1/2] emacs: add notmuch-show-refresh-view function David Bremner
2011-10-06 13:50 ` David Bremner
2 siblings, 2 replies; 13+ messages in thread
From: Jameson Graef Rollins @ 2011-05-29 0:09 UTC (permalink / raw)
To: Notmuch Mail
Use prefix argument instead to set switch.
---
emacs/notmuch.el | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 3311fe8..0978c66 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -218,7 +218,6 @@ For a mouse binding, return nil."
(define-key map "-" 'notmuch-search-remove-tag)
(define-key map "+" 'notmuch-search-add-tag)
(define-key map (kbd "RET") 'notmuch-search-show-thread)
- (define-key map (kbd "M-RET") 'notmuch-search-show-thread-crypto-switch)
map)
"Keymap for \"notmuch search\" buffers.")
(fset 'notmuch-search-mode-map notmuch-search-mode-map)
@@ -418,13 +417,9 @@ Complete list of currently available key bindings:
"Return a list of authors for the current region"
(notmuch-search-properties-in-region 'notmuch-search-subject beg end))
-(defun notmuch-search-show-thread-crypto-switch ()
- (interactive)
- (notmuch-search-show-thread t))
-
(defun notmuch-search-show-thread (&optional crypto-switch)
"Display the currently selected thread."
- (interactive)
+ (interactive "P")
(let ((thread-id (notmuch-search-find-thread-id))
(subject (notmuch-search-find-subject)))
(if (> (length thread-id) 0)
--
1.7.4.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 1/2] emacs: add documentation for notmuch-show crypto-switch option
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 ` Jameson Graef Rollins
2011-05-29 18:56 ` [PATCH 2/2] emacs: add notmuch-show-worker function for specifying crypto processing directly 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
1 sibling, 1 reply; 13+ messages in thread
From: Jameson Graef Rollins @ 2011-05-29 18:56 UTC (permalink / raw)
To: Notmuch Mail
---
emacs/notmuch-show.el | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 3b35b81..6e0d454 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -805,7 +805,11 @@ non-nil.
The optional BUFFER-NAME provides the neame of the buffer in
which the message thread is shown. If it is nil (which occurs
when the command is called interactively) the argument to the
-function is used. "
+function is used.
+
+The optional CRYPTO-SWITCH toggles the value of the
+notmuch-crypto-process-mime customization variable for this show
+buffer."
(interactive "sNotmuch show: ")
(let* ((buffer-name (generate-new-buffer-name
(or buffer-name
--
1.7.4.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/2] emacs: add notmuch-show-worker function for specifying crypto processing directly
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
2011-05-31 17:06 ` [PATCH] emacs: update notmuch-crypto-process-mime config variable documentation Jameson Graef Rollins
0 siblings, 1 reply; 13+ messages in thread
From: Jameson Graef Rollins @ 2011-05-29 18:56 UTC (permalink / raw)
To: Notmuch Mail
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
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] emacs: Unbind M-RET as display of thread with crypto switch.
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-11-12 21:12 ` Jameson Graef Rollins
2011-11-13 2:29 ` David Bremner
1 sibling, 1 reply; 13+ messages in thread
From: Jameson Graef Rollins @ 2011-11-12 21:12 UTC (permalink / raw)
To: Notmuch Mail
[-- Attachment #1: Type: text/plain, Size: 322 bytes --]
So for some reason this patch and the three that follow it were not
pushed when the first was. They were all incorrectly marked in nmbug as
being pushed well. I assume this was just an oversight. In any event,
these should be pushed, since they normalize the behavior of this
keybinding, and fix documentation.
jamie.
[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] emacs: Unbind M-RET as display of thread with crypto switch.
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
0 siblings, 1 reply; 13+ messages in thread
From: David Bremner @ 2011-11-13 2:29 UTC (permalink / raw)
To: Jameson Graef Rollins, Notmuch Mail
On Sat, 12 Nov 2011 13:12:31 -0800, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> So for some reason this patch and the three that follow it were not
> pushed when the first was. They were all incorrectly marked in nmbug as
> being pushed well. I assume this was just an oversight. In any event,
> these should be pushed, since they normalize the behavior of this
> keybinding, and fix documentation.
Hi Jamie, I pushed two of these, but
id:"1306695383-18651-1-git-send-email-jrollins@finestructure.net"
id:"1306695383-18651-2-git-send-email-jrollins@finestructure.net"
did not apply for me, even with git am -3
d
^ permalink raw reply [flat|nested] 13+ messages in thread
* (no subject)
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
0 siblings, 1 reply; 13+ messages in thread
From: Jameson Graef Rollins @ 2011-11-13 19:15 UTC (permalink / raw)
To: Notmuch Mail
So this is incredibly confusing to me, but git is supposedly doing
something clever that allows these patches to apply in my repo but not
in a clean one.
In any event, I'm resending the patches after being applied to my
master, which should resolve any conflict and allow them to apply.
jamie.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/2] emacs: add documentation for notmuch-show crypto-switch option
2011-11-13 19:15 ` Jameson Graef Rollins
@ 2011-11-13 19:15 ` 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
0 siblings, 1 reply; 13+ messages in thread
From: Jameson Graef Rollins @ 2011-11-13 19:15 UTC (permalink / raw)
To: Notmuch Mail
---
emacs/notmuch-show.el | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index d395d87..95af32a 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -824,7 +824,11 @@ non-nil.
The optional BUFFER-NAME provides the name of the buffer in
which the message thread is shown. If it is nil (which occurs
when the command is called interactively) the argument to the
-function is used. "
+function is used.
+
+The optional CRYPTO-SWITCH toggles the value of the
+notmuch-crypto-process-mime customization variable for this show
+buffer."
(interactive "sNotmuch show: ")
(let* ((buffer-name (generate-new-buffer-name
(or buffer-name
--
1.7.7.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/2] emacs: add notmuch-show-worker function for specifying crypto processing directly
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 ` Jameson Graef Rollins
0 siblings, 0 replies; 13+ messages in thread
From: Jameson Graef Rollins @ 2011-11-13 19:15 UTC (permalink / raw)
To: Notmuch Mail
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
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] emacs: add notmuch-show-refresh-view function
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-10-06 13:35 ` David Bremner
2011-10-06 17:38 ` Jameson Graef Rollins
2011-10-06 13:50 ` David Bremner
2 siblings, 1 reply; 13+ messages in thread
From: David Bremner @ 2011-10-06 13:35 UTC (permalink / raw)
To: Jameson Graef Rollins, Notmuch Mail
On Sat, 28 May 2011 17:09:43 -0700, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> This function, like the equivalent for notmuch-search, just refreshes
> the current show view. Like in notmuch-search, this new function is
> bound to "=". If a prefix is given then the rediplay happens with the
> crypto-switch set, which displays the thread with the opposite logic
> of whatever is set in the notmuch-crypto-process-mime customization
> variable.
Applied to master, will push. Eventually it would be nice to have a test
for this, if possible.
d
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] emacs: add notmuch-show-refresh-view function
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-10-06 13:35 ` [PATCH 1/2] emacs: add notmuch-show-refresh-view function David Bremner
@ 2011-10-06 13:50 ` David Bremner
2 siblings, 0 replies; 13+ messages in thread
From: David Bremner @ 2011-10-06 13:50 UTC (permalink / raw)
To: Jameson Graef Rollins, Notmuch Mail
On Sat, 28 May 2011 17:09:43 -0700, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> This function, like the equivalent for notmuch-search, just refreshes
> the current show view. Like in notmuch-search, this new function is
> bound to "=". If a prefix is given then the rediplay happens with the
> crypto-switch set, which displays the thread with the opposite logic
> of whatever is set in the notmuch-crypto-process-mime customization
> variable.
Pushed to master. Again, it would be nice to have tests for this.
In fact this the patch I meant to attach that remark to; the hooks that
invoke gpg and network access sound pretty tricky to test.
David
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2011-11-13 19:15 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/2] emacs: add notmuch-show-worker function for specifying crypto processing directly Jameson Graef Rollins
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
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).