[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] Fix clocktable scope parameter

From: Eduardo Bellani
Subject: Re: [O] [PATCH] Fix clocktable scope parameter
Date: Sat, 04 Mar 2017 19:03:40 -0300
User-agent: mu4e 0.9.17; emacs 24.4.1

org-clock.el: Fix clocktable scope parameter

* lisp/org-clock.el (org-dblock-write:clocktable): Funcall the scope
  argument if it is a function.

* doc/org.texi: Document the feature of using a function, both bounded
  and as a lambda form, as the scope for the clocktable.

This modifies the behavior of the scope parameter to have as scope both
a list of file paths or a nullary function that returns such a list.
 doc/org.texi      | 2 ++
 lisp/org-clock.el | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/doc/org.texi b/doc/org.texi
index 6be76d8..ef4021f 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -6638,6 +6638,8 @@ be selected:
              tree       @r{the surrounding level 1 tree}
              agenda     @r{all agenda files}
              ("file"..) @r{scan these files}
+             symbol     @r{scan the files returned by calling the nullary 
function bound to this symbol}
+             lambda-form  @r{Same as above, but the nullary function is passed 
as a lambda form.}
              file-with-archives    @r{current file and its archives}
              agenda-with-archives  @r{all agenda files, including archives}
 :block       @r{The time block to consider.  This block is specified either}
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 65c13fd..1a3f3d6 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2370,7 +2370,8 @@ the currently selected interval size."
                     (and buffer-file-name
                          (org-add-archive-files (list buffer-file-name))))
-                   ((pred consp) scope)
+                    ((pred #'functionp) (funcall scope))
+                    ((pred listp) scope)
                    (_ (or (buffer-file-name) (current-buffer)))))
           (block (plist-get params :block))
           (ts (plist-get params :tstart))

Nicolas Goaziou writes:

> Eduardo Bellani <address@hidden> writes:
>> The only problem I see with this is that it will be backwards
>> incompatible.
>> Any thoughts on that?
> That's not a problem, as long as there is an entry about it in ORG-NEWS
> and that the behaviour is properly documented this time.
> Regards,

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]