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

Tomi Ollila tomi.ollila at iki.fi
Fri May 31 01:08:52 PDT 2013


On Thu, May 30 2013, Mark Walters <markwalters1009 at gmail.com> wrote:

> 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!

Your implementation seems to match the lines in

http://stackoverflow.com/questions/2215298/emacs-interactive-function-with-optional-numeric-prefix

What is that extra space you added to the following line doing there ? ;/

>
> Best wishes
>
> Mark

Tomi


>
>  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
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list