From 2a7392ce41ad88d02bd17ea93aea2e29f23912b0 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Tue, 15 Jul 2014 08:14:46 +0100 Subject: [PATCH] Re: [PATCH] emacs: tree/show remove duplicate function --- 64/e923d34aa90bbcf6f5db2b0038ace8443fa141 | 97 +++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 64/e923d34aa90bbcf6f5db2b0038ace8443fa141 diff --git a/64/e923d34aa90bbcf6f5db2b0038ace8443fa141 b/64/e923d34aa90bbcf6f5db2b0038ace8443fa141 new file mode 100644 index 000000000..1e50322d2 --- /dev/null +++ b/64/e923d34aa90bbcf6f5db2b0038ace8443fa141 @@ -0,0 +1,97 @@ +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 6184F431FBD + for ; Tue, 15 Jul 2014 00:15:14 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.502 +X-Spam-Level: +X-Spam-Status: No, score=0.502 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, 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 WntroLkq75I9 for ; + Tue, 15 Jul 2014 00:15:07 -0700 (PDT) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id AF983431FBC + for ; Tue, 15 Jul 2014 00:15:07 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1X6wx7-0005wt-BC; Tue, 15 Jul 2014 08:15:05 +0100 +Received: from [194.42.225.51] (helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1X6wx7-0005vz-0K; Tue, 15 Jul 2014 08:15:05 +0100 +From: Mark Walters +To: David Bremner , notmuch@notmuchmail.org +Subject: Re: [PATCH] emacs: tree/show remove duplicate function +In-Reply-To: <87a98bbfab.fsf@maritornes.cs.unb.ca> +References: <1402134668-18587-1-git-send-email-markwalters1009@gmail.com> + <87a98bbfab.fsf@maritornes.cs.unb.ca> +User-Agent: Notmuch/0.15.2+615~g78e3a93 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Tue, 15 Jul 2014 08:14:46 +0100 +Message-ID: <87zjgbw0t5.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 194.42.225.51 +X-QM-Geographic: According to ripencc, + this message was delivered by a machine in Britain (UK) (GB). +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: f364f0d887bda182cce0fdd94454745d (of first 20000 bytes) +X-SpamAssassin-Score: -0.1 +X-SpamAssassin-SpamBar: / +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -0.1 points. + Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * -0.1 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +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: Tue, 15 Jul 2014 07:15:14 -0000 + +On Tue, 15 Jul 2014, David Bremner wrote: +> Mark Walters writes: +>> + (cond ((eq major-mode 'notmuch-show-mode) +>> + (notmuch-show-get-message-properties)) +>> + ((eq major-mode 'notmuch-tree-mode) +>> + (notmuch-tree-get-message-properties)))) +> +> I see this already existed, but it looks weird to me to have a two test +> cond with no else. Is it intentional to have the code drop through and +> do nothing if neither case matches? It seems like it might be better to +> signal an error. + +I can definitely do that. But as a comparison +notmuch-search-get-result and notmuch-search-find-thread-id "work" in +any buffer in the sense of returning nil but not complaining so perhaps +the current version is more consistent. + +Plausibly a comment and an explicit nil case would be clearer for the other modes. + +Best wishes + +Mark + + + -- 2.26.2