From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Bellani Subject: Re: [PATCH] Fix clocktable scope parameter Date: Thu, 15 Dec 2016 21:37:46 -0200 Message-ID: <87h964kbo4.fsf@gmail.com> References: <8760ml2q30.fsf@gmail.com> <87y3zh5iu0.fsf@nicolasgoaziou.fr> <87eg19uqji.fsf@gmail.com> <87d1gtuhou.fsf@gmail.com> <87h9646hdk.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHfbF-0001CI-Jn for emacs-orgmode@gnu.org; Thu, 15 Dec 2016 18:38:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cHfbC-0004fR-Hz for emacs-orgmode@gnu.org; Thu, 15 Dec 2016 18:38:09 -0500 Received: from mail-vk0-x244.google.com ([2607:f8b0:400c:c05::244]:36585) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cHfbC-0004f4-Co for emacs-orgmode@gnu.org; Thu, 15 Dec 2016 18:38:06 -0500 Received: by mail-vk0-x244.google.com with SMTP id w194so8768556vkw.3 for ; Thu, 15 Dec 2016 15:38:06 -0800 (PST) In-reply-to: <87h9646hdk.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: Org Mode , Eduardo Bellani --=-=-= Content-Type: text/plain Hello Nicolas. > Thank you. However, this is not a "fix" per se. I agree. I should be more explicit as to what this is. >> * lisp/org-clock.el (org-dblock-write:clocktable): Make sure to eval >> the scope if it is a lisp expression, or to return the scope if it >> is just a list. > > This comment is no longer accurate. Actually, I think the above is accurate, but poorly expressed. As I'll try to show on the next email. But before that, I though of discussing this a bit here. The old behavior was an eval on a form if that form was not a list of strings. The implicit expectation was for a list of strings to be returned by that eval call. The above seems to be a raw attempt to evaluate a function form. In that case, it seems more elegant to be more explicit and do a (apply (car scope) (cdr scope)) This also allows for passing arguments to the function without using the full power of eval. What do you guys think? Nicolas Goaziou writes: > Hello, > > Eduardo Bellani writes: > >> org-clock.el: Fix clocktable scope parameter > > Thank you. However, this is not a "fix" per se. > >> * lisp/org-clock.el (org-dblock-write:clocktable): Make sure to eval >> the scope if it is a lisp expression, or to return the scope if it >> is just a list. > > This comment is no longer accurate. > >> + (function-name) @r{scan the list of files returned by calling this function.} > > Why should the function be within a list? I suggest something like > > function @r{list of files returned by calling the function with no argument} > >> - ((pred consp) scope) >> + ((and (pred #'listp) (pred (lambda (scope) (symbolp (car scope))))) >> + (funcall (car scope))) > > Per above, it should be > > ((pred functionp) (funcall scope)) > > Regards, --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlhTKUoACgkQSbLl0kCTjGnmvACeME5+AsPlojqg2WPXTZZNgvgL PG4An0253BY68HAnXc5cTu+uokzdGKzl =vWbD -----END PGP SIGNATURE----- --=-=-=--