From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: [PATCH] Center currently clocked headline to top of screen Date: Tue, 10 Sep 2013 11:57:05 +0200 Message-ID: <86k3ipdmoe.fsf@somewhere.org> References: <861u5mgm1b.fsf@somewhere.org> <87k3jekldq.wl%n142857@gmail.com> <453005D1-8F77-413B-8DB0-FA593DC8860B@gmail.com> <86txi3mida.fsf@somewhere.org> <93522FFB-910F-4EC2-ADBF-115680FAE372@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Carsten, Carsten Dominik wrote: > On Sep 2, 2013, at 4:02 PM, Sebastien Vauban wrote: >> Carsten Dominik wrote: >>>> El Thu, 22 Aug 2013 10:36:00 +0200 Sebastien Vauban va escriure: >>>> >>>>> When jumping to the currently clocked headline (via `C-c C-x C-j'), it >>>>> seems (to me) more logical to recenter that headline at the top of the >>>>> screen (vs at the center of the screen, that is the current behavior). >>> >>>> Seeing a bit of context is nice; maybe putting it at line 2 or 3 is >>>> better than at the top and I think it is better than centered. It could >>>> also be configurable. >>> >>> Yup, I have made this a (recenter 2). Non-configurable until arrival of >>> more votes. >> >> I'd vote for (recenter 0), as: >> >> - I generally only clock on projects, and >> >> - I'm not interested by seeing the last action(s) of the previous project, >> when jumping to the currently clocking task. >> >> May I submit a patch with a configurable variable? > > Yes. Here it is! Best regards, Seb From: "Sebastien Vauban" Date: Tue, 10 Sep 2013 11:52:51 +0200 Subject: [PATCH] Add option with number of context lines before currently clocked-in entry * org-clock.el (org-clock-goto-before-context): New option. (org-clock-goto): Use that option. --- lisp/org-clock.el | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 524dbf1..c39b589 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1668,6 +1668,9 @@ Optional argument N tells to change by that many units." (message "Clock canceled") (run-hooks 'org-clock-cancel-hook)) +(defvar org-clock-goto-before-context 2 + "Number of lines of context to display before currently clocked-in entry.") + ;;;###autoload (defun org-clock-goto (&optional select) "Go to the currently clocked-in entry, or to the most recently clocked one. @@ -1691,7 +1694,7 @@ With prefix arg SELECT, offer recently clocked tasks for selection." (org-show-entry) (org-back-to-heading t) (org-cycle-hide-drawers 'children) - (recenter 2) + (recenter org-clock-goto-before-context) (org-reveal) (if recent (message "No running clock, this is the most recently clocked task")) -- 1.7.9