X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;ds=sidebyside;f=emacs%2Fnotmuch-hello.el;h=81b26059ab1a01dfbfdd5d93bd2f1a385f219511;hb=59adb2da193efef806b37e2c85981024a39ee2e3;hp=0582cae76f492fc1ab349ab4458e889b2ea576ae;hpb=f0e0053149bb3b51f4a0cd43371292b639f236a8;p=notmuch diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 0582cae7..81b26059 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -138,6 +138,11 @@ Typically \",\" in the US and UK and \".\" in Europe." :group 'notmuch :type 'string) +(defcustom notmuch-hello-mode-hook nil + "Functions called after entering `notmuch-hello-mode'." + :group 'notmuch + :type 'hook) + (defvar notmuch-hello-url "http://notmuchmail.org" "The `notmuch' web site.") @@ -355,6 +360,7 @@ Complete list of currently available key bindings: (use-local-map notmuch-hello-mode-map) (setq major-mode 'notmuch-hello-mode mode-name "notmuch-hello") + (run-mode-hooks 'notmuch-hello-mode-hook) ;;(setq buffer-read-only t) ) @@ -397,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)) + + ;; 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) - (kill-all-local-variables) - (let ((inhibit-read-only t)) - (erase-buffer)) + (erase-buffer) (unless (eq major-mode 'notmuch-hello-mode) (notmuch-hello-mode))