summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2010-08-06 19:28:08 +0200
committerBastien Guerry <bzg@altern.org>2010-08-06 19:28:08 +0200
commit5b85810f4d8af0e9324a31c4ed8276d15ea54575 (patch)
tree48196c33dc6e697bfbc17cc4d6e9cc86144731e9
parent5236e0ea313cb294a01e1a7538160cfa8b586928 (diff)
downloadorg-mode-5b85810f4d8af0e9324a31c4ed8276d15ea54575.tar.gz
New command: `org-agenda-clock-goto' (C-c C-x C-j)
This command jumps to the headline of the clocking task within the agenda buffer. `org-agenda-clock-goto' is bound to `C-c C-x C-j'. It is different from `org-clock-goto', which jumps to the currently clocking entry itself (bound to `J').
-rw-r--r--lisp/org-agenda.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index d62b193..13ec64f 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1650,7 +1650,7 @@ The following commands are available:
(org-defkey org-agenda-mode-map "O" 'org-agenda-clock-out)
(org-defkey org-agenda-mode-map "\C-c\C-x\C-x" 'org-agenda-clock-cancel)
(org-defkey org-agenda-mode-map "X" 'org-agenda-clock-cancel)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-j" 'org-clock-goto)
+(org-defkey org-agenda-mode-map "\C-c\C-x\C-j" 'org-agenda-clock-goto)
(org-defkey org-agenda-mode-map "J" 'org-clock-goto)
(org-defkey org-agenda-mode-map "+" 'org-agenda-priority-up)
(org-defkey org-agenda-mode-map "-" 'org-agenda-priority-down)
@@ -7090,6 +7090,16 @@ The cursor may be at a date in the calendar, or in the Org agenda."
(org-with-remote-undo (marker-buffer org-clock-marker)
(org-clock-cancel)))
+(defun org-agenda-clock-goto ()
+ "Jump to the currently clocked in task within the agenda."
+ (interactive)
+ (let (pos)
+ (mapc (lambda (o)
+ (if (eq (overlay-get o 'type) 'org-agenda-clocking)
+ (setq pos (overlay-start o))))
+ (overlays-in (point-min) (point-max)))
+ (if pos (goto-char pos))))
+
(defun org-agenda-diary-entry-in-org-file ()
"Make a diary entry in the file `org-agenda-diary-file'."
(let (d1 d2 char (text "") dp1 dp2)