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

Austin Clements amdragon at MIT.EDU
Thu Jul 12 20:38:50 PDT 2012


Quoth Jani Nikula on Jul 10 at  8:10 am:
>    On Jul 10, 2012 4:49 AM, "Austin Clements" <[1]amdragon at 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 <[2]jani at 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.

Oh, I see.  This makes more sense.  The only use of no-display in the
notmuch code I can find appears to be to refresh the hello buffer when
you exit a search buffer started from hello, when it might actually
make sense to run the difference hook in your patch (I assume it wants
to avoid switching to the hello buffer in this case because the buffer
order may have changed?  Of course, there are other ways to get to the
hello buffer other than exiting a search buffer started from it...  I
found all of this code very confusing).

Maybe this just needs better documentation?


More information about the notmuch mailing list