From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH v3 4/4] emacs: do not call `notmuch-hello-mode' on update
Date: Sun, 18 Dec 2011 03:39:14 +0400 [thread overview]
Message-ID: <1324165154-5728-5-git-send-email-dmitry.kurochkin@gmail.com> (raw)
In-Reply-To: <1324165154-5728-1-git-send-email-dmitry.kurochkin@gmail.com>
`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
+ (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*")
--
1.7.7.3
next prev parent reply other threads:[~2011-12-17 23:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-17 4:20 [PATCH 1/4] test: add `notmuch-hello-mode-hook-counter' Dmitry Kurochkin
2011-12-17 4:20 ` [PATCH 2/4] test: add test for `notmuch-hello-mode-hook' Dmitry Kurochkin
2011-12-17 4:20 ` [PATCH 3/4] test: add broken test for `notmuch-hello-mode-hook' called during update Dmitry Kurochkin
2011-12-17 4:20 ` [PATCH 4/4] emacs: do not call `notmuch-hello-mode' on update Dmitry Kurochkin
2011-12-17 20:16 ` [PATCH v2 0/4] " Dmitry Kurochkin
2011-12-17 20:16 ` [PATCH v2 1/4] test: add `notmuch-hello-mode-hook-counter' Dmitry Kurochkin
2011-12-17 20:16 ` [PATCH v2 2/4] test: add test for `notmuch-hello-mode-hook' Dmitry Kurochkin
2011-12-17 20:16 ` [PATCH v2 3/4] test: add broken test for `notmuch-hello-mode-hook' called during update Dmitry Kurochkin
2011-12-17 20:17 ` [PATCH v2 4/4] emacs: do not call `notmuch-hello-mode' on update Dmitry Kurochkin
2011-12-17 23:39 ` [PATCH v3 0/4] " Dmitry Kurochkin
2011-12-17 23:39 ` [PATCH v3 1/4] test: add `notmuch-hello-mode-hook-counter' Dmitry Kurochkin
2011-12-17 23:39 ` [PATCH v3 2/4] test: add test for `notmuch-hello-mode-hook' Dmitry Kurochkin
2011-12-17 23:39 ` [PATCH v3 3/4] test: add broken test for `notmuch-hello-mode-hook' called during update Dmitry Kurochkin
2011-12-17 23:39 ` Dmitry Kurochkin [this message]
2011-12-18 0:16 ` [PATCH v3 4/4] emacs: do not call `notmuch-hello-mode' on update Austin Clements
2011-12-18 0:21 ` [PATCH v4 0/4] " Dmitry Kurochkin
2011-12-18 0:21 ` [PATCH v4 1/4] test: add `notmuch-hello-mode-hook-counter' Dmitry Kurochkin
2011-12-18 0:21 ` [PATCH v4 2/4] test: add test for `notmuch-hello-mode-hook' Dmitry Kurochkin
2011-12-18 0:21 ` [PATCH v4 3/4] test: add broken test for `notmuch-hello-mode-hook' called during update Dmitry Kurochkin
2011-12-18 0:21 ` [PATCH v4 4/4] emacs: do not call `notmuch-hello-mode' on update Dmitry Kurochkin
2011-12-18 0:32 ` [PATCH v4 0/4] " Austin Clements
2011-12-20 11:47 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1324165154-5728-5-git-send-email-dmitry.kurochkin@gmail.com \
--to=dmitry.kurochkin@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).