Re: [O] Bug? SCHEDULED lines treated differently when text precedes them

2019-09-05 Thread Tim Cross


maybe add org-lint to the after-save-hook - maybe something like
(untested)

(add-hook 'after-save-hook (lamda ()
 (when (eq buffer-mode 'org-mode)
   (org-lint


Christoph Groth  writes:

> Nicolas Goaziou wrote:
>> Christoph Groth  writes:
>>
>> > I understand now that Org does what it should.  However, I find this
>> > behavior quite dangerous.  It caught me after more than 10 years of
>> > using Org.  If there's a list of long-term issues with Org
>> > somewhere, this problem may deserve being added to it.
>>
>> I don't think there is much to fix here. In any case, the command
>> `org-lint' warns you about this kind of error.
>
> Thanks for mentioning 'org-lint'.  I just ran it on my agenda files, and
> it found multiple errors in most of my (very long) files.  So at least
> for me (and likely for other Org users as well), the risk of missing
> TODO items is real - that's a rather serious problem for a task manager!
>
> My agenda files are populated using 'org-capture'.  Do you have
> suggestions how to best integrate org-lint transparently into everyday
> org usage?  For example, files could be linted automatically before they
> are saved, or before a new item is captured.


-- 
Tim Cross



Re: [O] Bug? SCHEDULED lines treated differently when text precedes them

2019-09-05 Thread Tim Cross


You may also find the command M-x org-lint useful. I regularly run it on
my larger org files after an org release to spot problems in my org
files (either due to my error or changes in orgmode)

Tim

Christoph Groth  writes:

> Nicolas Goaziou wrote:
>
>> Planning information (SCHEDULED, DEADLINE and CLOSED keywords) must
>> appear right after the headline, per Org syntax. This is specified at
>> the first paragraph in (info "(org) Deadlines and Scheduling").
>>
>> Elswhere, only the timestamp is meaningful to Org.
>
> Thanks for the quick clarification!  I didn't see the relevant line in
> the documentation since my Emacs from Debian shows only the info
> documentation for the (outdated) Org that is bundled with Emacs [1].
>
> I understand now that Org does what it should.  However, I find this
> behavior quite dangerous.  It caught me after more than 10 years of
> using Org.  If there's a list of long-term issues with Org somewhere,
> this problem may deserve being added to it.
>
> Cheers
> Christoph
>
> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=725408


-- 
Tim Cross



Re: [O] Bug? SCHEDULED lines treated differently when text precedes them

2019-09-05 Thread Carsten Dominik
On Thu, Sep 5, 2019 at 3:38 PM Christoph Groth 
wrote:

> Nicolas Goaziou wrote:
>
> > Planning information (SCHEDULED, DEADLINE and CLOSED keywords) must
> > appear right after the headline, per Org syntax. This is specified at
> > the first paragraph in (info "(org) Deadlines and Scheduling").
> >
> > Elswhere, only the timestamp is meaningful to Org.
>
> Thanks for the quick clarification!  I didn't see the relevant line in
> the documentation since my Emacs from Debian shows only the info
> documentation for the (outdated) Org that is bundled with Emacs [1].
>

This is, in fact, one of the very few things that did change with the
introduction of org-elements.el and the fore formal parsing of Org files.
Originally, SCHEDULED and DEADLINE could be anywhere in the entry.  But
with the development of the parser, and (I think) in order to define
everything well in particular also for the export backends, the planning
information was confined to the first line.

I don't think you need to be worried about more surprises, this was the
most significant one IIRC.

Carsten


>
> I understand now that Org does what it should.  However, I find this
> behavior quite dangerous.  It caught me after more than 10 years of
> using Org.  If there's a list of long-term issues with Org somewhere,
> this problem may deserve being added to it.
>
> Cheers
> Christoph
>
> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=725408
>
>


Re: [O] Bug? SCHEDULED lines treated differently when text precedes them

2019-09-05 Thread Christoph Groth
Nicolas Goaziou wrote:
> Christoph Groth  writes:
>
> > I understand now that Org does what it should.  However, I find this
> > behavior quite dangerous.  It caught me after more than 10 years of
> > using Org.  If there's a list of long-term issues with Org
> > somewhere, this problem may deserve being added to it.
>
> I don't think there is much to fix here. In any case, the command
> `org-lint' warns you about this kind of error.

Thanks for mentioning 'org-lint'.  I just ran it on my agenda files, and
it found multiple errors in most of my (very long) files.  So at least
for me (and likely for other Org users as well), the risk of missing
TODO items is real - that's a rather serious problem for a task manager!

My agenda files are populated using 'org-capture'.  Do you have
suggestions how to best integrate org-lint transparently into everyday
org usage?  For example, files could be linted automatically before they
are saved, or before a new item is captured.



Re: [O] Bug? SCHEDULED lines treated differently when text precedes them

2019-09-05 Thread Nicolas Goaziou
Christoph Groth  writes:

> I understand now that Org does what it should.  However, I find this
> behavior quite dangerous.  It caught me after more than 10 years of
> using Org.  If there's a list of long-term issues with Org somewhere,
> this problem may deserve being added to it.

I don't think there is much to fix here. In any case, the command
`org-lint' warns you about this kind of error.



Re: [O] Bug? SCHEDULED lines treated differently when text precedes them

2019-09-05 Thread Christoph Groth
Nicolas Goaziou wrote:

> Planning information (SCHEDULED, DEADLINE and CLOSED keywords) must
> appear right after the headline, per Org syntax. This is specified at
> the first paragraph in (info "(org) Deadlines and Scheduling").
>
> Elswhere, only the timestamp is meaningful to Org.

Thanks for the quick clarification!  I didn't see the relevant line in
the documentation since my Emacs from Debian shows only the info
documentation for the (outdated) Org that is bundled with Emacs [1].

I understand now that Org does what it should.  However, I find this
behavior quite dangerous.  It caught me after more than 10 years of
using Org.  If there's a list of long-term issues with Org somewhere,
this problem may deserve being added to it.

Cheers
Christoph

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=725408



Re: [O] Bug? SCHEDULED lines treated differently when text precedes them

2019-09-05 Thread Nicolas Goaziou
Hello,

Christoph Groth  writes:

> With Org 9.2.3, the following two TODO items behave differently:
>
> ** TODO Something
> blabla
> SCHEDULED: <2019-09-01 Sun>
> [2019-09-05 Thu 14:39]
> ** TODO Something else
> SCHEDULED: <2019-09-01 Sun>
> foobar
> [2019-09-05 Thu 14:40]
>
> The first one behaves as expected, i.e. it appears in today's
> (2019-09-05) agenda, since it's not done yet.
>
> The second one does appear in today's agenda, but it is visible for the
> day 2019-09-01.
>
> Is this behavior by design?  If yes, could someone please explain the
> rationale or point me to relevant documentation or discussions?

Planning information (SCHEDULED, DEADLINE and CLOSED keywords) must
appear right after the headline, per Org syntax. This is specified at
the first paragraph in (info "(org) Deadlines and Scheduling").

Elswhere, only the timestamp is meaningful to Org.

Regards,

-- 
Nicolas Goaziou



[O] Bug? SCHEDULED lines treated differently when text precedes them

2019-09-05 Thread Christoph Groth
Dear org mode experts,

I have noticed the following behavior that (after reading the relevant
documentation) I find at least surprising and error-prone.

With Org 9.2.3, the following two TODO items behave differently:

** TODO Something
blabla
SCHEDULED: <2019-09-01 Sun>
[2019-09-05 Thu 14:39]
** TODO Something else
SCHEDULED: <2019-09-01 Sun>
foobar
[2019-09-05 Thu 14:40]

The first one behaves as expected, i.e. it appears in today's
(2019-09-05) agenda, since it's not done yet.

The second one does appear in today's agenda, but it is visible for the
day 2019-09-01.

Is this behavior by design?  If yes, could someone please explain the
rationale or point me to relevant documentation or discussions?

Thanks!
Christoph