1 Return-Path: <dmitry.kurochkin@gmail.com>
\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 4FBE5429E43
\r
6 for <notmuch@notmuchmail.org>; Fri, 23 Dec 2011 19:48:10 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id wqkVKZmOZ8LP for <notmuch@notmuchmail.org>;
\r
17 Fri, 23 Dec 2011 19:48:09 -0800 (PST)
\r
18 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com
\r
19 [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
20 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
21 B6C34431FB6 for <notmuch@notmuchmail.org>; Fri, 23 Dec 2011 19:48:04 -0800
\r
23 Received: by mail-ww0-f45.google.com with SMTP id ds13so14931710wgb.2
\r
24 for <notmuch@notmuchmail.org>; Fri, 23 Dec 2011 19:48:04 -0800 (PST)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
26 h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;
\r
27 bh=a05SJZGqmsLLdm/QQNKFzpxjhenCytiTNHNL3WSbAOo=;
\r
28 b=RrifwtnZr4luHKHDqJl//SXRy+vlizqbPWtd6LnzOPvcOJD9wOOcZTxpbcSMMHhGwe
\r
29 tFWps+APh1UygeeVMtnd1LDxuWe3NOHaYPRizepb8oADpKJHB1hVKGDBSyJ6RiBHkvpT
\r
30 qEdXNYiTQop4rtB/MoCsT3IEiGiZj7+lTs7Vs=
\r
31 Received: by 10.227.206.129 with SMTP id fu1mr16788459wbb.22.1324698484335;
\r
32 Fri, 23 Dec 2011 19:48:04 -0800 (PST)
\r
33 Received: from localhost ([91.144.186.21])
\r
34 by mx.google.com with ESMTPS id u5sm15923111wbm.2.2011.12.23.19.48.03
\r
35 (version=TLSv1/SSLv3 cipher=OTHER);
\r
36 Fri, 23 Dec 2011 19:48:04 -0800 (PST)
\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH 3/3] emacs: hide recent searches if
\r
40 `notmuch-hello-recent-searches-max' is zero
\r
41 Date: Sat, 24 Dec 2011 07:47:16 +0400
\r
42 Message-Id: <1324698436-8532-3-git-send-email-dmitry.kurochkin@gmail.com>
\r
43 X-Mailer: git-send-email 1.7.7.3
\r
44 In-Reply-To: <1324698436-8532-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
45 References: <1324698436-8532-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
46 X-BeenThere: notmuch@notmuchmail.org
\r
47 X-Mailman-Version: 2.1.13
\r
49 List-Id: "Use and development of the notmuch mail system."
\r
50 <notmuch.notmuchmail.org>
\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
54 List-Post: <mailto:notmuch@notmuchmail.org>
\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
58 X-List-Received-Date: Sat, 24 Dec 2011 03:48:10 -0000
\r
61 emacs/notmuch-hello.el | 13 ++++++++++---
\r
62 1 files changed, 10 insertions(+), 3 deletions(-)
\r
64 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
\r
65 index 0922821..821ef22 100644
\r
66 --- a/emacs/notmuch-hello.el
\r
67 +++ b/emacs/notmuch-hello.el
\r
69 "Variable to store history for notmuch queries.")
\r
71 (defcustom notmuch-hello-recent-searches-max 10
\r
72 - "The number of recent searches to display."
\r
73 + "The number of recent searches to display.
\r
75 +Recent searches section is not shown if
\r
76 +`notmuch-hello-recent-searches-max' is set to 0."
\r
80 @@ -161,6 +164,10 @@ International Bureau of Weights and Measures."
\r
81 (let ((history-delete-duplicates t))
\r
82 (add-to-history 'notmuch-query-history search)))
\r
84 +(defun notmuch-hello-show-recent-searches ()
\r
85 + (and (> notmuch-hello-recent-searches-max 0)
\r
86 + notmuch-query-history))
\r
88 (defun notmuch-hello-nice-number (n)
\r
91 @@ -509,7 +516,7 @@ Complete list of currently available key bindings:
\r
92 (put-text-property (1- (point)) (point) 'invisible t)
\r
93 (widget-insert "\n")
\r
95 - (when notmuch-query-history
\r
96 + (when (notmuch-hello-show-recent-searches)
\r
97 (widget-insert "\nRecent searches: ")
\r
98 (widget-create 'push-button
\r
99 :notify (lambda (&rest ignore)
\r
100 @@ -576,7 +583,7 @@ Complete list of currently available key bindings:
\r
101 (let ((start (point)))
\r
102 (widget-insert "\n\n")
\r
103 (widget-insert "Type a search query and hit RET to view matching threads.\n")
\r
104 - (when notmuch-query-history
\r
105 + (when (notmuch-hello-show-recent-searches)
\r
106 (widget-insert "Hit RET to re-submit a previous search. Edit it first if you like.\n")
\r
107 (widget-insert "Save recent searches with the `save' button.\n"))
\r
108 (when notmuch-saved-searches
\r