From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: org-clock-goto plus org-narrow-to-subtree? Date: Mon, 12 Apr 2010 15:54:48 -0400 Message-ID: <874ojgqwdz.fsf@gollum.intra.norang.ca> References: <87fx303jnz.fsf@ara.blue-cable.net> <8739z03hr7.fsf@ara.blue-cable.net> 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 1O1Pir-0005bq-Nn for emacs-orgmode@gnu.org; Mon, 12 Apr 2010 15:55:05 -0400 Received: from [140.186.70.92] (port=42604 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1Piq-0005bX-8S for emacs-orgmode@gnu.org; Mon, 12 Apr 2010 15:55:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1Pio-0005fF-5i for emacs-orgmode@gnu.org; Mon, 12 Apr 2010 15:55:04 -0400 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:59451) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1Pin-0005dl-Ol for emacs-orgmode@gnu.org; Mon, 12 Apr 2010 15:55:02 -0400 In-Reply-To: (Richard Riley's message of "Mon\, 12 Apr 2010 16\:25\:24 +0200") 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: Richard Riley Cc: emacs-orgmode@gnu.org Richard Riley writes: > Karsten Heymann writes: > >> Hi Carsten, >> >> Carsten Dominik writes: >>> On Apr 12, 2010, at 3:05 PM, Karsten Heymann wrote: >>>> does anyone have a solution to combine org-clock-goto with >>>> org-narrow-to-subtree, so that upon keypress I get a buffer with only >>>> the currently clocked task in it? Maybe this could even become a >>>> optional parameter for org-clock-goto? >>> >>> (defun my-clock-goto-narrow () >>> (interactive) >>> (when (org-clock-is-active) >>> (org-clock-goto) >>> (org-narrow-to-subtree))) >>> >>> (define-key global-map "\C-cc" my-clock-goto-narrow) >> >> Thanks, applied. :-) > > here is a slight variation I use which lists older clocked tasks if > there is not one already clocked in. It also restores the window layout. > > ,---- > | (defun rgr/org-add-note-to-current-task () > | (interactive) > | (save-window-excursion > | (if(org-clock-is-active) > | (org-clock-goto) > | (org-clock-goto t)) > | (org-narrow-to-subtree) > | (org-add-note))) > | > | (define-key global-map "\C-cn" 'rgr/org-add-note-to-current-task) > `---- > And another variation... F11 - calls org-clock-goto (from any buffer, any mode), and goes to the last clocked task if the clock is not active. F5 - narrows to subtree and calls org-show-todo-tree to show what there is to do on that subtree. I don't combine them into a single key - since I'm used to using F5 and S-F5 to narrow and widen respectively. ,---- | (global-set-key (kbd "") 'bh/org-todo) | (global-set-key (kbd "") 'bh/widen) | (global-set-key (kbd "") 'org-clock-goto) | | (defun bh/org-todo () | (interactive) | (org-narrow-to-subtree) | (org-show-todo-tree nil)) | | (defun bh/widen () | (interactive) | (widen) | (org-reveal)) | `---- -Bernt