[PATCH] emacs: show: change emacs interactive pipe message.

Mark Walters markwalters1009 at gmail.com
Thu May 30 13:11:07 PDT 2013


Previously the query string for piping a message to a command was
"Pipe message to command: " regardless of whether the function was
called with a prefix argument (which pipes all open messages to the
command). This patch modifies the `interactive' command to reflect
this.
---
It has irritated me for a while that I couldn't tell if I had
remembered to press c-u before piping messages to git am etc. This
fixes that. There may be other better ways: suggestions welcome!

Best wishes

Mark

 emacs/notmuch-show.el |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 75fa7c8..2fc818f 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1716,8 +1716,11 @@ to stdout or stderr will appear in the *notmuch-pipe* buffer.
 When invoked with a prefix argument, the command will receive all
 open messages in the current thread (formatted as an mbox) rather
 than only the current message."
-  (interactive "P\nsPipe message to command: ")
-  (let (shell-command)
+  (interactive (let ((query-string (if current-prefix-arg
+				       "Pipe all open messages to command: "
+				     "Pipe message to command: ")))
+		 (list current-prefix-arg (read-string query-string))))
+  (let  (shell-command)
     (if entire-thread
 	(setq shell-command
 	      (concat notmuch-command " show --format=mbox --exclude=false "
-- 
1.7.10.4



More information about the notmuch mailing list