From: Tomi Ollila Date: Wed, 28 Oct 2015 20:18:26 +0000 (+0200) Subject: Re: [PATCH] emacs: poll: return useful errors when poll fails. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4f45056f06360d262dd0c9d03d52c68eaf5a7631;p=notmuch-archives.git Re: [PATCH] emacs: poll: return useful errors when poll fails. --- diff --git a/48/6a7263b47f8ae4c6941941ea82e1b7394946bc b/48/6a7263b47f8ae4c6941941ea82e1b7394946bc new file mode 100644 index 000000000..53b2792ca --- /dev/null +++ b/48/6a7263b47f8ae4c6941941ea82e1b7394946bc @@ -0,0 +1,109 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id E3C366DE0B44 + for ; Wed, 28 Oct 2015 13:18:29 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.744 +X-Spam-Level: +X-Spam-Status: No, score=0.744 tagged_above=-999 required=5 tests=[AWL=0.092, + SPF_NEUTRAL=0.652] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id FJJU7YmCpKv6 for ; + Wed, 28 Oct 2015 13:18:27 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by arlo.cworth.org (Postfix) with ESMTP id D4CD66DE0AF8 + for ; Wed, 28 Oct 2015 13:18:25 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 18B35100046; + Wed, 28 Oct 2015 22:18:26 +0200 (EET) +From: Tomi Ollila +To: Mark Walters , notmuch@notmuchmail.org, + ketil@malde.org +Subject: Re: [PATCH] emacs: poll: return useful errors when poll fails. +In-Reply-To: <1446056919-27822-1-git-send-email-markwalters1009@gmail.com> +References: <87bnd5qjnd.fsf@wespe.malde.org> + <1446056919-27822-1-git-send-email-markwalters1009@gmail.com> +User-Agent: Notmuch/0.21~rc3+7~g28030b0 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 28 Oct 2015 20:18:30 -0000 + +On Wed, Oct 28 2015, Mark Walters wrote: + +> Previously poll called from emacs would fail silently. This makes it +> return a useful error message. +> +> In the non-deprecated case of notmuch new and appropriate hooks, it +> uses notmuch-call-notmuch-process which gives an error and +> additionally puts the stdout/stderr etc in the *Notmuch errors* +> buffer. +> +> In the deprecated case of a custom poll script it only returns an +> error message. +> +> Commit based on a bug report, and a potential fix, by Ketil Malde. +> --- + +Looks good (to me) -- I investigated a bit how notmuch-call-notmuch-process +does things; it uses notmuch-check-exit-status which is not applicable +here. + +Mark said he doesn't use poll -- and I have rewritten my poll(*) so my +tests will be as lightweight as his. So we wait for Ketil's report +how this works :D + +Tomi + +(*) see at the end of this email + +> +> This should fix the bug reported in the parent message -- we should +> definitely report error messages. It might be nice to output the +> stdout/stderr in the custom poll script case but since we don't have +> built in infrastructure for it it probably isn't worth it for a +> deprecated case. +> +> (Note I don't use poll, so this is not heavily tested) +> +> Best wishes +> +> Mark +> + +For reference, if anyone gets ideas from this... + +;; overwrite notmuch-poll defined in notmuch.el +(defun notmuch-poll () + (interactive) + (save-window-excursion + (let ((buffer (get-buffer-create "*my notmuch polls*"))) + (set-buffer buffer) + (setq buffer-read-only nil) + (goto-char (point-max)) + (pop-to-buffer buffer) + (call-process "notmuch-log-output.sh" nil t t "new" "--verbose") + (bury-buffer))) ;; <- b-b to put the buffer at the "bottom" of buffers + (message "update finished")) +