--- /dev/null
+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 6E05E431FD0\r
+ for <notmuch@notmuchmail.org>; Fri, 16 Dec 2011 20:21:08 -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 4PeMi-r9cAqH for <notmuch@notmuchmail.org>;\r
+ Fri, 16 Dec 2011 20:21:07 -0800 (PST)\r
+Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
+ [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client\r
+ certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
+ B2EF6429E26 for <notmuch@notmuchmail.org>; Fri, 16 Dec 2011 20:21:06 -0800\r
+ (PST)\r
+Received: by mail-ww0-f45.google.com with SMTP id ds13so5879879wgb.2\r
+ for <notmuch@notmuchmail.org>; Fri, 16 Dec 2011 20:21:06 -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=py0MWGpr22YIzT2Tt6ySsYH4nwzowJbiWP2T7oIFBls=;\r
+ b=EGu6LYO5Epq3waO6V19JXyj5nAd2E4OI1bFvBEDoEK/n43nrl4O/9i/8br5FGs38QO\r
+ rFoyhEDJ05bJgqgfxkmcAEa+tj3cnvfRmp7wWeDQgBcAwaH8V/R51iMpJSkrmSCumas9\r
+ uBtJYSvqaH34AqlWAiDYlzHXxrTNtW/KbsUeY=\r
+Received: by 10.227.203.78 with SMTP id fh14mr7338535wbb.12.1324095666357;\r
+ Fri, 16 Dec 2011 20:21:06 -0800 (PST)\r
+Received: from localhost ([91.144.186.21])\r
+ by mx.google.com with ESMTPS id gn4sm15789108wib.20.2011.12.16.20.21.05\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Fri, 16 Dec 2011 20:21:05 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 4/4] emacs: do not call `notmuch-hello-mode' on update\r
+Date: Sat, 17 Dec 2011 08:20:19 +0400\r
+Message-Id: <1324095619-10870-4-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-Mailer: git-send-email 1.7.7.3\r
+In-Reply-To: <1324095619-10870-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1324095619-10870-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: Sat, 17 Dec 2011 04:21:09 -0000\r
+\r
+`notmuch-hello' should call `notmuch-hello-mode' function only when\r
+run for the first time. But before the change, `notmuch-hello' used\r
+`kill-all-local-variables' to remove editable widgets fields. This\r
+caused the major mode to be reset, and `notmuch-hello-mode' to be\r
+called every time.\r
+\r
+The patch manually deletes all editable widget fields and removes\r
+`kill-all-local-variables' call.\r
+---\r
+ emacs/notmuch-hello.el | 11 +++++++----\r
+ test/emacs | 1 -\r
+ 2 files changed, 7 insertions(+), 5 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+index ca3a381..3b21f55 100644\r
+--- a/emacs/notmuch-hello.el\r
++++ b/emacs/notmuch-hello.el\r
+@@ -403,11 +403,14 @@ Complete list of currently available key bindings:\r
+ (progn\r
+ (widget-forward 1)\r
+ (widget-value (widget-at)))\r
+- (error nil)))))\r
++ (error nil))))\r
++ (inhibit-read-only t))\r
+ \r
+- (kill-all-local-variables)\r
+- (let ((inhibit-read-only t))\r
+- (erase-buffer))\r
++ ;; delete all editable widget fields\r
++ (let ((all widget-field-list))\r
++ (mapc 'widget-delete widget-field-list))\r
++\r
++ (erase-buffer)\r
+ \r
+ (unless (eq major-mode 'notmuch-hello-mode)\r
+ (notmuch-hello-mode))\r
+diff --git a/test/emacs b/test/emacs\r
+index b4c2444..dffad0f 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -486,7 +486,6 @@ counter=$(test_emacs \\r
+ test_expect_equal "$counter" 1\r
+ \r
+ test_begin_subtest "notmuch-hello-mode hook is not called on updates"\r
+-test_subtest_known_broken\r
+ counter=$(test_emacs \\r
+ '(let ((notmuch-hello-mode-hook-counter 0))\r
+ (kill-buffer "*notmuch-hello*")\r
+-- \r
+1.7.7.3\r
+\r