emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bastien.guerry@wikimedia.fr>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Proposed command: org-agenda-clock-goto
Date: Sun, 01 Aug 2010 09:57:47 +0200	[thread overview]
Message-ID: <87pqy29344.fsf@gnu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]

From the agenda, I often want to jump to the currently clocking task
without leaving the agenda buffer.

The attached patch contains a function that does so.

Would that be useful to anyone else?

If so, any suggestion for a keybinding?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-agenda.el.patch --]
[-- Type: text/x-patch, Size: 731 bytes --]

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index d62b193..bba8683 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2806,6 +2806,16 @@ the global options and expect it to be applied to the entire view.")
 	(org-agenda-filter-apply org-agenda-filter))
       )))
 
+(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-mark-clocking-task ()
   "Mark the current clock entry in the agenda if it is present."
   (mapc (lambda (o)

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
 Bastien

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

             reply	other threads:[~2010-08-01 16:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-01  7:57 Bastien [this message]
2010-08-04  9:54 ` [PATCH] Proposed command: org-agenda-clock-goto Bastien
2010-08-06 14:52 ` Noorul Islam
2010-08-06 17:38   ` Bastien
2010-08-06 17:54   ` Bernt Hansen
2010-08-07  8:14     ` Bastien
2010-08-07 13:22       ` Bernt Hansen
2010-08-09  6:50       ` Carsten Dominik
2010-08-11 14:24         ` Bastien
2010-08-11 22:04           ` Carsten Dominik
2010-08-11 22:13             ` Bastien
2010-08-12  3:15               ` Noorul Islam K M
2010-08-12  8:30                 ` Bastien
2010-08-12 10:26                   ` Noorul Islam K M
2010-08-12  9:57               ` Re: [PATCH] " Carsten Dominik
2010-08-12 11:23                 ` Bernt Hansen
2010-08-12 11:34                   ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pqy29344.fsf@gnu.org \
    --to=bastien.guerry@wikimedia.fr \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).