Re: [O] Capture - stay clocked in?

2011-03-07 Thread Bastien
Hi Bernt,

Bernt Hansen be...@norang.ca writes:

 I think this change may have changed the default for
 non :immediate-finish capture tasks as well.

 I have the following template:

 (t todo entry
   (file ~/git/org/refile.org)
   * TODO %?\n%U\n%a\n :clock-in t :clock-resume t)

 and if the clock is not running when I start capture with this template
 it stays running afterwards.  I don't think this was the intended
 behaviour.

I see.  

My first idea was to implement a new template option :immediate-refile
(or a similar name).  :immediate-finish would stick to the old behavior
(no clocking allowed) and :immediate-refile would leave the clock open.

But I thought this was potentially confusing.

What about :clock-out t, explicitely telling org-capture-finalize to
clock out when?

-- 
 Bastien



Re: [O] Capture - stay clocked in?

2011-03-07 Thread Giovanni Ridolfi
Bastien b...@altern.org writes:


 What about :clock-out t, explicitely telling org-capture-finalize to
 clock out when?

Oh, yes, please[1]!

cheers,
Giovanni

[1] http://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg00099.html



Re: [O] Capture - stay clocked in?

2011-03-07 Thread Bastien
Hi Bernt,

Bernt Hansen be...@norang.ca writes:

 I think this change may have changed the default for
 non :immediate-finish capture tasks as well.

I finally introduced a new template option :no-clock-out which, 
when set to t, will prevent the clocking-out when filing an entry.

This way the old behavior is kept, it shouldn't break current
configuration.

Thanks for bringing this up!

Best,

-- 
 Bastien



Re: [O] Capture - stay clocked in?

2011-03-07 Thread Bastien
Hi Giovanni,

Giovanni Ridolfi giovanni.rido...@yahoo.it writes:

 Bastien b...@altern.org writes:


 What about :clock-out t, explicitely telling org-capture-finalize to
 clock out when?

 Oh, yes, please[1]!

See my previous message -- I used :no-clock-out to stick to the default
behavior and avoid users to have to change their config.  Let me know if
this is okay for you!

Thanks,

-- 
 Bastien



Re: [O] Capture - stay clocked in?

2011-03-07 Thread Bernt Hansen
Bastien b...@altern.org writes:

 Bernt Hansen be...@norang.ca writes:

 I think this change may have changed the default for
 non :immediate-finish capture tasks as well.

 I finally introduced a new template option :no-clock-out which, 
 when set to t, will prevent the clocking-out when filing an entry.

 This way the old behavior is kept, it shouldn't break current
 configuration.

 Thanks for bringing this up!

Hi Bastien,

Thanks, I'll check this out today and report back if I notice any
issues.

Regards,
-- 
Bernt



Re: [O] Capture - stay clocked in?

2011-03-07 Thread Carsten Dominik

On Mar 7, 2011, at 11:26 AM, Bastien wrote:

 Hi Giovanni,
 
 Giovanni Ridolfi giovanni.rido...@yahoo.it writes:
 
 Bastien b...@altern.org writes:
 
 
 What about :clock-out t, explicitely telling org-capture-finalize to
 clock out when?
 
 Oh, yes, please[1]!
 
 See my previous message -- I used :no-clock-out to stick to the default
 behavior and avoid users to have to change their config.  Let me know if
 this is okay for you!

I like this decision, because of the templates is asked to clock
in, it seems natural for me that it will clock out when it is done.

This only suggestion I would have is it maybe call the property
:clock-keep-running.  No sure though.

Also, this new property, when set, does not allow :clock-resume,
I have not checked if something bad would happen should a user
give both by accident.

Kind regards

- Carsten



Re: [O] Capture - stay clocked in?

2011-03-07 Thread Bernt Hansen
Carsten Dominik carsten.domi...@gmail.com writes:

 On Mar 7, 2011, at 11:26 AM, Bastien wrote:

 Hi Giovanni,
 
 Giovanni Ridolfi giovanni.rido...@yahoo.it writes:
 
 Bastien b...@altern.org writes:
 
 
 What about :clock-out t, explicitely telling org-capture-finalize to
 clock out when?
 
 Oh, yes, please[1]!
 
 See my previous message -- I used :no-clock-out to stick to the default
 behavior and avoid users to have to change their config.  Let me know if
 this is okay for you!

 I like this decision, because of the templates is asked to clock
 in, it seems natural for me that it will clock out when it is done.

 This only suggestion I would have is it maybe call the property
 :clock-keep-running.  No sure though.

 Also, this new property, when set, does not allow :clock-resume,
 I have not checked if something bad would happen should a user
 give both by accident.

This probably needs to be explicitly documented on what the behaviour
is.  I think it could easily go both ways - :no-clock-out would be true
whether you resume the clock or not so we need to state what the
behaviour is explicitly.

