emacs: hello: ask confirmation for clearing recent searches

The button to clear the recent searches in notmuch-hello is easy to
press accidentally while moving around the, clearing potentially
useful searches with no way of recovering them.
This commit is contained in:
Servilio Afre Puentes 2013-06-07 16:55:57 -04:00 committed by David Bremner
parent e2f30a2b32
commit 486340e28e

View file

@ -599,8 +599,9 @@ Complete list of currently available key bindings:
(widget-insert "Recent searches: ")
(widget-create 'push-button
:notify (lambda (&rest ignore)
(setq notmuch-search-history nil)
(notmuch-hello-update))
(when (y-or-n-p "Are you sure you want to clear the searches? ")
(setq notmuch-search-history nil)
(notmuch-hello-update)))
"clear")
(widget-insert "\n\n")
(let ((start (point)))