[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: org-clock-goto plus org-narrow-to-subtree?
From: |
Bernt Hansen |
Subject: |
[Orgmode] Re: org-clock-goto plus org-narrow-to-subtree? |
Date: |
Mon, 12 Apr 2010 15:54:48 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Richard Riley <address@hidden> writes:
> Karsten Heymann <address@hidden> writes:
>
>> Hi Carsten,
>>
>> Carsten Dominik <address@hidden> 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 "<f5>") 'bh/org-todo)
| (global-set-key (kbd "<S-f5>") 'bh/widen)
| (global-set-key (kbd "<f11>") '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