emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug in clocking in: the list becomes corrupted by the CLOCK drawer
@ 2009-02-09 15:04 Daniel Clemente
  2009-02-11 10:34 ` Carsten Dominik
  0 siblings, 1 reply; 12+ messages in thread
From: Daniel Clemente @ 2009-02-09 15:04 UTC (permalink / raw)
  To: emacs org-mode mailing list


  Hi, with org-mode 6.21b and since some versions ago:

---------------------------------------
* learn the alphabet
  CLOCK: [2009-01-26 dl 17:04]--[2009-01-26 dl 18:04] =>  1:00
- a
 - b
- c
 - d

---------------------------------------



   With that file, clock in that task. You will get the drawer written like this:

---------------------------------------
* learn the alphabet
  :CLOCK:
  CLOCK: [2009-02-09 dl 16:03]
  CLOCK: [2009-01-26 dl 17:04]--[2009-01-26 dl 18:04] =>  1:00
- a
 - b
   :END:
- c
 - d

---------------------------------------


  Regards,

Daniel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug in clocking in: the list becomes corrupted by the CLOCK drawer
  2009-02-09 15:04 Bug in clocking in: the list becomes corrupted by the CLOCK drawer Daniel Clemente
@ 2009-02-11 10:34 ` Carsten Dominik
  2009-02-11 11:09   ` Daniel Clemente
  2009-02-11 15:03   ` Bernt Hansen
  0 siblings, 2 replies; 12+ messages in thread
From: Carsten Dominik @ 2009-02-11 10:34 UTC (permalink / raw)
  To: Daniel Clemente; +Cc: emacs org-mode mailing list


