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 17:16:01 -0200 Message-ID: <87d1gtuhou.fsf@gmail.com> References: <8760ml2q30.fsf@gmail.com> <87y3zh5iu0.fsf@nicolasgoaziou.fr> <87eg19uqji.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]:57182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHbWj-0006QY-TC for emacs-orgmode@gnu.org; Thu, 15 Dec 2016 14:17:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cHbWe-0007Tq-Ro for emacs-orgmode@gnu.org; Thu, 15 Dec 2016 14:17:13 -0500 Received: from mail-vk0-f67.google.com ([209.85.213.67]:36346) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cHbWe-0007TP-Mc for emacs-orgmode@gnu.org; Thu, 15 Dec 2016 14:17:08 -0500 Received: by mail-vk0-f67.google.com with SMTP id w194so8381968vkw.3 for ; Thu, 15 Dec 2016 11:17:08 -0800 (PST) In-reply-to: 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: "Thomas S. Dye" Cc: Org Mode , Eduardo Bellani , Nicolas Goaziou --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable org-clock.el: Fix clocktable scope parameter * 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. * doc/org.texi: Document the feature of using a function 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. =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..51bd702 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} + (function-name) @r{scan the list of files returned by calling= this function.} 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..2f7db65 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))))) + (funcall (car scope))) + ((pred listp) scope) (_ (or (buffer-file-name) (current-buffer))))) (block (plist-get params :block)) (ts (plist-get params :tstart)) =2D-=20 TINYCHANGE Thomas S. Dye writes: > Aloha Eduardo, > > orgmanual.org is an old experiment about keeping the org mode manual in > org mode. > > The documentation is in org.texi, and this is the one you should work on > for new documentation. > > All the best, > Tom > > Eduardo Bellani writes: > >> Hello everyone, >> >> One extra question, about documentation. >> >> The place for documenting this feature seems to be 'orgmanual.org'. But >> my searches revealed that there is also 'org.texi' there. Exporting the >> first file to the texi format didn't match the second file. >> >> Is there a documentation about, well, adding documentation? >> >> Thanks. >> >> Nicolas Goaziou writes: >> >>> Hello, >>> >>> Eduardo Bellani writes: >>> >>>> org-clock.el: Fix clocktable scope parameter >>>> >>>> * 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 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. >>> >>> Thank you. >>> >>> However, I'd rather not introduce more `eval' in the code base. >>> >>> Instead, you can test if scope is a function and `funcall' it. This is >>> a new feature, which would require some documentation and an entry in >>> ORG-NEWS. >>> >>> Regards, --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlhS6/EACgkQSbLl0kCTjGnNdwCfcs39XzdvVByX+gIrPpnQNV2h NcAAmwVS1dx5lYHxV2dZBpDo1hz1sJ5s =bfyT -----END PGP SIGNATURE----- --=-=-=--