From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 62549431FD0 for ; Sat, 17 Dec 2011 16:14:51 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 N0oI0dbJhi53 for ; Sat, 17 Dec 2011 16:14:51 -0800 (PST) Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU [18.9.25.12]) by olra.theworths.org (Postfix) with ESMTP id CEEA9431FB6 for ; Sat, 17 Dec 2011 16:14:50 -0800 (PST) X-AuditID: 1209190c-b7fad6d000000920-b0-4eed307ab2f3 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id B5.35.02336.A703DEE4; Sat, 17 Dec 2011 19:14:50 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id pBI0EnwG031589; Sat, 17 Dec 2011 19:14:50 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pBI0EmXI004513 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 17 Dec 2011 19:14:49 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1Rc4QB-0007Sx-NZ; Sat, 17 Dec 2011 19:16:07 -0500 Date: Sat, 17 Dec 2011 19:16:07 -0500 From: Austin Clements To: Dmitry Kurochkin Subject: Re: [PATCH v3 4/4] emacs: do not call `notmuch-hello-mode' on update Message-ID: <20111218001607.GL19427@mit.edu> References: <1324095619-10870-1-git-send-email-dmitry.kurochkin@gmail.com> <1324165154-5728-1-git-send-email-dmitry.kurochkin@gmail.com> <1324165154-5728-5-git-send-email-dmitry.kurochkin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1324165154-5728-5-git-send-email-dmitry.kurochkin@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkleLIzCtJLcpLzFFi42IRYrdT0a0yeOtn8GODnMXVrf3sFtdvzmR2 YPLYOesuu8ezVbeYA5iiuGxSUnMyy1KL9O0SuDK2fFrJWrCIv2LH1jmsDYwfubsY2TkkBEwk rhh3MXICWWISF+6tZ+ti5OIQEtjHKLH+zhwWkISQwAZGiWmXoyASJ5kkds/6xwqRWMIoceBi EojNIqAqsW1WFyOIzSagIbFt/3IwW0TAUOLWxVfMIDazgLTEt9/NTCC2sICvxPR9c9lBbF4B HYl/v5+xQCw4xSixYMo+NoiEoMTJmU9YIJq1JG78ewnUzAE2aPk/DpAwp4CXxIbt/8Hmiwqo SEw5uY1tAqPQLCTds5B0z0LoXsDIvIpRNiW3Sjc3MTOnODVZtzg5MS8vtUjXUC83s0QvNaV0 EyMopDkleXYwvjmodIhRgINRiYc3s/q1nxBrYllxZe4hRkkOJiVRXh/tt35CfEn5KZUZicUZ 8UWlOanFhxglOJiVRHjVwt/4CfGmJFZWpRblw6SkOViUxHmrdz30ExJITyxJzU5NLUgtgsnK cHAoSfBO1wcaKliUmp5akZaZU4KQZuLgBBnOAzS8CaSGt7ggMbc4Mx0if4pRUUqcdz5IQgAk kVGaB9cLSzmvGMWBXhHmbQep4gGmK7juV0CDmYAG9wWCXF1ckoiQkmpgXBehzmXTekthW0/g HmHThM/vTiirr+CWCKsP65YOvTBt5UrJFY9MJdxXnNvQZFLSvFFGtKKopu7dmeDm+D2tCWlz rvdcfzZrTvDyKUaV7tabFTW0vwnaz2o4GCMx5xGDrH3LBsuItQXMnbsWPwoTCGfP/NC3sUSR /5nFl+uH9HboPnmz6LuVEktxRqKhFnNRcSIAZT8I8BQDAAA= Cc: notmuch@notmuchmail.org 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: Sun, 18 Dec 2011 00:14:51 -0000 This series looks good to me. Just one nit below. Quoth Dmitry Kurochkin on Dec 18 at 3:39 am: > `notmuch-hello' should call `notmuch-hello-mode' function only when > run for the first time. But before the change, `notmuch-hello' used > `kill-all-local-variables' to remove editable widgets fields. This > caused the major mode to be reset, and `notmuch-hello-mode' to be > called every time. > > The patch manually deletes all editable widget fields and removes > `kill-all-local-variables' call. > --- > emacs/notmuch-hello.el | 10 ++++++---- > test/emacs | 1 - > 2 files changed, 6 insertions(+), 5 deletions(-) > > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el > index ca3a381..c158e89 100644 > --- a/emacs/notmuch-hello.el > +++ b/emacs/notmuch-hello.el > @@ -403,11 +403,13 @@ Complete list of currently available key bindings: > (progn > (widget-forward 1) > (widget-value (widget-at))) > - (error nil))))) > + (error nil)))) > + (inhibit-read-only t)) > > - (kill-all-local-variables) > - (let ((inhibit-read-only t)) > - (erase-buffer)) > + ;; delete all editable widget fields It would be good to explain why this is necessary, so future generations of notmuchers aren't as confused as I was by why this dance is needed. > + (mapc 'widget-delete widget-field-list) > + > + (erase-buffer) > > (unless (eq major-mode 'notmuch-hello-mode) > (notmuch-hello-mode)) > diff --git a/test/emacs b/test/emacs > index b4c2444..dffad0f 100755 > --- a/test/emacs > +++ b/test/emacs > @@ -486,7 +486,6 @@ counter=$(test_emacs \ > test_expect_equal "$counter" 1 > > test_begin_subtest "notmuch-hello-mode hook is not called on updates" > -test_subtest_known_broken > counter=$(test_emacs \ > '(let ((notmuch-hello-mode-hook-counter 0)) > (kill-buffer "*notmuch-hello*")