From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Bellani Subject: Re: [PATCH] Fix clocktable scope parameter Date: Sat, 04 Mar 2017 19:03:40 -0300 Message-ID: <87zih04s3n.fsf@brickabode.com> References: <8760ml2q30.fsf@gmail.com> <87y3zh5iu0.fsf@nicolasgoaziou.fr> <87eg19uqji.fsf@gmail.com> <87d1gtuhou.fsf@gmail.com> <87h9646hdk.fsf@nicolasgoaziou.fr> <87h964kbo4.fsf@gmail.com> <87h9634m01.fsf@nicolasgoaziou.fr> <87zijvzev0.fsf@gmail.com> <87zijv31dz.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]:58005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckHmW-0005rv-4i for emacs-orgmode@gnu.org; Sat, 04 Mar 2017 17:04:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ckHmR-0006eW-6s for emacs-orgmode@gnu.org; Sat, 04 Mar 2017 17:04:04 -0500 Received: from mail-ua0-x243.google.com ([2607:f8b0:400c:c08::243]:36068) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ckHmR-0006eG-30 for emacs-orgmode@gnu.org; Sat, 04 Mar 2017 17:03:59 -0500 Received: by mail-ua0-x243.google.com with SMTP id y16so12708288uay.3 for ; Sat, 04 Mar 2017 14:03:57 -0800 (PST) In-reply-to: <87zijv31dz.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 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." (`file-with-archives (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)) -- TINYCHANGE Nicolas Goaziou writes: > Eduardo Bellani 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, --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAli7ObwACgkQSbLl0kCTjGkCeQCfX4L+Fa0c6AqC4m47/FNYPSxT 75UAn3tx1n3dn0avRkVnejoFSj2ZbKEm =CWYd -----END PGP SIGNATURE----- --=-=-=--