Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 9CE60429E26 for ; Fri, 16 Dec 2011 10:37:42 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9Rvmqo9M5qsf for ; Fri, 16 Dec 2011 10:37:42 -0800 (PST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id D5205431FD0 for ; Fri, 16 Dec 2011 10:37:41 -0800 (PST) Received: by wgbds13 with SMTP id ds13so5329995wgb.2 for ; Fri, 16 Dec 2011 10:37:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=zH+9eRsMpS7OzKOiMKtPziNnI4jJc1nPgS1/Oz60RkY=; b=IGiLfwnu9D8f7+pwgP3cUnFIwL74LvnM4lflEWw1M+jfGh7Djmmts/qkCkhooGjtE+ D3osx6b7yZEQ0Aj2t+P57eGX/RryCke5iryIn+kSyNtESHfSAPW29CGfMbMgRrbMbuZ0 ZiDEXdIxvt7fIfKm0pWQCKRpwXMQv4BJI7WLY= Received: by 10.227.197.70 with SMTP id ej6mr6469270wbb.13.1324060660489; Fri, 16 Dec 2011 10:37:40 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id di5sm14182720wib.3.2011.12.16.10.37.38 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 16 Dec 2011 10:37:39 -0800 (PST) From: Dmitry Kurochkin To: Thomas Jost , notmuch@notmuchmail.org Subject: Re: [PATCH v3 4/4] emacs: add notmuch-hello-hook In-Reply-To: <87zkewuzub.fsf@gmail.com> References: <87d3cx2t38.fsf@rocinante.cs.unb.ca> <1323797532-597-1-git-send-email-schnouki@schnouki.net> <1323797532-597-5-git-send-email-schnouki@schnouki.net> <87zkewuzub.fsf@gmail.com> User-Agent: Notmuch/0.10.2+96~g74e5ae5 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Fri, 16 Dec 2011 22:36:59 +0400 Message-ID: <877h1ws6r7.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Fri, 16 Dec 2011 18:37:42 -0000 On Tue, 13 Dec 2011 21:49:00 +0400, Dmitry Kurochkin wrote: > On Tue, 13 Dec 2011 18:32:12 +0100, Thomas Jost wrote: > > This hook is called every time the notmuch-hello buffer is updated. > > --- > > emacs/notmuch-hello.el | 9 ++++++++- > > 1 files changed, 8 insertions(+), 1 deletions(-) > > > > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el > > index 0fe9c1d..112b40b 100644 > > --- a/emacs/notmuch-hello.el > > +++ b/emacs/notmuch-hello.el > > @@ -131,6 +131,11 @@ So: > > (integer :tag "Number of characters") > > (float :tag "Fraction of window"))) > > > > +(defcustom notmuch-hello-hook nil > > + "Functions called after populating a `notmuch-hello' buffer." > > + :type 'hook > > + :group 'notmuch) > > + > > (defcustom notmuch-thousands-separator "," > > "The string used as a thousands separator. > > > > @@ -579,7 +584,9 @@ Complete list of currently available key bindings: > > (widget-forward 1))) > > > > (unless (widget-at) > > - (notmuch-hello-goto-search))))) > > + (notmuch-hello-goto-search)) > > + > > + (run-hooks 'notmuch-hello-hook)))) > > > > I spent some time finding out why run-hooks are not on the top level. > Turns out it is inside two let statements. Can we move to the top level > of `notmuch-hello' to make it clear that it is always run (i.e. there > are no ifs or whens)? > In addition to the above comment: I think we should rename notmuch-hello-hook to notmuch-hello-refresh-hook. That would make it clear that the hook runs on each notmuch-hello buffer update. And would avoid confusion with notmuch-hello-mode-hook if we add it later. Regards, Dmitry > BTW this would replace one of the oldest custom patches which I have in > my master branch :) > > Regards, > Dmitry > > > (defun notmuch-folder () > > "Deprecated function for invoking notmuch---calling `notmuch' is preferred now." > > -- > > 1.7.8 > > > > _______________________________________________ > > notmuch mailing list > > notmuch@notmuchmail.org > > http://notmuchmail.org/mailman/listinfo/notmuch