From: Bernt Hansen <bernt@norang.ca>
To: Richard Riley <rileyrgdev@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-clock-goto plus org-narrow-to-subtree?
Date: Mon, 12 Apr 2010 15:54:48 -0400 [thread overview]
Message-ID: <874ojgqwdz.fsf@gollum.intra.norang.ca> (raw)
In-Reply-To: <m3nb97-l0q.ln1@news.eternal-september.org> (Richard Riley's message of "Mon\, 12 Apr 2010 16\:25\:24 +0200")
Richard Riley <rileyrgdev@gmail.com> writes:
> Karsten Heymann <karsten.heymann@blue-cable.net> writes:
>
>> Hi Carsten,
>>
>> Carsten Dominik <carsten.dominik@gmail.com> 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
prev parent reply other threads:[~2010-04-12 19:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-12 13:05 org-clock-goto plus org-narrow-to-subtree? Karsten Heymann
2010-04-12 13:33 ` Carsten Dominik
2010-04-12 13:47 ` Karsten Heymann
2010-04-12 14:25 ` Richard Riley
2010-04-12 19:54 ` Bernt Hansen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874ojgqwdz.fsf@gollum.intra.norang.ca \
--to=bernt@norang.ca \
--cc=emacs-orgmode@gnu.org \
--cc=rileyrgdev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).