Bastien <[EMAIL PROTECTED]> writes:
> Bernt Hansen <[EMAIL PROTECTED]> 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
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-orgmode