From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Bellani Subject: [PATCH] Adds function form evaluation parameter for the clocktable scope Date: Fri, 16 Dec 2016 12:32:22 -0200 Message-ID: <87eg18j66h.fsf@gmail.com> 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]:42102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHtYm-0006bL-BC for emacs-orgmode@gnu.org; Fri, 16 Dec 2016 09:32:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cHtYj-0004wB-OC for emacs-orgmode@gnu.org; Fri, 16 Dec 2016 09:32:32 -0500 Received: from mail-ua0-x22c.google.com ([2607:f8b0:400c:c08::22c]:36722) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cHtYj-0004vp-Ie for emacs-orgmode@gnu.org; Fri, 16 Dec 2016 09:32:29 -0500 Received: by mail-ua0-x22c.google.com with SMTP id 3so24197753uaz.3 for ; Fri, 16 Dec 2016 06:32:29 -0800 (PST) Received: from personal ([187.65.220.63]) by smtp.gmail.com with ESMTPSA id d64sm1667779uad.5.2016.12.16.06.32.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Dec 2016 06:32:27 -0800 (PST) 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: Org Mode --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable org-clock.el: Adds function form evaluation parameter for the clocktable sc= ope * lisp/org-clock.el (org-dblock-write:clocktable): Make sure to evaluate the function form passed as the scope for the clocktable. * doc/org.texi: Document the feature of using a function form as the scope for the clocktable. This adds back to the clocktable the capacity to have as scope both a list of file paths or a function that returns such a list. Also adds this feature the the manual. =2D-- doc/org.texi | 1 + lisp/org-clock.el | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/org.texi b/doc/org.texi index 6be76d8..fb88827 100644 =2D-- a/doc/org.texi +++ b/doc/org.texi @@ -6638,6 +6638,7 @@ be selected: tree @r{the surrounding level 1 tree} agenda @r{all agenda files} ("file"..) @r{scan these files} + (symbol "argument1" ...) @r{scan the files returned by evalua= ting the function 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 eithe= r} diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 65c13fd..3ccd309 100644 =2D-- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -2370,7 +2370,9 @@ the currently selected interval size." (`file-with-archives (and buffer-file-name (org-add-archive-files (list buffer-file-name)))) =2D ((pred consp) scope) + ((and (pred #'listp) (pred (lambda (scope) (symbolp (c= ar scope))))) + (apply (car scope) (cdr scope))) + ((pred listp) scope) (_ (or (buffer-file-name) (current-buffer))))) (block (plist-get params :block)) (ts (plist-get params :tstart)) =2D-=20 TINYCHANGE --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlhT+vYACgkQSbLl0kCTjGnQJwCeJFrCvY654BX8IR1vjFHxBfvD YjIAmwfMO+0f9cJUccnszuEU/179l2L9 =BLKu -----END PGP SIGNATURE----- --=-=-=--