Browse Source

Clock: New variable to allow finding a recent task with `org-clock-goto'

Carsten Dominik 11 years ago
parent
commit
38b5a9e704
2 changed files with 11 additions and 1 deletions
  1. 4 0
      lisp/ChangeLog
  2. 7 1
      lisp/org-clock.el

+ 4 - 0
lisp/ChangeLog

@@ -1,5 +1,9 @@
 2009-04-22  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-clock.el (org-clock-goto-may-find-recent-task): New option.
+	(org-clock-goto): Find recent task only if
+	`org-clock-goto-may-find-recent-task' allows it.
+
 	* org-exp.el (org-export-remove-or-extract-drawers): Handle empty
 	drawers, and drawers that are missing the :END: line.
 

+ 7 - 1
lisp/org-clock.el

@@ -91,6 +91,11 @@ state to switch it to."
   :group 'org-clock
   :type 'integer)
 
+(defcustom org-clock-goto-may-find-recent-task t
+  "Non-nil means, `org-clock-goto' can go to recent task if no active clock."
+  :group 'org-clock
+  :type 'boolean)
+
 (defcustom org-clock-heading-function nil
   "When non-nil, should be a function to create `org-clock-heading'.
 This is the string shown in the mode line when a clock is running.
@@ -538,7 +543,8 @@ With prefix arg SELECT, offer recently clocked tasks for selection."
 	      (or (org-clock-select-task "Select task to go to: ")
 		  (error "No task selected")))
 	     ((marker-buffer org-clock-marker) org-clock-marker)
-	     ((and (car org-clock-history)
+	     ((and org-clock-goto-may-find-recent-task
+		   (car org-clock-history)
 		   (marker-buffer (car org-clock-history)))
 	      (setq recent t)
 	      (car org-clock-history))