unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: show: change emacs interactive pipe message.
@ 2013-05-30 20:11 Mark Walters
  2013-05-31  8:08 ` Tomi Ollila
  2013-06-09  8:41 ` [PATCH v2] " Mark Walters
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Walters @ 2013-05-30 20:11 UTC (permalink / raw)
  To: notmuch

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] emacs: show: change emacs interactive pipe message.
  2013-05-30 20:11 [PATCH] emacs: show: change emacs interactive pipe message Mark Walters
@ 2013-05-31  8:08 ` Tomi Ollila
  2013-06-09  8:41 ` [PATCH v2] " Mark Walters
  1 sibling, 0 replies; 5+ messages in thread
From: Tomi Ollila @ 2013-05-31  8:08 UTC (permalink / raw)
  To: Mark Walters, notmuch

On Thu, May 30 2013, Mark Walters <markwalters1009@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@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] emacs: show: change emacs interactive pipe message.
  2013-05-30 20:11 [PATCH] emacs: show: change emacs interactive pipe message Mark Walters
  2013-05-31  8:08 ` Tomi Ollila
@ 2013-06-09  8:41 ` Mark Walters
  2013-06-09 10:33   ` Tomi Ollila
  2013-06-25  6:07   ` David Bremner
  1 sibling, 2 replies; 5+ messages in thread
From: Mark Walters @ 2013-06-09  8:41 UTC (permalink / raw)
  To: notmuch

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.
---
This has the whitespace fix Tomi mentioned but is otherwise unchanged.

Best wishes

Mark


 emacs/notmuch-show.el |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 83bb9ad..d863f2b 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1702,7 +1702,10 @@ 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: ")
+  (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
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] emacs: show: change emacs interactive pipe message.
  2013-06-09  8:41 ` [PATCH v2] " Mark Walters
@ 2013-06-09 10:33   ` Tomi Ollila
  2013-06-25  6:07   ` David Bremner
  1 sibling, 0 replies; 5+ messages in thread
From: Tomi Ollila @ 2013-06-09 10:33 UTC (permalink / raw)
  To: Mark Walters, notmuch

On Sun, Jun 09 2013, Mark Walters <markwalters1009@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.
> ---
> This has the whitespace fix Tomi mentioned but is otherwise unchanged.

LGTM, my review comments in id:m2wqqftvu3.fsf@guru.guru-group.fi apply.

> Best wishes

Tomi


>
> Mark
>
>
>  emacs/notmuch-show.el |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 83bb9ad..d863f2b 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -1702,7 +1702,10 @@ 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: ")
> +  (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
> -- 
> 1.7.9.1
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] emacs: show: change emacs interactive pipe message.
  2013-06-09  8:41 ` [PATCH v2] " Mark Walters
  2013-06-09 10:33   ` Tomi Ollila
@ 2013-06-25  6:07   ` David Bremner
  1 sibling, 0 replies; 5+ messages in thread
From: David Bremner @ 2013-06-25  6:07 UTC (permalink / raw)
  To: Mark Walters, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

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

pushed,

d

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-25  6:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-30 20:11 [PATCH] emacs: show: change emacs interactive pipe message Mark Walters
2013-05-31  8:08 ` Tomi Ollila
2013-06-09  8:41 ` [PATCH v2] " Mark Walters
2013-06-09 10:33   ` Tomi Ollila
2013-06-25  6:07   ` 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).