From cbafbe5f08bc7a14f36a4063a19987ac16734d17 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Thu, 17 Sep 2009 07:33:54 +0100 Subject: [PATCH] Make default clocktable properties configurable Jeff Kowalczyk writes: > I frequently use clocktables, and always use scope: subtree. The > default scope is file. > > If it doesn't exist already (I didn't find it with grep), an org > customization variable for this preference would be very helpful. --- lisp/ChangeLog | 7 +++++++ lisp/org-clock.el | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 784a4b52a..0ae4b9af2 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2009-09-17 Carsten Dominik + + * org-clock.el (org-clock-clocktable-default-properties): New + option. + (org-clock-report): Use + `org-clock-clocktable-default-properties'. + 2009-09-16 Carsten Dominik * org.el (org-iswitchb-completing-read): Fix typo. diff --git a/lisp/org-clock.el b/lisp/org-clock.el index e462212e8..cf6389255 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -201,6 +201,12 @@ string as argument." (string :tag "Program") (function :tag "Function"))) +(defcustom org-clock-clocktable-default-properties '(:maxlevel 2 :scope file) + "Default properties for new clocktables." + :group 'org-clock + :type 'plist) + + (defvar org-clock-in-prepare-hook nil "Hook run when preparing the clock. This hook is run before anything happens to the task that @@ -1035,8 +1041,8 @@ buffer and update it." (org-show-entry)) (if (org-in-clocktable-p) (goto-char (org-in-clocktable-p)) - (org-create-dblock (list :name "clocktable" - :maxlevel 2 :scope 'file))) + (org-create-dblock (append (list :name "clocktable") + org-clock-clocktable-default-properties))) (org-update-dblock)) (defun org-in-clocktable-p ()