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 82780431FB6 for ; Fri, 3 May 2013 11:04:33 -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 q99kiriR4ZkV for ; Fri, 3 May 2013 11:04:28 -0700 (PDT) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 0E2D4431FAF for ; Fri, 3 May 2013 11:04:28 -0700 (PDT) Received: by mail-ie0-f180.google.com with SMTP id ar20so2089797iec.39 for ; Fri, 03 May 2013 11:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=o/umGeqjhCUxGWJxgpA+/YnEKDBS62D5TJOBM9MqiFA=; b=ufTe2PiBocVYj2cF8IWneBng/jULz2lg788Gcui8GxFwlNXrfp7T78AbtWf2ovc3bM MoBws5oofrnlTWo7CjgZ1EYqgoijf53gOM1PGpCuk6YR9/UjathM2Pr7CvRoNVCc99aC JT50fSdNj0+6bZFL1lCEJU0ww5lpfQq/W+W9kK4QFFi1a4kgu14bSkOgV/7ONvqIEzuB /7CyybKsFviMgSO9SCVguAaArYmgLxJv05Otug3Nix3W1bwNwrzdFu9zZP1JQB7GjBh6 HhIhfUgJNL8Y8hdERmOSwCXEaelr0XCOCZxkI8a6bw0jSRUeLvVlbYVFTbKBcjjnfFEP OVPQ== X-Received: by 10.50.120.34 with SMTP id kz2mr10615141igb.38.1367604267666; Fri, 03 May 2013 11:04:27 -0700 (PDT) Received: from localhost (fammed-mip89.CSU.McMaster.CA. [130.113.164.106]) by mx.google.com with ESMTPSA id y5sm11183336igg.7.2013.05.03.11.04.26 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 03 May 2013 11:04:26 -0700 (PDT) From: Servilio Afre Puentes To: notmuch Subject: [PATCH 1/2] emacs: hello: ask confirmation for clearing recent searches In-Reply-To: <87y5bwkml2.fsf@goose.CSU.McMaster.CA> References: <87y5bwkml2.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, 03 May 2013 13:57:12 -0400 Message-ID: <87vc70kkuf.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, 03 May 2013 18:04:33 -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..aa063b7 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 (yes-or-no-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.2.1