* [PATCH 0/2] Clocking fixes
@ 2011-03-10 1:40 Bernt Hansen
2011-03-10 1:40 ` [PATCH 1/2] Allow setting default clocking task to current clocking task Bernt Hansen
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Bernt Hansen @ 2011-03-10 1:40 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Bernt Hansen
The following patch series fixes problems with with clocking in tasks and
setting the default clock task.
These patches are available at git://git.norang.ca/org-mode.git clock-fixes
Bernt Hansen (2):
Allow setting default clocking task to current clocking task
Allow clocking in new tasks inserted before the current clocking task
lisp/org-clock.el | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
--
1.7.4.1.208.gf7c6c
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] Allow setting default clocking task to current clocking task
2011-03-10 1:40 [PATCH 0/2] Clocking fixes Bernt Hansen
@ 2011-03-10 1:40 ` Bernt Hansen
2011-03-10 9:21 ` [Accepted] [O, " Bastien Guerry
2011-03-10 1:40 ` [PATCH 2/2] Allow clocking in new tasks inserted before the " Bernt Hansen
2011-03-10 9:36 ` [PATCH 0/2] Clocking fixes Bastien
2 siblings, 1 reply; 7+ messages in thread
From: Bernt Hansen @ 2011-03-10 1:40 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Bernt Hansen
* lisp/org-clock.el (org-clock-in): Set default clocking task when already clocking the task
The default clocking task can now be set to the current clocking task.
Previously this just threw an error stating the clock continues in the
current clocking task. The double prefix now forces setting the
default clocking task instead of forcing the user to clock out and
back in again just to set the default clocking task to the current
clocking task.
---
lisp/org-clock.el | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index c0c6c82..693025a 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -992,6 +992,7 @@ the clocking selection, associated with the letter `d'."
ts selected-task target-pos (msg-extra "")
(leftover (and (not org-clock-resolving-clocks)
org-clock-leftover-time)))
+
(when (and org-clock-auto-clock-resolution
(or (not interrupting)
(eq t org-clock-auto-clock-resolution))
@@ -1000,11 +1001,17 @@ the clocking selection, associated with the letter `d'."
(setq org-clock-leftover-time nil)
(let ((org-clock-clocking-in t))
(org-resolve-clocks))) ; check if any clocks are dangling
+
(when (equal select '(4))
(setq selected-task (org-clock-select-task "Clock-in on task: "))
(if selected-task
(setq selected-task (copy-marker selected-task))
(error "Abort")))
+
+ (when (equal select '(16))
+ ;; Mark as default clocking task
+ (org-clock-mark-default-task))
+
(when interrupting
;; We are interrupting the clocking of a different task.
;; Save a marker to this task, so that we can go back.
@@ -1028,10 +1035,6 @@ the clocking selection, associated with the letter `d'."
(let ((org-clock-clocking-in t))
(org-clock-out t)))
- (when (equal select '(16))
- ;; Mark as default clocking task
- (org-clock-mark-default-task))
-
;; Clock in at which position?
(setq target-pos
(if (and (eobp) (not (org-on-heading-p)))
--
1.7.4.1.208.gf7c6c
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Accepted] [O, 1/2] Allow setting default clocking task to current clocking task
2011-03-10 1:40 ` [PATCH 1/2] Allow setting default clocking task to current clocking task Bernt Hansen
@ 2011-03-10 9:21 ` Bastien Guerry
0 siblings, 0 replies; 7+ messages in thread
From: Bastien Guerry @ 2011-03-10 9:21 UTC (permalink / raw)
To: emacs-orgmode
Patch 668 (http://patchwork.newartisans.com/patch/668/) is now "Accepted".
Maintainer comment: none
This relates to the following submission:
http://mid.gmane.org/%3C1299721221-10196-2-git-send-email-bernt%40norang.ca%3E
Here is the original message containing the patch:
> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O,1/2] Allow setting default clocking task to current clocking task
> Date: Thu, 10 Mar 2011 06:40:20 -0000
> From: Bernt Hansen <bernt@norang.ca>
> X-Patchwork-Id: 668
> Message-Id: <1299721221-10196-2-git-send-email-bernt@norang.ca>
> To: emacs-orgmode@gnu.org
> Cc: Bernt Hansen <bernt@norang.ca>
>
> * lisp/org-clock.el (org-clock-in): Set default clocking task when already clocking the task
>
> The default clocking task can now be set to the current clocking task.
> Previously this just threw an error stating the clock continues in the
> current clocking task. The double prefix now forces setting the
> default clocking task instead of forcing the user to clock out and
> back in again just to set the default clocking task to the current
> clocking task.
>
> ---
> lisp/org-clock.el | 11 +++++++----
> 1 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> index c0c6c82..693025a 100644
> --- a/lisp/org-clock.el
> +++ b/lisp/org-clock.el
> @@ -992,6 +992,7 @@ the clocking selection, associated with the letter `d'."
> ts selected-task target-pos (msg-extra "")
> (leftover (and (not org-clock-resolving-clocks)
> org-clock-leftover-time)))
> +
> (when (and org-clock-auto-clock-resolution
> (or (not interrupting)
> (eq t org-clock-auto-clock-resolution))
> @@ -1000,11 +1001,17 @@ the clocking selection, associated with the letter `d'."
> (setq org-clock-leftover-time nil)
> (let ((org-clock-clocking-in t))
> (org-resolve-clocks))) ; check if any clocks are dangling
> +
> (when (equal select '(4))
> (setq selected-task (org-clock-select-task "Clock-in on task: "))
> (if selected-task
> (setq selected-task (copy-marker selected-task))
> (error "Abort")))
> +
> + (when (equal select '(16))
> + ;; Mark as default clocking task
> + (org-clock-mark-default-task))
> +
> (when interrupting
> ;; We are interrupting the clocking of a different task.
> ;; Save a marker to this task, so that we can go back.
> @@ -1028,10 +1035,6 @@ the clocking selection, associated with the letter `d'."
> (let ((org-clock-clocking-in t))
> (org-clock-out t)))
>
> - (when (equal select '(16))
> - ;; Mark as default clocking task
> - (org-clock-mark-default-task))
> -
> ;; Clock in at which position?
> (setq target-pos
> (if (and (eobp) (not (org-on-heading-p)))
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] Allow clocking in new tasks inserted before the current clocking task
2011-03-10 1:40 [PATCH 0/2] Clocking fixes Bernt Hansen
2011-03-10 1:40 ` [PATCH 1/2] Allow setting default clocking task to current clocking task Bernt Hansen
@ 2011-03-10 1:40 ` Bernt Hansen
2011-03-10 9:21 ` [Accepted] [O, " Bastien Guerry
2011-03-10 9:36 ` [PATCH 0/2] Clocking fixes Bastien
2 siblings, 1 reply; 7+ messages in thread
From: Bernt Hansen @ 2011-03-10 1:40 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Bernt Hansen
* lisp/org-clock.el (org-clock-in): Allow clocking in new tasks inserted
before the current clocking task
org-clock-in now checks that the name of the task you are clocking in
also matches org-clock-current-task. This allows us to insert a new
task in front of the current clocking task (with M-S-RET on the
heading of the current clocking task) and then clock in the new task.
Previously this just stated that clocking continues in the old task
since the marker point now matches the new task.
A side-effect of this change is that changing the current clocking
task headline and clocking in again will now close the current clock
and open a new entry as well as update the name of the current
clocking task in the modeline.
---
lisp/org-clock.el | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 693025a..cc0e51f 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1026,7 +1026,8 @@ the clocking selection, associated with the letter `d'."
(= (marker-position org-clock-hd-marker)
(if selected-task
(marker-position selected-task)
- (point)))))
+ (point)))
+ (equal org-clock-current-task (nth 4 (org-heading-components)))))
(message "Clock continues in \"%s\"" org-clock-heading)
(throw 'abort nil))
(move-marker org-clock-interrupted-task
--
1.7.4.1.208.gf7c6c
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Accepted] [O, 2/2] Allow clocking in new tasks inserted before the current clocking task
2011-03-10 1:40 ` [PATCH 2/2] Allow clocking in new tasks inserted before the " Bernt Hansen
@ 2011-03-10 9:21 ` Bastien Guerry
0 siblings, 0 replies; 7+ messages in thread
From: Bastien Guerry @ 2011-03-10 9:21 UTC (permalink / raw)
To: emacs-orgmode
Patch 669 (http://patchwork.newartisans.com/patch/669/) is now "Accepted".
Maintainer comment: none
This relates to the following submission:
http://mid.gmane.org/%3C1299721221-10196-3-git-send-email-bernt%40norang.ca%3E
Here is the original message containing the patch:
> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O,
> 2/2] Allow clocking in new tasks inserted before the current clocking
> task
> Date: Thu, 10 Mar 2011 06:40:21 -0000
> From: Bernt Hansen <bernt@norang.ca>
> X-Patchwork-Id: 669
> Message-Id: <1299721221-10196-3-git-send-email-bernt@norang.ca>
> To: emacs-orgmode@gnu.org
> Cc: Bernt Hansen <bernt@norang.ca>
>
> * lisp/org-clock.el (org-clock-in): Allow clocking in new tasks inserted
> before the current clocking task
>
> org-clock-in now checks that the name of the task you are clocking in
> also matches org-clock-current-task. This allows us to insert a new
> task in front of the current clocking task (with M-S-RET on the
> heading of the current clocking task) and then clock in the new task.
>
> Previously this just stated that clocking continues in the old task
> since the marker point now matches the new task.
>
> A side-effect of this change is that changing the current clocking
> task headline and clocking in again will now close the current clock
> and open a new entry as well as update the name of the current
> clocking task in the modeline.
>
> ---
> lisp/org-clock.el | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> index 693025a..cc0e51f 100644
> --- a/lisp/org-clock.el
> +++ b/lisp/org-clock.el
> @@ -1026,7 +1026,8 @@ the clocking selection, associated with the letter `d'."
> (= (marker-position org-clock-hd-marker)
> (if selected-task
> (marker-position selected-task)
> - (point)))))
> + (point)))
> + (equal org-clock-current-task (nth 4 (org-heading-components)))))
> (message "Clock continues in \"%s\"" org-clock-heading)
> (throw 'abort nil))
> (move-marker org-clock-interrupted-task
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] Clocking fixes
2011-03-10 1:40 [PATCH 0/2] Clocking fixes Bernt Hansen
2011-03-10 1:40 ` [PATCH 1/2] Allow setting default clocking task to current clocking task Bernt Hansen
2011-03-10 1:40 ` [PATCH 2/2] Allow clocking in new tasks inserted before the " Bernt Hansen
@ 2011-03-10 9:36 ` Bastien
2011-03-10 13:11 ` Bernt Hansen
2 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2011-03-10 9:36 UTC (permalink / raw)
To: Bernt Hansen; +Cc: emacs-orgmode
Hi clock-master,
Bernt Hansen <bernt@norang.ca> writes:
> The following patch series fixes problems with with clocking in tasks and
> setting the default clock task.
I've applied these two patches -- thanks for catching this. I feel
lucky that org-clock power users are also able to send patches :)
Best,
--
Bastien
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-03-10 13:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-10 1:40 [PATCH 0/2] Clocking fixes Bernt Hansen
2011-03-10 1:40 ` [PATCH 1/2] Allow setting default clocking task to current clocking task Bernt Hansen
2011-03-10 9:21 ` [Accepted] [O, " Bastien Guerry
2011-03-10 1:40 ` [PATCH 2/2] Allow clocking in new tasks inserted before the " Bernt Hansen
2011-03-10 9:21 ` [Accepted] [O, " Bastien Guerry
2011-03-10 9:36 ` [PATCH 0/2] Clocking fixes Bastien
2011-03-10 13:11 ` Bernt Hansen
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).