emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eduardo Bellani <ebellani@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: Org Mode <emacs-orgmode@gnu.org>, Eduardo Bellani <ebellani@gmail.com>
Subject: Re: [PATCH] Fix clocktable scope parameter
Date: Thu, 15 Dec 2016 21:37:46 -0200	[thread overview]
Message-ID: <87h964kbo4.fsf@gmail.com> (raw)
In-Reply-To: <87h9646hdk.fsf@nicolasgoaziou.fr>

[-- Attachment #1: Type: text/plain, Size: 1827 bytes --]

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 <ebellani@gmail.com> 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,

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 180 bytes --]

  reply	other threads:[~2016-12-15 23:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-15 15:02 [PATCH] Fix clocktable scope parameter Eduardo Bellani
2016-12-15 15:10 ` Nicolas Goaziou
2016-12-15 15:31   ` Eduardo Bellani
2016-12-15 16:04   ` Eduardo Bellani
2016-12-15 18:04     ` Thomas S. Dye
2016-12-15 19:16       ` Eduardo Bellani
2016-12-15 20:56         ` Nicolas Goaziou
2016-12-15 23:37           ` Eduardo Bellani [this message]
2016-12-16 21:11             ` Nicolas Goaziou
2016-12-16 22:30               ` Eduardo Bellani
2016-12-16 23:22                 ` Nicolas Goaziou
2017-03-04 22:03                   ` Eduardo Bellani
2017-03-05 10:54                     ` Nicolas Goaziou
2016-12-15 19:48       ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h964kbo4.fsf@gmail.com \
    --to=ebellani@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).