summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-16 22:08:01 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-10-16 22:08:01 -0400
commit63fbf2aab8968a1674b1bc2cdc0c908bb44cff44 (patch)
treeadb4a8ee9a043677f4bf70fe630e21e9cbae9b1e
parenta5150cca5d54f72976f0798fd315da40b364fda6 (diff)
downloadorg-mode-63fbf2aab8968a1674b1bc2cdc0c908bb44cff44.tar.gz
Add new parameter to the `org-clock-out' command
(org-clock-out): Accept new third parameter `at-time', which permits a clock to be clocked out at a specific time. Note that no attempt is made to verify that the clock out time is later than the clock in time.
-rwxr-xr-xlisp/ChangeLog4
-rw-r--r--lisp/org-clock.el5
2 files changed, 7 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c6bbce7..f3c1fa4 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -3,6 +3,10 @@
* org-clock.el (org-clock-in): Before creating
`org-clock-mode-line-timer', check to make sure an older timer is
not currently running.
+ (org-clock-out): Accept new third parameter `at-time', which
+ permits a clock to be clocked out at a specific time. Note that
+ no attempt is made to verify that the clock out time is later than
+ the clock in time.
* org.el (org-files-list): New utility function for returning a
list of all open org-mode buffers, plus all files used to build
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 587c724..5518523 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -751,7 +751,7 @@ line and position cursor in that line."
(and (re-search-forward org-property-end-re nil t)
(goto-char (match-beginning 0))))))))
-(defun org-clock-out (&optional fail-quietly)
+(defun org-clock-out (&optional fail-quietly at-time)
"Stop the currently running clock.
If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
(interactive)
@@ -772,7 +772,8 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
(goto-char (match-end 0))
(delete-region (point) (point-at-eol))
(insert "--")
- (setq te (org-insert-time-stamp (current-time) 'with-hm 'inactive))
+ (setq te (org-insert-time-stamp (or at-time (current-time))
+ 'with-hm 'inactive))
(setq s (- (org-float-time (apply 'encode-time (org-parse-time-string te)))
(org-float-time (apply 'encode-time (org-parse-time-string ts))))
h (floor (/ s 3600))