Jelajahi Sumber

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 16 tahun lalu
induk
melakukan
cbafbe5f08
2 mengubah file dengan 15 tambahan dan 2 penghapusan
  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>
 2009-09-16  Carsten Dominik  <carsten.dominik@gmail.com>
 
 
 	* org.el (org-iswitchb-completing-read): Fix typo.
 	* org.el (org-iswitchb-completing-read): Fix typo.

+ 8 - 2
lisp/org-clock.el

@@ -201,6 +201,12 @@ string as argument."
 	  (string :tag "Program")
 	  (string :tag "Program")
 	  (function :tag "Function")))
 	  (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
 (defvar org-clock-in-prepare-hook nil
   "Hook run when preparing the clock.
   "Hook run when preparing the clock.
 This hook is run before anything happens to the task that
 This hook is run before anything happens to the task that
@@ -1035,8 +1041,8 @@ buffer and update it."
     (org-show-entry))
     (org-show-entry))
   (if (org-in-clocktable-p)
   (if (org-in-clocktable-p)
       (goto-char (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))
   (org-update-dblock))
 
 
 (defun org-in-clocktable-p ()
 (defun org-in-clocktable-p ()