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 B425B429E26 for ; Tue, 13 Dec 2011 09:49:40 -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 24WSUe3CdThO for ; Tue, 13 Dec 2011 09:49:40 -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 0B0F2429E25 for ; Tue, 13 Dec 2011 09:49:39 -0800 (PST) Received: by wgbds13 with SMTP id ds13so11326375wgb.2 for ; Tue, 13 Dec 2011 09:49:37 -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=RcFPd1yQ+M3fnBK0uvdSUvCqOxzHUKYGszLOKxyeX/I=; b=BAOBCmCkfMKWPts4ttff2tuXJuaal+8rSqWWNkjNuwnTonVGxSs71MAXdjkw1QqAJ8 9U7Z3QBO6d6zG2MJGleYcHLjUbaOcDCm4SGdXgenNaK/01IeXJoLVSNKPbe8mMLpmhPc Tz0YnRhW+sP9ldl8AhAAsLJYOGmOzAyK+lAmE= Received: by 10.227.199.78 with SMTP id er14mr17305616wbb.10.1323798577432; Tue, 13 Dec 2011 09:49:37 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id em4sm27495171wbb.20.2011.12.13.09.49.36 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Dec 2011 09:49:36 -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: <1323797532-597-5-git-send-email-schnouki@schnouki.net> 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> User-Agent: Notmuch/0.10.2+96~g74e5ae5 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Tue, 13 Dec 2011 21:49:00 +0400 Message-ID: <87zkewuzub.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: Tue, 13 Dec 2011 17:49:40 -0000 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)? 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