If it doesn't make sense to have both :no-clock-out and :clock-resume
then maybe the code could check for that and issue an error/warning
when the template is selected?

Maybe use :clock-keep instead of :no-clock-out (to indicate that we keep
the clock running in this capture task?) and state that if you
use :clock-keep then :clock-resume is ignored.

I'm not sure what wording is best for this property.

Regards,
-- 
Bernt



Re: [O] Capture - stay clocked in?

2011-03-07 Thread Bastien
Hi Bernt,

Bernt Hansen be...@norang.ca writes:

 If it doesn't make sense to have both :no-clock-out and :clock-resume
 then maybe the code could check for that and issue an error/warning
 when the template is selected?

Done.

 Maybe use :clock-keep instead of :no-clock-out (to indicate that we keep
 the clock running in this capture task?) and state that if you
 use :clock-keep then :clock-resume is ignored.

I find :clock-keep to be the better choice here, I took this one.

Thanks for the feedback and the ideas!

-- 
 Bastien



Re: [O] Capture - stay clocked in?

2011-03-07 Thread Bastien
Carsten Dominik carsten.domi...@gmail.com writes:

 Also, this new property, when set, does not allow :clock-resume,
 I have not checked if something bad would happen should a user
 give both by accident.

Ah yes, thanks for bringing this up: :clock-keep has precedence 
over :clock-resume -- when both are non-nil, :clock-resume will
be discarded.   I mentioned this in the manual.

Thanks!

-- 
 Bastien



Re: [O] Capture - stay clocked in?

2011-03-07 Thread Bernt Hansen
Bastien b...@altern.org writes:

 Carsten Dominik carsten.domi...@gmail.com writes:

 Also, this new property, when set, does not allow :clock-resume,
 I have not checked if something bad would happen should a user
 give both by accident.

 Ah yes, thanks for bringing this up: :clock-keep has precedence 
 over :clock-resume -- when both are non-nil, :clock-resume will
 be discarded.   I mentioned this in the manual.

For my 't' capture template with :clock-in and :clock-resume (and
no :clock-keep) when I start capture mode for the task when the clock is
not running it stays running in that task (as reported earlier) - Isn't
that a bug?

Thanks,
-- 
Bernt



Re: [O] Capture - stay clocked in?

2011-03-07 Thread Bastien
Bernt Hansen be...@norang.ca writes:

 For my 't' capture template with :clock-in and :clock-resume (and
 no :clock-keep) when I start capture mode for the task when the clock is
 not running it stays running in that task (as reported earlier) - Isn't
 that a bug?

Is it against latest git?  (I pushed the change a bit later than I
announced it.)  

Could you share you template so that I can test?

Thanks,

-- 
 Bastien



Re: [O] Capture - stay clocked in?

2011-03-07 Thread Bernt Hansen
Bastien b...@altern.org writes:

 Bernt Hansen be...@norang.ca writes:

 For my 't' capture template with :clock-in and :clock-resume (and
 no :clock-keep) when I start capture mode for the task when the clock is
 not running it stays running in that task (as reported earlier) - Isn't
 that a bug?

 Is it against latest git?  (I pushed the change a bit later than I
 announced it.)  

 Could you share you template so that I can test?

Yes it's from Org-mode version 7.5 (release_7.5.3.g7cb08)
GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-12-11
on raven, modified by Debian

I see two problems with this capture:

 1) Clock stays running in the capture task after C-c C-c
 2) The refile.org capture buffer is narrowed hiding the newly captured
task

Here is the sequence to reproduce the problem.

Start emacs with 
--8---cut here---start-8---
$ minimal-emacs
--8---cut here---end---8---


| Key   | Notes   |
| C-c c | Start capture mode  |
| t | select TODO template|
| test clocking | give the task a heading |
| C-c C-c   | close capture template  |

The clock is still running.  If you visit the file with C-x C-f
/tmp/refile.org it looks empty because it is currently narrowed.

Regards,
Bernt

~/bin/minimal-emacs
--8---cut here---start-8---
#!/bin/sh
TESTEL=
TESTFILE=/tmp/test.el
if test -e $TESTFILE
then
  TESTEL=-l /tmp/test.el
fi
emacs -q -l ~/minimal.emacs $TESTEL $1
--8---cut here---end---8---

