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: Thu, 04 Oct 2007 10:57:43 -0400 Message-ID: <87zlyz0vx4.fsf@gollum.intra.norang.ca> References: <877im413y0.fsf@gollum.intra.norang.ca> <878x6krryb.fsf@bzg.ath.cx> <87ve9oyrmm.fsf@gollum.intra.norang.ca> <87zlz0qbhk.fsf@bzg.ath.cx> <87k5q4ypy1.fsf@gollum.intra.norang.ca> <877im4ezuv.fsf@bzg.ath.cx> <877im42akr.fsf@gollum.intra.norang.ca> <87myuzribz.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 1IdSw5-0000S3-GJ for emacs-orgmode@gnu.org; Thu, 04 Oct 2007 11:48:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IdSw3-0000Rr-2b for emacs-orgmode@gnu.org; Thu, 04 Oct 2007 11:48:24 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IdSw2-0000Ro-UT for emacs-orgmode@gnu.org; Thu, 04 Oct 2007 11:48:22 -0400 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IdSw2-0007Lh-FM for emacs-orgmode@gnu.org; Thu, 04 Oct 2007 11:48:22 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IdSYn-0003S6-1W for emacs-orgmode@gnu.org; Thu, 04 Oct 2007 15:24:21 +0000 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([74.119.210.211]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Oct 2007 15:24:21 +0000 Received: from bernt by cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Oct 2007 15:24:21 +0000 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: emacs-orgmode@gnu.org Bastien writes: > Bernt Hansen writes: > >> If I fold my buffer it works but if I show all of the buffer with C-c >> C-a then repeatedly run the new function it jumps back and forth between >> two points in the file (lines 335 and 365 for me - the clock marker is >> on line 365 - almost at the end of the file) > > I guess the point itself is not moving, it's just the buffer being > centered differently. Let's add recenter: > > ------------------------------------------------------------------------ > (defun org-goto-clocked-in-entry (&optional delete-windows) > "Go to the currently clocked-in entry." > (interactive "P") > (if (not (marker-buffer org-clock-marker)) > (error "No active clock")) > (switch-to-buffer-other-window > (marker-buffer org-clock-marker)) > (if delete-windows (delete-other-windows)) > (goto-char org-clock-marker) > (org-show-entry) > (org-back-to-heading) > (recenter)) > ------------------------------------------------------------------------ That seems to help. Thanks.