[-- Attachment #1.1: Type: text/plain, Size: 995 bytes --]


On Feb 9, 2009, at 4:04 PM, Daniel Clemente wrote:

>
>  Hi, with org-mode 6.21b and since some versions ago:
>
> ---------------------------------------
> * learn the alphabet
>  CLOCK: [2009-01-26 dl 17:04]--[2009-01-26 dl 18:04] =>  1:00
> - a
> - b
> - c
> - d
>
> ---------------------------------------
>
>
>
>   With that file, clock in that task. You will get the drawer  
> written like this:
>
> ---------------------------------------
> * learn the alphabet
>  :CLOCK:
>  CLOCK: [2009-02-09 dl 16:03]
>  CLOCK: [2009-01-26 dl 17:04]--[2009-01-26 dl 18:04] =>  1:00
> - a
> - b
>   :END:
> - c
> - d

Hi Daniel,

this is difficult to avoid, since Org tries to incude clock notes
into the drawer, which look like items as well.

Here are your options:

1. Leave an empty line after the heading, before you list

2. The most robust may be to use

    (setq org-clock-into-drawer t)

    which will create the drawer immediately, already for
    the first clock entry.

HTH


- Carsten


[-- Attachment #1.2: Type: text/html, Size: 1599 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug in clocking in: the list becomes corrupted by the CLOCK drawer
  2009-02-11 10:34 ` Carsten Dominik
@ 2009-02-11 11:09   ` Daniel Clemente
  2009-02-11 12:21     ` Carsten Dominik
  2009-02-11 15:03   ` Bernt Hansen
  1 sibling, 1 reply; 12+ messages in thread
From: Daniel Clemente @ 2009-02-11 11:09 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs org-mode mailing list



> this is difficult to avoid, since Org tries to incude clock notes
> into the drawer, which look like items as well.

  They look like normal content except for the indentation.
  If it were like this, it would be very hard to differentiate:

---------------------------------------
* learn the alphabet
CLOCK: [2009-01-26 dl 17:04]--[2009-01-26 dl 18:04] =>  1:00
- a
- b
- c
- d

---------------------------------------


  However, it is never like that. There's always at least 1 space/tab, like in:

---------------------------------------
* learn the alphabet
 CLOCK: [2009-01-26 dl 17:04]--[2009-01-26 dl 18:04] =>  1:00
- a
- b
- c
- d

---------------------------------------

  And thus it's possible to tell where the real content starts: at the first line without indentation.


  Of course, if the user uses indentation at the first line, they will be considered part of the drawers. Something like this:

---------------------------------------
* learn the alphabet
 CLOCK: [2009-01-26 dl 17:04]--[2009-01-26 dl 18:04] =>  1:00
 - a
- b
- c
- d

---------------------------------------

  But that would probably be what the user wanted; anyway this is not the usual case.
  On the other hand, I think the second example is more usual and should work.


  Thanks,
Daniel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug in clocking in: the list becomes corrupted by the CLOCK drawer
  2009-02-11 11:09   ` Daniel Clemente
@ 2009-02-11 12:21     ` Carsten Dominik
  2009-02-11 12:24       ` Manish
  2009-02-11 13:02       ` Daniel Clemente
  0 siblings, 2 replies; 12+ messages in thread
From: Carsten Dominik @ 2009-02-11 12:21 UTC (permalink / raw)
  To: Daniel Clemente; +Cc: emacs org-mode mailing list


On Feb 11, 2009, at 12:09 PM, Daniel Clemente wrote:

>
>
>> this is difficult to avoid, since Org tries to incude clock notes
>> into the drawer, which look like items as well.
>
>  They look like normal content except for the indentation.
>  If it were like this, it would be very hard to differentiate:
>
> ---------------------------------------
> * learn the alphabet
> CLOCK: [2009-01-26 dl 17:04]--[2009-01-26 dl 18:04] =>  1:00
> - a
> - b
> - c
> - d
>
> ---------------------------------------
>
>
>  However, it is never like that. There's always at least 1 space/ 
> tab, like in:
>
> ---------------------------------------
> * learn the alphabet
> CLOCK: [2009-01-26 dl 17:04]--[2009-01-26 dl 18:04] =>  1:00
> - a
> - b
> - c
> - d
>
> ---------------------------------------
>
>  And thus it's possible to tell where the real content starts: at  
> the first line without indentation.
>
>
>  Of course, if the user uses indentation at the first line,


The true problem here is:  I am such a user. :-)

- Carsten

> they will be considered part of the drawers. Something like this:
>
> ---------------------------------------
> * learn the alphabet
> CLOCK: [2009-01-26 dl 17:04]--[2009-01-26 dl 18:04] =>  1:00
> - a
> - b
> - c
> - d
>
> ---------------------------------------
>
>  But that would probably be what the user wanted; anyway this is not  
> the usual case.
>  On the other hand, I think the second example is more usual and  
> should work.
>
>
>  Thanks,
> Daniel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug in clocking in: the list becomes corrupted by the CLOCK drawer
  2009-02-11 12:21     ` Carsten Dominik
@ 2009-02-11 12:24       ` Manish
  2009-02-11 13:02       ` Daniel Clemente
  1 sibling, 0 replies; 12+ messages in thread
From: Manish @ 2009-02-11 12:24 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs org-mode mailing list

On Wed, Feb 11, 2009 at 5:51 PM, Carsten Dominik wrote:
>
> On Feb 11, 2009, at 12:09 PM, Daniel Clemente wrote:
>
>>
>>
>>> this is difficult to avoid, since Org tries to incude clock notes
>>> into the drawer, which look like items as well.
>>
>> They look like normal content except for the indentation.
>> If it were like this, it would be very hard to differentiate:
>>
>> ---------------------------------------
>> * learn the alphabet
>> CLOCK: [2009-01-26 dl 17:04]--[2009-01-26 dl 18:04] => 1:00
>> - a
>> - b
>> - c
>> - d
>>
>> ---------------------------------------
>>
>>
>> However, it is never like that. There's always at least 1 space/tab, like
>> in:
>>
>> ---------------------------------------
>> * learn the alphabet
>> CLOCK: [2009-01-26 dl 17:04]--[2009-01-26 dl 18:04] => 1:00
>> - a
>> - b
>> - c
>> - d
>>
>> ---------------------------------------
>>
>> And thus it's possible to tell where the real content starts: at the
>> first line without indentation.
>>
>>
>> Of course, if the user uses indentation at the first line,
>
>
> The true problem here is: I am such a user. :-)

Ditto. :)

-- 
Manish

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug in clocking in: the list becomes corrupted by the CLOCK drawer
  2009-02-11 12:21     ` Carsten Dominik
  2009-02-11 12:24       ` Manish
@ 2009-02-11 13:02       ` Daniel Clemente
  2009-02-11 14:10         ` Carsten Dominik
  1 sibling, 1 reply; 12+ messages in thread
From: Daniel Clemente @ 2009-02-11 13:02 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs org-mode mailing list


>>
>>
>>  Of course, if the user uses indentation at the first line,
>
>
> The true problem here is:  I am such a user. :-)
>

  There are also users who write lists after entries... and the default behaviour is wrong for them. I don't think it's needed to change their habits and force them to write a blank line.
  I agree that it's difficult because it's not very clear where the metadata section (CLOCK/DEADLINE/SCHEDULE, drawers, …) ends.
  Maybe it can be made that: a list (of any tipe) at line beginning (no indentation) will break the metadata section and start the content section.


-- Daniel


-------
* learn the alphabet
  CLOCK: [2009-01-26 dl 17:04]--[2009-01-26 dl 18:04] =>  1:00
- a
- b
- c
- d

-------

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug in clocking in: the list becomes corrupted by the CLOCK drawer
  2009-02-11 13:02       ` Daniel Clemente
@ 2009-02-11 14:10         ` Carsten Dominik
  2009-02-12 10:49           ` Daniel Clemente
  0 siblings, 1 reply; 12+ messages in thread
From: Carsten Dominik @ 2009-02-11 14:10 UTC (permalink / raw)
  To: Daniel Clemente; +Cc: emacs org-mode mailing list


[-- Attachment #1.1: Type: text/plain, Size: 958 bytes --]


On Feb 11, 2009, at 2:02 PM, Daniel Clemente wrote:

>
>>>
>>>
>>> Of course, if the user uses indentation at the first line,
>>
>>
>> The true problem here is:  I am such a user. :-)
>>
>
>  There are also users who write lists after entries... and the  
> default behaviour is wrong for them. I don't think it's needed to  
> change their habits and force them to write a blank line.
>  I agree that it's difficult because it's not very clear where the  
> metadata section (CLOCK/DEADLINE/SCHEDULE, drawers, …) ends.
>  Maybe it can be made that: a list (of any tipe) at line beginning  
> (no indentation) will break the metadata section and start the  
> content section.


While I think it is not too much to ask to set the clock
drawer variable I mentioned earlier in order to get reliable
behavior for your application,  I guess it does not hurt to
check for smaller indentation than the clock line itself.  OK.

- Carsten

[-- Attachment #1.2: Type: text/html, Size: 1634 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug in clocking in: the list becomes corrupted by the CLOCK drawer
  2009-02-11 10:34 ` Carsten Dominik
  2009-02-11 11:09   ` Daniel Clemente
@ 2009-02-11 15:03   ` Bernt Hansen
  2009-02-11 15:18     ` Carsten Dominik
  2009-02-11 15:27     ` Bernt Hansen
  1 sibling, 2 replies; 12+ messages in thread
From: Bernt Hansen @ 2009-02-11 15:03 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs org-mode mailing list

Carsten Dominik <dominik@science.uva.nl> writes:

> Here are your options:
>
> 1. Leave an empty line after the heading, before you list
>
> 2. The most robust may be to use
>
>    (setq org-clock-into-drawer t)
>
>    which will create the drawer immediately, already for
>    the first clock entry.

Hi Carsten,

I'll change my setting from 2 to this as well.

I tried using the customize interface to set this to 't' and it
complains that it is expecting an integer.  So I set it to 1 which I
assume means the same as t in this case (I didn't check the code to
prove that though).

-Bernt

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug in clocking in: the list becomes corrupted by the CLOCK drawer
  2009-02-11 15:03   ` Bernt Hansen
@ 2009-02-11 15:18     ` Carsten Dominik
  2009-02-11 15:31       ` Bernt Hansen
  2009-02-11 15:27     ` Bernt Hansen
  1 sibling, 1 reply; 12+ messages in thread
From: Carsten Dominik @ 2009-02-11 15:18 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs org-mode mailing list


On Feb 11, 2009, at 4:03 PM, Bernt Hansen wrote:

> Carsten Dominik <dominik@science.uva.nl> writes:
>
>> Here are your options:
>>
>> 1. Leave an empty line after the heading, before you list
>>
>> 2. The most robust may be to use
>>
>>   (setq org-clock-into-drawer t)
>>
>>   which will create the drawer immediately, already for
>>   the first clock entry.
>
> Hi Carsten,
>
> I'll change my setting from 2 to this as well.
>
> I tried using the customize interface to set this to 't' and it
> complains that it is expecting an integer.  So I set it to 1 which I
> assume means the same as t in this case (I didn't check the code to
> prove that though).

No, 1 is not a valid value, that gives an error.
Hmm, it should work as you say... Does now.

Anyway, in customize, use "Value Menu" to select "Always", which
is the tag representing a t value.

- Carsten

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug in clocking in: the list becomes corrupted by the CLOCK drawer
  2009-02-11 15:03   ` Bernt Hansen
  2009-02-11 15:18     ` Carsten Dominik
@ 2009-02-11 15:27     ` Bernt Hansen
  1 sibling, 0 replies; 12+ messages in thread
From: Bernt Hansen @ 2009-02-11 15:27 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs org-mode mailing list

Bernt Hansen <bernt@norang.ca> writes:

> Carsten Dominik <dominik@science.uva.nl> writes:
>
>> Here are your options:
>>
>> 1. Leave an empty line after the heading, before you list
>>
>> 2. The most robust may be to use
>>
>>    (setq org-clock-into-drawer t)
>>
>>    which will create the drawer immediately, already for
>>    the first clock entry.
>
> Hi Carsten,
>
> I'll change my setting from 2 to this as well.
>
> I tried using the customize interface to set this to 't' and it
> complains that it is expecting an integer.  So I set it to 1 which I
> assume means the same as t in this case (I didn't check the code to
> prove that though).

Okay that doesn't work for me

I have the following setup for clocking phone calls which are started by
a remember template with :CLOCK-IN: in the text of the template

,----[ .emacs ]
| (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
| 
| (defun my-start-clock-if-needed ()
|   (save-excursion
|     (goto-char (point-min))
|     (when (re-search-forward " *:CLOCK-IN: *" nil t)
|       (replace-match "")
|       (org-clock-in))))
| 
`----

That breaks with org-clock-into-drawer set to 1 with the following error

,----
| org-clock-find-position: Wrong type argument: integer-or-marker-p, nil
`----

I don't have time to dig into this more right now so I've just reverted
back to the default for this variable.

-Bernt

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug in clocking in: the list becomes corrupted by the CLOCK drawer
  2009-02-11 15:18     ` Carsten Dominik
@ 2009-02-11 15:31       ` Bernt Hansen
  0 siblings, 0 replies; 12+ messages in thread
From: Bernt Hansen @ 2009-02-11 15:31 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs org-mode mailing list

Carsten Dominik <dominik@science.uva.nl> writes:

> On Feb 11, 2009, at 4:03 PM, Bernt Hansen wrote:
>
>> Carsten Dominik <dominik@science.uva.nl> writes:
>>
>>> Here are your options:
>>>
>>> 1. Leave an empty line after the heading, before you list
>>>
>>> 2. The most robust may be to use
>>>
>>>   (setq org-clock-into-drawer t)
>>>
>>>   which will create the drawer immediately, already for
>>>   the first clock entry.
>>
>> Hi Carsten,
>>
>> I'll change my setting from 2 to this as well.
>>
>> I tried using the customize interface to set this to 't' and it
>> complains that it is expecting an integer.  So I set it to 1 which I
>> assume means the same as t in this case (I didn't check the code to
>> prove that though).
>
> No, 1 is not a valid value, that gives an error.
> Hmm, it should work as you say... Does now.
>
> Anyway, in customize, use "Value Menu" to select "Always", which
> is the tag representing a t value.

WOW you're fast!

Okay, disregard my other message about clocking into a remember template
automatically - it works great now :)

I've set org-clock-into-drawer to 1 and it works great!  I'll try
setting it to 't' next.

Thanks alot!

Bernt

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug in clocking in: the list becomes corrupted by the CLOCK drawer
  2009-02-11 14:10         ` Carsten Dominik
@ 2009-02-12 10:49           ` Daniel Clemente
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel Clemente @ 2009-02-12 10:49 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs org-mode mailing list

Carsten Dominik <dominik@science.uva.nl> writes:
>
> While I think it is not too much to ask to set the clock
> drawer variable I mentioned earlier in order to get reliable
> behavior for your application,  I guess it does not hurt to
> check for smaller indentation than the clock line itself.  OK.
>

  Thanks, this makes the default configuration (with that variable unset) work better.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-02-12 10:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-09 15:04 Bug in clocking in: the list becomes corrupted by the CLOCK drawer Daniel Clemente
2009-02-11 10:34 ` Carsten Dominik
2009-02-11 11:09   ` Daniel Clemente
2009-02-11 12:21     ` Carsten Dominik
2009-02-11 12:24       ` Manish
2009-02-11 13:02       ` Daniel Clemente
2009-02-11 14:10         ` Carsten Dominik
2009-02-12 10:49           ` Daniel Clemente
2009-02-11 15:03   ` Bernt Hansen
2009-02-11 15:18     ` Carsten Dominik
2009-02-11 15:31       ` Bernt Hansen
2009-02-11 15:27     ` Bernt Hansen

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).