diff options
author | Dmitry Kurochkin <dmitry.kurochkin@gmail.com> | 2011-12-18 04:21:21 +0400 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2011-12-20 07:42:31 -0400 |
commit | 59adb2da193efef806b37e2c85981024a39ee2e3 (patch) | |
tree | acac11045121f9b702075dfe31e7f48054181199 /emacs/notmuch-hello.el | |
parent | 9928b5b50f44d66d02f422d1f6b6a1bca72a4580 (diff) |
emacs: do not call `notmuch-hello-mode' on update
`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.
Diffstat (limited to 'emacs/notmuch-hello.el')
-rw-r--r-- | emacs/notmuch-hello.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index ca3a3813..81b26059 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -403,11 +403,16 @@ 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. Editable widget fields are + ;; tracked in a buffer local variable `widget-field-list' (and + ;; others). If we do `erase-buffer' without properly deleting the + ;; widgets, some widget-related functions are confused later. + (mapc 'widget-delete widget-field-list) + + (erase-buffer) (unless (eq major-mode 'notmuch-hello-mode) (notmuch-hello-mode)) |