Re: [PATCH v1] emacs: Report a lack of matches when calling `notmuch-show'.
authorMark Walters <markwalters1009@gmail.com>
Sun, 7 Feb 2016 23:09:12 +0000 (23:09 +0000)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:21:01 +0000 (16:21 -0700)
31/b92d31b0554863b8f30bf85778c9c017c777f4 [new file with mode: 0644]

diff --git a/31/b92d31b0554863b8f30bf85778c9c017c777f4 b/31/b92d31b0554863b8f30bf85778c9c017c777f4
new file mode 100644 (file)
index 0000000..d8ebb0e
--- /dev/null
@@ -0,0 +1,133 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 2F76F6DE171E\r
+ for <notmuch@notmuchmail.org>; Sun,  7 Feb 2016 15:09:19 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.201 tagged_above=-999 required=5 tests=[AWL=0.369,\r
+  DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 1OEaIyzhBbCg for <notmuch@notmuchmail.org>;\r
+ Sun,  7 Feb 2016 15:09:16 -0800 (PST)\r
+Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com\r
+ [74.125.82.68]) by arlo.cworth.org (Postfix) with ESMTPS id 82A296DE0C4A for\r
+ <notmuch@notmuchmail.org>; Sun,  7 Feb 2016 15:09:16 -0800 (PST)\r
+Received: by mail-wm0-f68.google.com with SMTP id r129so12940603wmr.0\r
+ for <notmuch@notmuchmail.org>; Sun, 07 Feb 2016 15:09:16 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+ :mime-version:content-type;\r
+ bh=b4VOYGeKDoYYI/9tsZZOX5J2jNnnKBiCnxtboJq1nxc=;\r
+ b=OFUziC/24AicE6FsxWciLdT6Yjh4qeg51K5zve+HNqJs3GlM2I0tr3EcHlPn+dnAuk\r
+ PVQ1e5sqvBhnA8pZlbCC4BkTlie6sj4HiS57prceJycV3kDiezEfM0Jxa1oDspA367mt\r
+ E+UW67j+fe/QjfLW2Pr0TO4NbjzERsSJHeFatxh9wtHk2tLv7TbuBUhhqf3J99gsd1hu\r
+ yM6wjmYHh5C/EMssutR/VCt7tr6RPwUKZ9pPQ9qMOfu58OOgmAeQn//AMvbLnIkLiSWL\r
+ boA2D0R32w1GwGZQV5GVP2mp3N2FPo9PzUho7aD/4HdRfhk6uN9mT518H5c021scSdIR\r
+ 03/A==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:subject:in-reply-to:references\r
+ :user-agent:date:message-id:mime-version:content-type;\r
+ bh=b4VOYGeKDoYYI/9tsZZOX5J2jNnnKBiCnxtboJq1nxc=;\r
+ b=cdCkQkPOmhMGSQY3X1nL4HWJhrT5hgWKM6dZg1PhZbCYB8KBvE7f0ygpIKcH8H9YDG\r
+ CsJXAzU10R5zdLEcE02zEipfaEcTAg+9dV2IraWrrGvKEs2eJaF9JHggroMQhMZQmI5V\r
+ J1wYkbhrFZrS1GG58Hi0xh/R+0maLyG/QpaU6n+JTyxEMmhtCjNaDI7ViPi9HXKjFxLP\r
+ eWcQ0SIT1f2Y6He45ppt3pZysrUd8Ad+4mz/hISq3y+SKrIxHEyag+ebbfU+1W2WMb7K\r
+ YJaKseKpDU2dj8JioL9FArLTGnD7itsWjpwGWt7udNIkMFBsMaGtm9orxooWrh7mQm9m\r
+ 80uw==\r
+X-Gm-Message-State:\r
+ AG10YOSC7IT+gBOa7M3Ec+m0O8dB0Z2KYD93oPB7bgY9I7K0xDOiZ1VHYX+dQgBjcUDoaA==\r
+X-Received: by 10.194.7.67 with SMTP id h3mr24080087wja.44.1454886554513;\r
+ Sun, 07 Feb 2016 15:09:14 -0800 (PST)\r
+Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
+ by smtp.gmail.com with ESMTPSA id kb5sm27012417wjc.22.2016.02.07.15.09.13\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sun, 07 Feb 2016 15:09:13 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v1] emacs: Report a lack of matches when calling\r
+ `notmuch-show'.\r
+In-Reply-To: <1454782892-1690-2-git-send-email-dme@dme.org>\r
+References: <1454782892-1690-1-git-send-email-dme@dme.org>\r
+ <1454782892-1690-2-git-send-email-dme@dme.org>\r
+User-Agent: Notmuch/0.18.1+485~gca076ce (http://notmuchmail.org) Emacs/24.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sun, 07 Feb 2016 23:09:12 +0000\r
+Message-ID: <871t8onmnb.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 07 Feb 2016 23:09:19 -0000\r
+\r
+On Sat, 06 Feb 2016, David Edmondson <dme@dme.org> wrote:\r
+> If the basic query passed to `notmuch-show' generates no results,\r
+> throw an error and inform the user that no messages matched the query\r
+> rather than displaying an empty buffer and showing an obscure error.\r
+\r
+Hi\r
+\r
+First this is a clear improvement on the current behaviour, an I am\r
+happy with it as is.\r
+\r
+However, I wonder if we actually want an error at all in this case,\r
+rather than just a "message". I think some people run with\r
+debug-on-error enabled and it might be annoying in that case (though\r
+clearly less annoying than the current situation).\r
+\r
+[If anyone cares the current error comes from the marking read code in\r
+the post-command hook which assumes the buffer has a message]\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+> ---\r
+>  emacs/notmuch-show.el | 8 +++++++-\r
+>  1 file changed, 7 insertions(+), 1 deletion(-)\r
+>\r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index 3345878..335992e 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -1248,7 +1248,13 @@ function is used."\r
+>      (when (and (eq (buffer-size) 0)\r
+>                 notmuch-show-query-context)\r
+>        (notmuch-show-insert-forest\r
+> -       (notmuch-query-get-threads (append cli-args basic-args)))))\r
+> +       (notmuch-query-get-threads (append cli-args basic-args))))\r
+> +\r
+> +    ;; If there are still no results, kill the buffer and throw an\r
+> +    ;; error.\r
+> +    (when (eq (buffer-size) 0)\r
+> +      (kill-buffer (current-buffer))\r
+> +      (error "No messages matched the query.")))\r
+>  \r
+>        (jit-lock-register #'notmuch-show-buttonise-links)\r
+>  \r
+> -- \r
+> 2.1.4\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> https://notmuchmail.org/mailman/listinfo/notmuch\r