]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-hello.el
emacs: hello: ask confirmation for clearing recent searches
[notmuch] / emacs / notmuch-hello.el
index cda79f1dde695aabadd5f80f49f22d07af22b737..1ad1beafdc8ff5f40084887a9be489b7c2b262db 100644 (file)
@@ -26,7 +26,7 @@
 (require 'notmuch-lib)
 (require 'notmuch-mua)
 
-(declare-function notmuch-search "notmuch" (query &optional oldest-first target-thread target-line continuation))
+(declare-function notmuch-search "notmuch" (&optional query oldest-first target-thread target-line continuation))
 (declare-function notmuch-poll "notmuch" ())
 
 (defcustom notmuch-hello-recent-searches-max 10
@@ -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)))