~/minimal.emacs
--8---cut here---start-8---
(add-to-list 'load-path (expand-file-name ~/git/org-mode/lisp))
(add-to-list 'auto-mode-alist '(\\.\\(org\\|org_archive\\|txt\\)$ . org-mode))
(require 'org-install)

(global-set-key \C-cl 'org-store-link)
(global-set-key \C-ca 'org-agenda)
(global-set-key \C-cb 'org-iswitchb)
--8---cut here---end---8---

/tmp/test.el
--8---cut here---start-8---
(setq org-capture-templates (quote ((t todo entry (file /tmp/refile.org) 
* TODO %?
%U
%a
 :clock-in t :clock-resume t
(global-set-key (kbd C-c c) 'org-capture)
--8---cut here---end---8---

-- 
Bernt



Re: [O] Capture - stay clocked in?

2011-03-07 Thread Bastien
Hi Bernt,

Bernt Hansen be...@norang.ca writes:

 I see two problems with this capture:

  1) Clock stays running in the capture task after C-c C-c

I pushed a fix for this.  

Thanks for the minimal.emacs and the detailed report.

  2) The refile.org capture buffer is narrowed hiding the newly captured
 task

Certainly a bug when refiling to empty buffers, where the check I use to
see if the buffer is already narrowed doesn't work properly.

I'll check this out.

Thanks!

-- 
 Bastien



Re: [O] Capture - stay clocked in?

2011-03-07 Thread Bernt Hansen
Bastien b...@altern.org writes:

 Bernt Hansen be...@norang.ca writes:

 I see two problems with this capture:

  1) Clock stays running in the capture task after C-c C-c

 I pushed a fix for this.  

 Thanks for the minimal.emacs and the detailed report.

Hi Bastien,

Thanks.  This works now.


  2) The refile.org capture buffer is narrowed hiding the newly captured
 task

 Certainly a bug when refiling to empty buffers, where the check I use to
 see if the buffer is already narrowed doesn't work properly.

 I'll check this out.

Great!  Thanks for all your hard work!

Regards,
-- 
Bernt



Re: [O] Capture - stay clocked in?

2011-03-06 Thread Bernt Hansen
Bastien b...@altern.org writes:

 Hi Nathan,

 Nathan Neff nathan.n...@gmail.com writes:

 Is there an option NOT to clock out of a Todo item that's
 created using org-capture?

 I assume you mean when :immediate-finish is non-nil in a capture
 template, right?

 Yes, this bugged me as well.  

 The default behavior is now (latest git) that :immediate-finish t 
 will *not* clock out the captured entry so that you can use it in
 conjunction with :clock-in.

 HTH,

Hi Bastien,

I think this change may have changed the default for
non :immediate-finish capture tasks as well.

I have the following template:

--8---cut here---start-8---
(t todo entry
  (file ~/git/org/refile.org)
  * TODO %?\n%U\n%a\n :clock-in t :clock-resume t)
--8---cut here---end---8---

and if the clock is not running when I start capture with this template
it stays running afterwards.  I don't think this was the intended
behaviour.

Let me know if you want me to try to isolate the commit that changed
this behaviour for me.

Thanks,
-- 
Bernt



Re: [O] Capture - stay clocked in?

2011-03-05 Thread Bastien
Hi Nathan,

Nathan Neff nathan.n...@gmail.com writes:

 Is there an option NOT to clock out of a Todo item that's
 created using org-capture?

I assume you mean when :immediate-finish is non-nil in a capture
template, right?

Yes, this bugged me as well.  

The default behavior is now (latest git) that :immediate-finish t 
will *not* clock out the captured entry so that you can use it in
conjunction with :clock-in.

HTH,

-- 
 Bastien



[O] Capture - stay clocked in?

2011-02-28 Thread Nathan Neff
Is there an option NOT to clock out of a Todo item that's
created using org-capture?

I would like to use capture templates to define a new TODO task, and
just stay clocked in to the new TODO.

Thanks,
--Nate

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [O] Capture - stay clocked in?

2011-02-28 Thread Bernt Hansen
Nathan Neff nathan.n...@gmail.com writes:

 Is there an option NOT to clock out of a Todo item that's
 created using org-capture?

 I would like to use capture templates to define a new TODO task, and
 just stay clocked in to the new TODO.

I don't think there is an out-of-the-box way to do this today.  You can
add a hook to org-clock-out-hook that checks if you are completing a
capture and clock that task in again.  This might work okay if you
always want to do that.

My solution to this problem is just to clock in the interrupted task
again with F9-SPC.  Capture clocks in the capture task and clocks out
when it is filed, and the following function switches the clock back to
the last (captured) task.

--8---cut here---start-8---
(global-set-key (kbd f9 SPC) 'bh/clock-in-last-task)

(defun bh/clock-in-last-task ()
  Clock in the interrupted task if there is one
Skip the default task and get the next one
  (interactive)
  (let ((clock-in-to-task (if (org-clock-is-active)
  (if (equal org-clock-default-task (cadr 
org-clock-history))
  (caddr org-clock-history)
(cadr org-clock-history))
(if (equal org-clock-default-task (car 
org-clock-history))
(cadr org-clock-history)
  (car org-clock-history)
(org-with-point-at clock-in-to-task
  (org-clock-in nil

--8---cut here---end---8---

Regards,
Bernt

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode