unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: send notmuch-query stderr to /dev/null
@ 2011-01-26 20:57 Jameson Rollins
  2011-01-27  4:49 ` Carl Worth
  0 siblings, 1 reply; 4+ messages in thread
From: Jameson Rollins @ 2011-01-26 20:57 UTC (permalink / raw)
  To: Notmuch Mail

The call-process to notmuch in notmuch-query.el was previously sending
stderr into the output buffer.  This means that if there is any stderr
the JSON parsing breaks.  Unfortunately call-process does not support
sending stderr to a separate buffer or to the minibuffer [0], but it
does support sending it to /dev/null.  So we do that here instead.

[0] a bug was filed against emacs (#7842)
---
 emacs/notmuch-query.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el
index 26f9544..921f624 100644
--- a/emacs/notmuch-query.el
+++ b/emacs/notmuch-query.el
@@ -35,7 +35,7 @@ is a possibly empty forest of replies.
 	 (json-false 'nil))
     (with-temp-buffer
       (progn
-	(apply 'call-process (append (list notmuch-command nil t nil) args))
+	(apply 'call-process (append (list notmuch-command nil (list t nil) nil) args))
 	(goto-char (point-min))
 	(json-read)))))
 
-- 
1.7.2.3

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

* Re: [PATCH] emacs: send notmuch-query stderr to /dev/null
  2011-01-26 20:57 [PATCH] emacs: send notmuch-query stderr to /dev/null Jameson Rollins
@ 2011-01-27  4:49 ` Carl Worth
  2011-01-27 11:29   ` Michal Sojka
  2011-01-28  0:04   ` Jameson Rollins
  0 siblings, 2 replies; 4+ messages in thread
From: Carl Worth @ 2011-01-27  4:49 UTC (permalink / raw)
  To: Jameson Rollins, Notmuch Mail

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]

On Wed, 26 Jan 2011 12:57:50 -0800, Jameson Rollins <jrollins@finestructure.net> wrote:
> The call-process to notmuch in notmuch-query.el was previously sending
> stderr into the output buffer.  This means that if there is any stderr
> the JSON parsing breaks.  Unfortunately call-process does not support
> sending stderr to a separate buffer or to the minibuffer [0], but it
> does support sending it to /dev/null.  So we do that here instead.
> 
> [0] a bug was filed against emacs (#7842)

Thanks! I had wondered what those json errors were about. I've committed
this.

I am a bit concerned about throwing the error output away, of course,
(so we'll wait for that fix to emacs---thanks for submitting a bug
report). Do you have a sense of what kinds of output we are getting on
stderr?

-Carl

-- 
carl.d.worth@intel.com

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] emacs: send notmuch-query stderr to /dev/null
  2011-01-27  4:49 ` Carl Worth
@ 2011-01-27 11:29   ` Michal Sojka
  2011-01-28  0:04   ` Jameson Rollins
  1 sibling, 0 replies; 4+ messages in thread
From: Michal Sojka @ 2011-01-27 11:29 UTC (permalink / raw)
  To: Carl Worth, Jameson Rollins, Notmuch Mail

On Thu, 27 Jan 2011, Carl Worth wrote:
> On Wed, 26 Jan 2011 12:57:50 -0800, Jameson Rollins <jrollins@finestructure.net> wrote:
> > The call-process to notmuch in notmuch-query.el was previously sending
> > stderr into the output buffer.  This means that if there is any stderr
> > the JSON parsing breaks.  Unfortunately call-process does not support
> > sending stderr to a separate buffer or to the minibuffer [0], but it
> > does support sending it to /dev/null.  So we do that here instead.
> > 
> > [0] a bug was filed against emacs (#7842)
> 
> Thanks! I had wondered what those json errors were about. I've committed
> this.
> 
> I am a bit concerned about throwing the error output away, of course,
> (so we'll wait for that fix to emacs---thanks for submitting a bug
> report). Do you have a sense of what kinds of output we are getting on
> stderr?

I do not know which errors Jameson experienced, but sometimes I have to
use LD_PRELOADed 32bit libraries with some software and when I
accidentally run my emacs (which is 64bit) with LD_PRELOAD set this way,
every execution of notmuch prints

ERROR: ld.so: object '/opt/xilinx/usb-driver/libusb-driver.so' from LD_PRELOAD cannot be preloaded: ignored.

and this breaks the parsing. So thanks Jameson for solving this issue
for me.

-Michal

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

* Re: [PATCH] emacs: send notmuch-query stderr to /dev/null
  2011-01-27  4:49 ` Carl Worth
  2011-01-27 11:29   ` Michal Sojka
@ 2011-01-28  0:04   ` Jameson Rollins
  1 sibling, 0 replies; 4+ messages in thread
From: Jameson Rollins @ 2011-01-28  0:04 UTC (permalink / raw)
  To: Carl Worth, Notmuch Mail

[-- Attachment #1: Type: text/plain, Size: 1630 bytes --]

On Thu, 27 Jan 2011 14:49:43 +1000, Carl Worth <cworth@cworth.org> wrote:
> On Wed, 26 Jan 2011 12:57:50 -0800, Jameson Rollins <jrollins@finestructure.net> wrote:
> > The call-process to notmuch in notmuch-query.el was previously sending
> > stderr into the output buffer.  This means that if there is any stderr
> > the JSON parsing breaks.  Unfortunately call-process does not support
> > sending stderr to a separate buffer or to the minibuffer [0], but it
> > does support sending it to /dev/null.  So we do that here instead.
> > 
> > [0] a bug was filed against emacs (#7842)
> 
> Thanks! I had wondered what those json errors were about. I've committed
> this.
> 
> I am a bit concerned about throwing the error output away, of course,
> (so we'll wait for that fix to emacs---thanks for submitting a bug
> report). Do you have a sense of what kinds of output we are getting on
> stderr?

So the only stderr output I've ever seen seen is in the
signature-verification branch (which I now run).  Emails with S/MIME
signatures are currently not handled (because of GMIME limitations, I
think) and notmuch throws the following error when trying to process
them:

servo:~ 0$ notmuch show --format=json --verify id:"4D25D062.1000103@sixdemonbag.org" >/dev/null
Failed to verify signed part: no error explanation given
servo:~ 0$ 

Obviously the emacs call-process function should be capturing and
displaying those error messages.  Hopefully we can eventually get that
fixed.  In the mean time it's probably better to throw out the messages
rather than have them break the JSON output.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

end of thread, other threads:[~2011-01-28  0:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-26 20:57 [PATCH] emacs: send notmuch-query stderr to /dev/null Jameson Rollins
2011-01-27  4:49 ` Carl Worth
2011-01-27 11:29   ` Michal Sojka
2011-01-28  0:04   ` Jameson Rollins

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