1 Return-Path: <m.walters@qmul.ac.uk>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 0E2C1429E2E
\r
6 for <notmuch@notmuchmail.org>; Sun, 2 Jun 2013 10:26:06 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5
\r
12 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,
\r
13 NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id 07JLb-8f5E1i for <notmuch@notmuchmail.org>;
\r
17 Sun, 2 Jun 2013 10:25:58 -0700 (PDT)
\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id ECD0D431FBC
\r
22 for <notmuch@notmuchmail.org>; Sun, 2 Jun 2013 10:25:57 -0700 (PDT)
\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])
\r
24 by mail2.qmul.ac.uk with esmtp (Exim 4.71)
\r
25 (envelope-from <m.walters@qmul.ac.uk>)
\r
26 id 1UjC2N-0000fN-QP; Sun, 02 Jun 2013 18:25:50 +0100
\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)
\r
28 by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)
\r
29 (envelope-from <m.walters@qmul.ac.uk>)
\r
30 id 1UjC2N-00029p-BR; Sun, 02 Jun 2013 18:25:47 +0100
\r
31 From: Mark Walters <markwalters1009@gmail.com>
\r
32 To: david@tethera.net, notmuch@notmuchmail.org
\r
33 Subject: Re: [PATCH] emacs: replace setq + let with let*
\r
34 In-Reply-To: <1370185351-23834-1-git-send-email-david@tethera.net>
\r
35 References: <1370175370-13561-1-git-send-email-david@tethera.net>
\r
36 <1370185351-23834-1-git-send-email-david@tethera.net>
\r
37 User-Agent: Notmuch/0.14+255~gff3cc55 (http://notmuchmail.org) Emacs/23.4.1
\r
39 Date: Sun, 02 Jun 2013 18:25:36 +0100
\r
40 Message-ID: <878v2sv2zz.fsf@qmul.ac.uk>
\r
42 Content-Type: text/plain; charset=us-ascii
\r
43 X-Sender-Host-Address: 93.97.24.31
\r
44 X-QM-SPAM-Info: Sender has good ham record. :)
\r
45 X-QM-Body-MD5: 67eabe4b552f1eef3ecffe4c3d34f2f5 (of first 20000 bytes)
\r
46 X-SpamAssassin-Score: -0.0
\r
47 X-SpamAssassin-SpamBar: /
\r
48 X-SpamAssassin-Report: The QM spam filters have analysed this message to
\r
50 spam. We require at least 5.0 points to mark a message as spam.
\r
51 This message scored -0.0 points.
\r
52 Summary of the scoring:
\r
53 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
\r
54 provider * (markwalters1009[at]gmail.com)
\r
55 * -0.0 AWL AWL: From: address is in the auto white-list
\r
56 X-QM-Scan-Virus: ClamAV says the message is clean
\r
57 Cc: David Bremner <bremner@debian.org>
\r
58 X-BeenThere: notmuch@notmuchmail.org
\r
59 X-Mailman-Version: 2.1.13
\r
61 List-Id: "Use and development of the notmuch mail system."
\r
62 <notmuch.notmuchmail.org>
\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
66 List-Post: <mailto:notmuch@notmuchmail.org>
\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
70 X-List-Received-Date: Sun, 02 Jun 2013 17:26:06 -0000
\r
73 On Sun, 02 Jun 2013, david@tethera.net wrote:
\r
74 > From: David Bremner <bremner@debian.org>
\r
76 > I found several places where a setq is immediately followed by a let
\r
77 > or a let*. This seems to be the pessimal combination, with the
\r
78 > implicit scope of the setq combined with the extra indentation of the let.
\r
79 > I combined these cases into a single let* which I think is easier to read.
\r
80 > In two places I turned a single clause let into a let*.
\r
82 > emacs/notmuch-hello.el | 4 ++--
\r
83 > emacs/notmuch-show.el | 4 ++--
\r
84 > emacs/notmuch.el | 5 ++---
\r
85 > 3 files changed, 6 insertions(+), 7 deletions(-)
\r
87 > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
\r
88 > index c1c6f4b..15e3614 100644
\r
89 > --- a/emacs/notmuch-hello.el
\r
90 > +++ b/emacs/notmuch-hello.el
\r
91 > @@ -260,8 +260,8 @@ afterwards.")
\r
92 > (defun notmuch-hello-search (&optional search)
\r
94 > (unless (null search)
\r
95 > - (setq search (notmuch-hello-trim search))
\r
96 > - (let ((history-delete-duplicates t))
\r
97 > + (let* ((search (notmuch-hello-trim search))
\r
98 > + (history-delete-duplicates t))
\r
99 > (add-to-history 'notmuch-search-history search)))
\r
100 > (notmuch-search search notmuch-search-oldest-first nil nil
\r
102 These look good to me except I don't see why the above is a let* not a
\r
109 > #'notmuch-hello-search-continuation))
\r
110 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
111 > index 18b4671..e8c8343 100644
\r
112 > --- a/emacs/notmuch-show.el
\r
113 > +++ b/emacs/notmuch-show.el
\r
114 > @@ -1734,8 +1734,8 @@ TAG-CHANGES is a list of tag operations for `notmuch-tag'."
\r
116 > See `notmuch-tag' for information on the format of TAG-CHANGES."
\r
118 > - (setq tag-changes (notmuch-tag (notmuch-show-get-message-id) tag-changes))
\r
119 > - (let* ((current-tags (notmuch-show-get-tags))
\r
120 > + (let* ((tag-changes (notmuch-tag (notmuch-show-get-message-id) tag-changes))
\r
121 > + (current-tags (notmuch-show-get-tags))
\r
122 > (new-tags (notmuch-update-tags current-tags tag-changes)))
\r
123 > (unless (equal current-tags new-tags)
\r
124 > (notmuch-show-set-tags new-tags))))
\r
125 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
126 > index af107e2..edb5a1c 100644
\r
127 > --- a/emacs/notmuch.el
\r
128 > +++ b/emacs/notmuch.el
\r
129 > @@ -904,9 +904,8 @@ Other optional parameters are used as follows:
\r
130 > target-line: The line number to move to if the target thread does not
\r
131 > appear in the search results."
\r
133 > - (if (null query)
\r
134 > - (setq query (notmuch-read-query "Notmuch search: ")))
\r
135 > - (let ((buffer (get-buffer-create (notmuch-search-buffer-title query))))
\r
136 > + (let* ((query (or query (notmuch-read-query "Notmuch search: ")))
\r
137 > + (buffer (get-buffer-create (notmuch-search-buffer-title query))))
\r
138 > (switch-to-buffer buffer)
\r
139 > (notmuch-search-mode)
\r
140 > ;; Don't track undo information for this buffer
\r
144 > _______________________________________________
\r
145 > notmuch mailing list
\r
146 > notmuch@notmuchmail.org
\r
147 > http://notmuchmail.org/mailman/listinfo/notmuch
\r