unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] contrib: pick: use notmuch-start-notmuch
@ 2013-07-04  7:09 Mark Walters
  2013-07-04  7:38 ` Tomi Ollila
  2013-07-20 17:31 ` David Bremner
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Walters @ 2013-07-04  7:09 UTC (permalink / raw)
  To: notmuch

This uses the new notmuch-start-notmuch function which should give
better handling of stderr and errors generally.
---

Hi

This converts pick to Austin's new async error handling code (see
commit 08fde50bf3a4c54f6413aff4052e0d84392463f9). That code separates
stderr from stdout and makes sure that appropriate messages are
displayed to the user.

I think this is simple enough and beneficial enough to go in for 0.16
(so I will tag it 0.16). Of course it only affects notmuch-pick so
is relatively safe.

Best wishes

Mark


 contrib/notmuch-pick/notmuch-pick.el |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
index fbd7c0b..7f5f729 100644
--- a/contrib/notmuch-pick/notmuch-pick.el
+++ b/contrib/notmuch-pick/notmuch-pick.el
@@ -817,16 +817,15 @@ Complete list of currently available key bindings:
     (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
 	(setq search-args basic-query))
     (if notmuch-pick-asynchronous-parser
-	(let ((proc (start-process
-		     "notmuch-pick" buffer
-		     notmuch-command "show" "--body=false" "--format=sexp"
+	(let ((proc (notmuch-start-notmuch
+		     "notmuch-pick" buffer #'notmuch-pick-process-sentinel
+		     "show" "--body=false" "--format=sexp"
 		     message-arg search-args))
 	      ;; Use a scratch buffer to accumulate partial output.
               ;; This buffer will be killed by the sentinel, which
               ;; should be called no matter how the process dies.
               (parse-buf (generate-new-buffer " *notmuch pick parse*")))
           (process-put proc 'parse-buf parse-buf)
-	  (set-process-sentinel proc 'notmuch-pick-process-sentinel)
 	  (set-process-filter proc 'notmuch-pick-process-filter)
 	  (set-process-query-on-exit-flag proc nil))
       (progn
-- 
1.7.9.1

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

* Re: [PATCH] contrib: pick: use notmuch-start-notmuch
  2013-07-04  7:09 [PATCH] contrib: pick: use notmuch-start-notmuch Mark Walters
@ 2013-07-04  7:38 ` Tomi Ollila
  2013-07-04  8:07   ` Mark Walters
  2013-07-20 17:31 ` David Bremner
  1 sibling, 1 reply; 4+ messages in thread
From: Tomi Ollila @ 2013-07-04  7:38 UTC (permalink / raw)
  To: Mark Walters, notmuch

On Thu, Jul 04 2013, Mark Walters <markwalters1009@gmail.com> wrote:

> This uses the new notmuch-start-notmuch function which should give
> better handling of stderr and errors generally.
> ---
>
> Hi
>
> This converts pick to Austin's new async error handling code (see
> commit 08fde50bf3a4c54f6413aff4052e0d84392463f9). That code separates
> stderr from stdout and makes sure that appropriate messages are
> displayed to the user.
>
> I think this is simple enough and beneficial enough to go in for 0.16
> (so I will tag it 0.16). Of course it only affects notmuch-pick so
> is relatively safe.

FWIW the code LGTM. Do the pick tests use this and do those pass ?

Tomi

>
> Best wishes
>
> Mark
>
>
>  contrib/notmuch-pick/notmuch-pick.el |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
> index fbd7c0b..7f5f729 100644
> --- a/contrib/notmuch-pick/notmuch-pick.el
> +++ b/contrib/notmuch-pick/notmuch-pick.el
> @@ -817,16 +817,15 @@ Complete list of currently available key bindings:
>      (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
>  	(setq search-args basic-query))
>      (if notmuch-pick-asynchronous-parser
> -	(let ((proc (start-process
> -		     "notmuch-pick" buffer
> -		     notmuch-command "show" "--body=false" "--format=sexp"
> +	(let ((proc (notmuch-start-notmuch
> +		     "notmuch-pick" buffer #'notmuch-pick-process-sentinel
> +		     "show" "--body=false" "--format=sexp"
>  		     message-arg search-args))
>  	      ;; Use a scratch buffer to accumulate partial output.
>                ;; This buffer will be killed by the sentinel, which
>                ;; should be called no matter how the process dies.
>                (parse-buf (generate-new-buffer " *notmuch pick parse*")))
>            (process-put proc 'parse-buf parse-buf)
> -	  (set-process-sentinel proc 'notmuch-pick-process-sentinel)
>  	  (set-process-filter proc 'notmuch-pick-process-filter)
>  	  (set-process-query-on-exit-flag proc nil))
>        (progn
> -- 
> 1.7.9.1
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH] contrib: pick: use notmuch-start-notmuch
  2013-07-04  7:38 ` Tomi Ollila
@ 2013-07-04  8:07   ` Mark Walters
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Walters @ 2013-07-04  8:07 UTC (permalink / raw)
  To: Tomi Ollila, notmuch


Tomi Ollila <tomi.ollila@iki.fi> writes:

> FWIW the code LGTM. Do the pick tests use this and do those pass ?

Thanks for the review.

The tests do all pass. There are two sets of pick tests: one uses the
async parser (the default) which uses this code and the other uses the
sync parser (which probably should be removed as the async parser seems
stable).

Best wishes

Mark






>
> Tomi
>
>>
>> Best wishes
>>
>> Mark
>>
>>
>>  contrib/notmuch-pick/notmuch-pick.el |    7 +++----
>>  1 files changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
>> index fbd7c0b..7f5f729 100644
>> --- a/contrib/notmuch-pick/notmuch-pick.el
>> +++ b/contrib/notmuch-pick/notmuch-pick.el
>> @@ -817,16 +817,15 @@ Complete list of currently available key bindings:
>>      (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
>>  	(setq search-args basic-query))
>>      (if notmuch-pick-asynchronous-parser
>> -	(let ((proc (start-process
>> -		     "notmuch-pick" buffer
>> -		     notmuch-command "show" "--body=false" "--format=sexp"
>> +	(let ((proc (notmuch-start-notmuch
>> +		     "notmuch-pick" buffer #'notmuch-pick-process-sentinel
>> +		     "show" "--body=false" "--format=sexp"
>>  		     message-arg search-args))
>>  	      ;; Use a scratch buffer to accumulate partial output.
>>                ;; This buffer will be killed by the sentinel, which
>>                ;; should be called no matter how the process dies.
>>                (parse-buf (generate-new-buffer " *notmuch pick parse*")))
>>            (process-put proc 'parse-buf parse-buf)
>> -	  (set-process-sentinel proc 'notmuch-pick-process-sentinel)
>>  	  (set-process-filter proc 'notmuch-pick-process-filter)
>>  	  (set-process-query-on-exit-flag proc nil))
>>        (progn
>> -- 
>> 1.7.9.1
>>
>> _______________________________________________
>> notmuch mailing list
>> notmuch@notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH] contrib: pick: use notmuch-start-notmuch
  2013-07-04  7:09 [PATCH] contrib: pick: use notmuch-start-notmuch Mark Walters
  2013-07-04  7:38 ` Tomi Ollila
@ 2013-07-20 17:31 ` David Bremner
  1 sibling, 0 replies; 4+ messages in thread
From: David Bremner @ 2013-07-20 17:31 UTC (permalink / raw)
  To: Mark Walters, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

> This uses the new notmuch-start-notmuch function which should give
> better handling of stderr and errors generally.

pushed this one too (for release and master)

d

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

end of thread, other threads:[~2013-07-20 17:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-04  7:09 [PATCH] contrib: pick: use notmuch-start-notmuch Mark Walters
2013-07-04  7:38 ` Tomi Ollila
2013-07-04  8:07   ` Mark Walters
2013-07-20 17:31 ` 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).