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 16A39431E64 for ; Sun, 2 Jun 2013 10:37:01 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.098 X-Spam-Level: X-Spam-Status: No, score=-1.098 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_MED=-2.3] 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 9Lp7dOWzaLeE for ; Sun, 2 Jun 2013 10:36:53 -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 63776431FBC for ; Sun, 2 Jun 2013 10:36:53 -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 1UjCD5-00045w-Lb; Sun, 02 Jun 2013 18:36:51 +0100 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) (envelope-from ) id 1UjCD4-0003x5-0e; Sun, 02 Jun 2013 18:36:51 +0100 From: Mark Walters To: david@tethera.net, notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: replace (funcall 'foo ...) with (foo ...) In-Reply-To: <1370175370-13561-1-git-send-email-david@tethera.net> References: <1370175370-13561-1-git-send-email-david@tethera.net> User-Agent: Notmuch/0.14+255~gff3cc55 (http://notmuchmail.org) Emacs/23.4.1 (i486-pc-linux-gnu) Date: Sun, 02 Jun 2013 18:36:39 +0100 Message-ID: <8761xwv2hk.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 93.97.24.31 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: dcfcf0cdc0d1eabaa38588e30dcacadb (of first 20000 bytes) X-SpamAssassin-Score: -0.0 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.0 points. Summary of the scoring: * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * -0.0 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean Cc: David Bremner 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: Sun, 02 Jun 2013 17:37:01 -0000 This looks good to me +1 Mark On Sun, 02 Jun 2013, david@tethera.net wrote: > From: David Bremner > > I can't see any benefit to the funcall, and it looks like the result > of cut-and-paste from some code that actually used a variable for the > function to call. > --- > > Mark and I were discussing some style issues in the context of pick, > and it seems to me that some of the elisp style in the current code > could be improved. I don't claim to be an elisp style expert by any > stretch of the imagination. It would be great if some experts could > add a section to devel/STYLE about elisp. > > > emacs/notmuch-message.el | 2 +- > emacs/notmuch-show.el | 6 +++--- > emacs/notmuch.el | 4 ++-- > 3 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el > index 4dc4883..914bdd1 100644 > --- a/emacs/notmuch-message.el > +++ b/emacs/notmuch-message.el > @@ -40,7 +40,7 @@ the \"inbox\" and \"todo\" tags, you would set: > ;; get the in-reply-to header and parse it for the message id. > (let ((rep (mail-header-parse-addresses (message-field-value "In-Reply-To")))) > (when (and notmuch-message-replied-tags rep) > - (funcall 'notmuch-tag (notmuch-id-to-query (car (car rep))) > + (notmuch-tag (notmuch-id-to-query (car (car rep))) > (notmuch-tag-change-list notmuch-message-replied-tags))))) > > (add-hook 'message-send-hook 'notmuch-message-mark-replied) > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el > index 613e666..18b4671 100644 > --- a/emacs/notmuch-show.el > +++ b/emacs/notmuch-show.el > @@ -1726,7 +1726,7 @@ TAG-CHANGES is a list of tag operations for `notmuch-tag'." > (let* ((current-tags (notmuch-show-get-tags)) > (new-tags (notmuch-update-tags current-tags tag-changes))) > (unless (equal current-tags new-tags) > - (funcall 'notmuch-tag (notmuch-show-get-message-id) tag-changes) > + (notmuch-tag (notmuch-show-get-message-id) tag-changes) > (notmuch-show-set-tags new-tags)))) > > (defun notmuch-show-tag (&optional tag-changes) > @@ -1734,7 +1734,7 @@ TAG-CHANGES is a list of tag operations for `notmuch-tag'." > > See `notmuch-tag' for information on the format of TAG-CHANGES." > (interactive) > - (setq tag-changes (funcall 'notmuch-tag (notmuch-show-get-message-id) tag-changes)) > + (setq tag-changes (notmuch-tag (notmuch-show-get-message-id) tag-changes)) > (let* ((current-tags (notmuch-show-get-tags)) > (new-tags (notmuch-update-tags current-tags tag-changes))) > (unless (equal current-tags new-tags) > @@ -1745,7 +1745,7 @@ See `notmuch-tag' for information on the format of TAG-CHANGES." > > See `notmuch-tag' for information on the format of TAG-CHANGES." > (interactive) > - (setq tag-changes (funcall 'notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes)) > + (setq tag-changes (notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes)) > (notmuch-show-mapc > (lambda () > (let* ((current-tags (notmuch-show-get-tags)) > diff --git a/emacs/notmuch.el b/emacs/notmuch.el > index 5a8c957..af107e2 100644 > --- a/emacs/notmuch.el > +++ b/emacs/notmuch.el > @@ -562,7 +562,7 @@ will be signaled." > (defun notmuch-search-tag-region (beg end &optional tag-changes) > "Change tags for threads in the given region." > (let ((search-string (notmuch-search-find-thread-id-region-search beg end))) > - (setq tag-changes (funcall 'notmuch-tag search-string tag-changes)) > + (setq tag-changes (notmuch-tag search-string tag-changes)) > (notmuch-search-foreach-result beg end > (lambda (pos) > (notmuch-search-set-tags > @@ -576,7 +576,7 @@ See `notmuch-tag' for information on the format of TAG-CHANGES." > (interactive) > (let* ((beg (if (region-active-p) (region-beginning) (point))) > (end (if (region-active-p) (region-end) (point)))) > - (funcall 'notmuch-search-tag-region beg end tag-changes))) > + (notmuch-search-tag-region beg end tag-changes))) > > (defun notmuch-search-add-tag () > "Same as `notmuch-search-tag' but sets initial input to '+'." > -- > 1.8.2.rc2 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch