Re: [PATCH 1/3] emacs: add no-display arg to notmuch-hello-refresh-hook

Subject: Re: [PATCH 1/3] emacs: add no-display arg to notmuch-hello-refresh-hook

Date: Tue, 10 Jul 2012 08:10:09 +0300

To: Austin Clements

Cc: notmuch@notmuchmail.org

From: Jani Nikula


On Jul 10, 2012 4:49 AM, "Austin Clements" <amdragon@mit.edu> wrote:
>
> Quoth Jani Nikula on Jun 15 at  6:53 pm:
> > Add no-display arg to notmuch-hello-refresh-hook to allow each hook to
> > decide what is appropriate when no-display is t, which is typically
> > the case when called non-interactively. This is used by the following
> > patch.
> >
> > This breaks existing hooks people might have, which will now need to
> > accept the argument.
> >
> > Signed-off-by: Jani Nikula <jani@nikula.org>
>
> This seems like an overloaded use of no-display.  If I'm reading the
> code right, no-display indicates whether or not the notmuch-hello
> buffer should be switched to and seems like a workaround for some
> particular corner-case (I'm not even sure what).  This seems like a
> strange condition to predicate a hook on (but maybe I just don't
> understand).  What condition, abstractly speaking, is
> notmuch-hello-refresh-status-message trying to run under?

IIUC, no-display is useful for calling refresh from outside of emacs, e.g.
from post-new hook in an automated fashion, so you can have an up-to-date
buffer when you switch to it. There's no point in displaying the refresh
message when you don't also switch to the buffer, is there? And this way
you'll get the diff between the manual (through user interaction) refreshes
of the buffer, not between two cron jobs.

J.

Thread: