From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Wishlist - Function to get to and reveal the current clocking task Date: Wed, 03 Oct 2007 14:34:09 -0400 Message-ID: <87ve9oyrmm.fsf@gollum.intra.norang.ca> References: <877im413y0.fsf@gollum.intra.norang.ca> <878x6krryb.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Id938-0005oN-1J for emacs-orgmode@gnu.org; Wed, 03 Oct 2007 14:34:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Id936-0005mr-CX for emacs-orgmode@gnu.org; Wed, 03 Oct 2007 14:34:21 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Id936-0005mn-2L for emacs-orgmode@gnu.org; Wed, 03 Oct 2007 14:34:20 -0400 Received: from outbound.mailhop.org ([63.208.196.171]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Id935-0001tS-PU for emacs-orgmode@gnu.org; Wed, 03 Oct 2007 14:34:19 -0400 In-Reply-To: <878x6krryb.fsf@bzg.ath.cx> (Bastien's message of "Wed\, 03 Oct 2007 19\:09\:00 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: emacs-orgmode@gnu.org Bastien writes: > Bernt Hansen 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