[PATCH 3/4] emacs: hide recent searches if `notmuch-hello-recent-searches-max' is...
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Sun, 25 Dec 2011 04:14:54 +0000 (08:14 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:41:16 +0000 (09:41 -0800)
86/65377b7044d51d9bc7b9074d4ab42abfc96371 [new file with mode: 0644]

diff --git a/86/65377b7044d51d9bc7b9074d4ab42abfc96371 b/86/65377b7044d51d9bc7b9074d4ab42abfc96371
new file mode 100644 (file)
index 0000000..defb1f5
--- /dev/null
@@ -0,0 +1,111 @@
+Return-Path: <dmitry.kurochkin@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 83C7F429E29\r
+       for <notmuch@notmuchmail.org>; Sat, 24 Dec 2011 20:15:54 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id ENAmbnGZBVhP for <notmuch@notmuchmail.org>;\r
+       Sat, 24 Dec 2011 20:15:52 -0800 (PST)\r
+Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
+       [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 226F3429E2E\r
+       for <notmuch@notmuchmail.org>; Sat, 24 Dec 2011 20:15:47 -0800 (PST)\r
+Received: by werm12 with SMTP id m12so5693068wer.26\r
+       for <notmuch@notmuchmail.org>; Sat, 24 Dec 2011 20:15:45 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=n+IsRB/Xe6g6IY25Y8DSHJvLZ/G++7iQLdqTuRmynlI=;\r
+       b=ZxsXSsx75YhXVMSg+1GgZC6sEgmtPL6Rhdvrby1YXAwCH6NGD9c735xTCbs6+wUL+m\r
+       26+hUKmEJ+PQmWX63qpRvP0I0DFp4wJ9nWo0h9d+14pAK9cDbQXBsMqWB4LrnCg0CSQe\r
+       KOR/zYvGlN678HRI93P78VdZgXKWhNfe8N8WM=\r
+Received: by 10.216.54.212 with SMTP id i62mr16949118wec.22.1324786545863;\r
+       Sat, 24 Dec 2011 20:15:45 -0800 (PST)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id fi6sm38471272wib.2.2011.12.24.20.15.45\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sat, 24 Dec 2011 20:15:45 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 3/4] emacs: hide recent searches if\r
+       `notmuch-hello-recent-searches-max' is zero\r
+Date: Sun, 25 Dec 2011 08:14:54 +0400\r
+Message-Id: <1324786495-14221-3-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-Mailer: git-send-email 1.7.7.3\r
+In-Reply-To: <1324786495-14221-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1324786495-14221-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 25 Dec 2011 04:15:55 -0000\r
+\r
+---\r
+ emacs/notmuch-hello.el |   13 ++++++++++---\r
+ 1 files changed, 10 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+index fa33500..6015af4 100644\r
+--- a/emacs/notmuch-hello.el\r
++++ b/emacs/notmuch-hello.el\r
+@@ -30,7 +30,10 @@\r
+ (declare-function notmuch-poll "notmuch" ())\r
\r
+ (defcustom notmuch-hello-recent-searches-max 10\r
+-  "The number of recent searches to display."\r
++  "The number of recent searches to display.\r
++\r
++Recent searches section is not shown if\r
++`notmuch-hello-recent-searches-max' is set to 0."\r
+   :type 'integer\r
+   :group 'notmuch)\r
\r
+@@ -151,6 +154,10 @@ International Bureau of Weights and Measures."\r
+ (defvar notmuch-hello-url "http://notmuchmail.org"\r
+   "The `notmuch' web site.")\r
\r
++(defun notmuch-hello-show-recent-searches ()\r
++  (and (> notmuch-hello-recent-searches-max 0)\r
++       notmuch-search-history))\r
++\r
+ (defun notmuch-hello-nice-number (n)\r
+   (let (result)\r
+     (while (> n 0)\r
+@@ -482,7 +489,7 @@ Complete list of currently available key bindings:\r
+                      " Search! ")\r
+       (widget-insert "\n")\r
\r
+-      (when notmuch-search-history\r
++      (when (notmuch-hello-show-recent-searches)\r
+         (widget-insert "\nRecent searches: ")\r
+         (widget-create 'push-button\r
+                        :notify (lambda (&rest ignore)\r
+@@ -549,7 +556,7 @@ Complete list of currently available key bindings:\r
+       (let ((start (point)))\r
+       (widget-insert "\n\n")\r
+       (widget-insert "Use the `search' button or hit `s' to enter search query.\n")\r
+-      (when notmuch-search-history\r
++      (when (notmuch-hello-show-recent-searches)\r
+         (widget-insert "Hit RET to re-submit a previous search. Edit it first if you like.\n")\r
+         (widget-insert "Save recent searches with the `save' button.\n"))\r
+       (when notmuch-saved-searches\r
+-- \r
+1.7.7.3\r
+\r