1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-31 11:13:59 +00:00

org-clock-auto-clock-resolution is now a tri-state

This commit is contained in:
John Wiegley 2009-10-25 18:03:23 -04:00
parent 1771e61cfc
commit 511bcc9e81
2 changed files with 19 additions and 7 deletions

View File

@ -1,3 +1,11 @@
2009-10-25 John Wiegley <jwiegley@gmail.com>
* org-clock.el
(org-clock-auto-clock-resolution): Now takes three values: nil, t
and `when-no-clock-is-running'.
(org-clock-in): Use `org-clock-auto-clock-resolution' to determine
whether or not to resolve Org buffers on clock in.
2009-10-25 Carsten Dominik <carsten.dominik@gmail.com>
* org-clock.el (org-clock-has-been-used): New variable.

View File

@ -214,10 +214,13 @@ string as argument."
(const :tag "Never" nil)
(integer :tag "After N minutes")))
(defcustom org-clock-auto-clock-resolution t
"When non-nil, do not resolve open clocks on clock-in."
(defcustom org-clock-auto-clock-resolution 'when-no-clock-is-running
"When to automatically resolve open clocks found in Org buffers."
:group 'org-clock
:type 'boolean)
:type '(choice
(const :tag "Never" nil)
(const :tag "Always" t)
(const :tag "When no clock is running" when-no-clock-is-running)))
(defvar org-clock-in-prepare-hook nil
"Hook run when preparing the clock.
@ -820,10 +823,11 @@ the clocking selection, associated with the letter `d'."
ts selected-task target-pos (msg-extra "")
(left-over (and (not org-clock-resolving-clocks)
org-clock-left-over-time)))
(unless (or interrupting
org-clock-clocking-in
org-clock-resolving-clocks
(not org-clock-auto-clock-resolution))
(when (and org-clock-auto-clock-resolution
(or (not interrupting)
(eq t org-clock-auto-clock-resolution))
(not org-clock-clocking-in)
(not org-clock-resolving-clocks))
(setq org-clock-left-over-time nil)
(let ((org-clock-clocking-in t))
(org-resolve-clocks))) ; check if any clocks are dangling