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: Sat, 04 Mar 2017 19:03:40 -0300	[thread overview]
Message-ID: <87zih04s3n.fsf@brickabode.com> (raw)
In-Reply-To: <87zijv31dz.fsf@nicolasgoaziou.fr>

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

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 <ebellani@gmail.com> 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 180 bytes --]

  reply	other threads:[~2017-03-04 22:04 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
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 [this message]
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=87zih04s3n.fsf@brickabode.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).