Browse Source

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.
Carsten Dominik 15 years ago
parent
commit
cbafbe5f08
2 changed files with 15 additions and 2 deletions
  1. 7 0
      lisp/ChangeLog
  2. 8 2
      lisp/org-clock.el

+ 7 - 0
lisp/ChangeLog

@@ -1,3 +1,10 @@
+2009-09-17  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-clock.el (org-clock-clocktable-default-properties): New
+	option.
+	(org-clock-report): Use
+	`org-clock-clocktable-default-properties'.
+
 2009-09-16  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.el (org-iswitchb-completing-read): Fix typo.

+ 8 - 2
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 ()