1 Return-Path: <tomi.ollila@iki.fi>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 19E3C431FAF
\r
6 for <notmuch@notmuchmail.org>; Fri, 7 Sep 2012 00:56:15 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id lBEL9KjX78qf for <notmuch@notmuchmail.org>;
\r
16 Fri, 7 Sep 2012 00:56:13 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 7BFA0431FAE
\r
19 for <notmuch@notmuchmail.org>; Fri, 7 Sep 2012 00:56:13 -0700 (PDT)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id 4C4E61000E5;
\r
22 Fri, 7 Sep 2012 10:56:21 +0300 (EEST)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
\r
25 Subject: Re: [PATCH v2 2/5] emacs: add no-display arg to
\r
26 notmuch-hello-refresh-hook
\r
28 <51214be764d0f54d0db3658e43f1377d67e34fdf.1346596156.git.jani@nikula.org>
\r
29 References: <cover.1346596156.git.jani@nikula.org>
\r
30 <51214be764d0f54d0db3658e43f1377d67e34fdf.1346596156.git.jani@nikula.org>
\r
31 User-Agent: Notmuch/0.14+11~gd9bf007 (http://notmuchmail.org) Emacs/24.2.1
\r
32 (x86_64-unknown-linux-gnu)
\r
33 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
34 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
35 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
36 Date: Fri, 07 Sep 2012 10:56:21 +0300
\r
37 Message-ID: <m2d31yxo4a.fsf@guru.guru-group.fi>
\r
39 Content-Type: text/plain
\r
40 X-BeenThere: notmuch@notmuchmail.org
\r
41 X-Mailman-Version: 2.1.13
\r
43 List-Id: "Use and development of the notmuch mail system."
\r
44 <notmuch.notmuchmail.org>
\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
48 List-Post: <mailto:notmuch@notmuchmail.org>
\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
52 X-List-Received-Date: Fri, 07 Sep 2012 07:56:15 -0000
\r
54 On Sun, Sep 02 2012, Jani Nikula <jani@nikula.org> wrote:
\r
56 > Add no-display arg to notmuch-hello-refresh-hook to allow each hook to
\r
57 > decide what is appropriate when no-display is t, i.e. when not
\r
58 > switching to the notmuch-hello buffer.
\r
60 > This breaks existing hooks people might have, which will now need to
\r
61 > accept the argument.
\r
63 > Signed-off-by: Jani Nikula <jani@nikula.org>
\r
65 > emacs/notmuch-hello.el | 2 +-
\r
66 > 1 file changed, 1 insertion(+), 1 deletion(-)
\r
68 > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
\r
69 > index 4dfe5d2..fa14443 100644
\r
70 > --- a/emacs/notmuch-hello.el
\r
71 > +++ b/emacs/notmuch-hello.el
\r
72 > @@ -816,7 +816,7 @@ it (i.e. use `set-buffer' rather than `switch-to-buffer')."
\r
73 > (unless (widget-at)
\r
74 > (when notmuch-hello-search-pos
\r
75 > (goto-char notmuch-hello-search-pos)))))
\r
76 > - (run-hooks 'notmuch-hello-refresh-hook)
\r
77 > + (run-hook-with-args 'notmuch-hello-refresh-hook no-display)
\r
78 > (setq notmuch-hello-first-run nil))
\r
80 I had already written a bit of reply for this (for +1:ng the change), but
\r
81 luckily fall into some emacs documentation:
\r
83 http://sunsite.ualberta.ca/Documentation/Gnu/emacs-lisp-ref-20.5/html_node/elisp_357.html
\r
85 --8<----8<----8<----8<----8<----8<----8<----8<----8<--
\r
92 Most of the hooks in Emacs are normal hooks. These variables contain lists
\r
93 of functions to be called with no arguments. When the hook name ends in
\r
94 `-hook', that tells you it is normal. We try to make all hooks normal, as
\r
95 much as possible, so that you can use them in a uniform way.
\r
99 If the hook variable's name does not end with `-hook', that indicates it is
\r
100 probably an abnormal hook; you should look at its documentation to see how
\r
101 to use the hook properly.
\r
103 --8<----8<----8<----8<----8<----8<----8<----8<----8<--
\r
105 And, indeed, grepping through emacs 24.2 sources when run-hooks-with-args
\r
106 is used then the variable symbol doesn't end with -hook, for example:
\r
108 (run-hook-with-args 'widget-edit-functions widget))
\r
111 So, Jani -- probably you can use the no-display from the dynamic scope of
\r
112 the caller in your hook in .emacs -- not nice but...
\r
114 ... or propose a change to the hook name -- or add another hook...
\r
116 > (defun notmuch-folder ()
\r