Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 731D1431FAF for ; Fri, 7 Jun 2013 14:04:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dVjkghV6Hk2q for ; Fri, 7 Jun 2013 14:04:11 -0700 (PDT) Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id E4DAF431FAE for ; Fri, 7 Jun 2013 14:04:10 -0700 (PDT) Received: by mail-ob0-f180.google.com with SMTP id eh20so7059916obb.25 for ; Fri, 07 Jun 2013 14:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=7O47EGbFt2J2wn5HVCCwIn8mZxs+nNJP5l9xftfWbcg=; b=ZG+qVaK4OsLzAH2CyIiDQm/3m7Zv42hn0rcx5vENyFs0iUDcNRNGS0/FAhoSJ+BhrS FwQv/ktlsGwfYCFNouWfwtYrgSEJSG1zePbQEokusITtgamL2cwJJFrTbZDJvWjdHWSD mmC9+j3fV2dlVmQ/Dokx/M2t1B49IQ64jMsgqc4ZGANmu0fBPvqT+PMFgIwgvJxuXhY0 8Mw+eV2vGkbIggq0FpStcNoiIfdZQWySo2YX8/9NsH8tJpGVRhwrM2k8sCnO9YCaJIHc Oz/u4A3nERbpKXxtVNeIZRRdNPSshRJ1hbCukOuGvc0ClINsPxM1ULJODDDP35xSRwIi iBIw== X-Received: by 10.60.125.5 with SMTP id mm5mr320544oeb.81.1370639050442; Fri, 07 Jun 2013 14:04:10 -0700 (PDT) Received: from localhost (fammed-mip89.CSU.McMaster.CA. [130.113.164.106]) by mx.google.com with ESMTPSA id jt9sm692939obc.0.2013.06.07.14.04.09 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 07 Jun 2013 14:04:09 -0700 (PDT) From: Servilio Afre Puentes To: notmuch Subject: [PATCH v2 1/2] emacs: hello: ask confirmation for clearing recent searches In-Reply-To: <87sj0t7idi.fsf@goose.CSU.McMaster.CA> References: <87sj0t7idi.fsf@goose.CSU.McMaster.CA> User-Agent: Notmuch/0.15.2+10~gf347fe6 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Fri, 07 Jun 2013 16:55:57 -0400 Message-ID: <87ppvx7i8y.fsf@goose.CSU.McMaster.CA> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2013 21:04:18 -0000 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. --- emacs/notmuch-hello.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index c1c6f4b..1ad1bea 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -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))) -- 1.8.3