emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: Wishlist - Function to get to and reveal the current clock


From: Bernt Hansen
Subject: [Orgmode] Re: Wishlist - Function to get to and reveal the current clocking task
Date: Wed, 03 Oct 2007 14:34:09 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Bastien <address@hidden> writes:

> Bernt Hansen <address@hidden> writes:
>
>> I'd love a function I could bind to a single key press to do this.
>>
>> I know org-clock-marker points at the current location I want to get to
>> - I just don't know how to use it to get there and reveal the location
>> the same as if I used the above procedure from the agenda.
>
> Something like this?
>
> (defun org-goto-clocked-in-entry ()
>   "Go to the currently clocked-in entry."
>   (interactive)
>   (goto-char org-clock-marker)
>   (org-show-entry)
>   (org-back-to-heading))

Close :) My first attempt to code this failed miserably.

Your version doesn't handle switching files/buffers.  I also got the
'before first heading' error from your version when not in an org buffer
... so I hacked at it and this is what I have now:

(defun org-goto-clocked-in-entry ()
  "Go to the currently clocked-in entry."
  (interactive)
  (if (not (marker-buffer org-clock-marker))
      (error "No active clock"))
  (display-buffer (marker-buffer org-clock-marker))
  (goto-char org-clock-marker)
  (org-show-entry)
  (org-back-to-heading))

This is closer but still not right.

If I'm in another buffer it splits the window and displays the right
stuff in the other buffer - I just need to close the current window.

My Emacs lisp skills are sadly lacking :(

Thanks!
Bernt




reply via email to

[Prev in Thread] Current Thread [Next in Thread]