Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some dates throw agenda time grid way off (errors) #48

Open
progo opened this issue Sep 5, 2012 · 3 comments
Open

Some dates throw agenda time grid way off (errors) #48

progo opened this issue Sep 5, 2012 · 3 comments

Comments

@progo
Copy link

progo commented Sep 5, 2012

Encountered issues with a date. Small test case:

* bug is supposed to be here.
** with any random text
   :<2012-09-05 Wed 14:07>

Running ,aga (agenda for current week) will throw following errors (split
some of the lines for readability):

Error detected while processing function OrgAgendaDashboard..
    <SNR>80_RunCustom..OrgRunAgenda..<SNR>80_DateDictToScreen..
    <SNR>80_PlaceTimeGrid:
line    8:
E684: list index out of range: 8
E116: Invalid arguments for function matchstr(lines[i],'\%24c\d\d:\d\d') &&
    i < len(lines))
E15: Invalid expression: (matchstr(lines[i],'\%24c\d\d:\d\d') &&
    i < len(lines))

As the date looks perfectly normal (org-capture) I'm pretty confused about
this.

@hsitz
Copy link
Owner

hsitz commented Sep 5, 2012

On Wed, Sep 5, 2012 at 7:56 AM, Mikael [email protected] wrote:

Encountered issues with a date. Small test case:

  • bug is supposed to be here.
    ** with any random text
    :<2012-09-05 Wed 14:07>

[. . . ]

As the date looks perfectly normal (org-capture) I'm pretty confused about

this.

Mikael --

You're right, that does seem strange. I haven't seen anything like that
before, but it's easily reproducible and it should be easy to track down,
I'll take a look at it later today.

Thanks,

Herb

@hsitz
Copy link
Owner

hsitz commented Sep 5, 2012

On Wed, Sep 5, 2012 at 7:56 AM, Mikael [email protected] wrote:

Error detected while processing function OrgAgendaDashboard..
80_RunCustom..OrgRunAgenda..80_DateDictToScreen..
80_PlaceTimeGrid: line 8: E684: list index out of range: 8 E116:
Invalid arguments for function matchstr(lines[i],'%24c\d\d:\d\d') && i <
len(lines)) E15: Invalid expression: (matchstr(lines[i],'%24c\d\d:\d\d')
&& i < len(lines))

As the date looks perfectly normal (org-capture) I'm pretty confused about
this.

Mikael --

Turns out the error is when you're specifying times as well as date, occurs
in current day (or any day with time events if you're doing single day view
in agenda) and timegrid function is on (which it is by default).

The error message was pretty spot on, it looks like it was misordered
conditions in the while statement, since the first condition is intended to
short-circuit the 'AND' and exit the while loop.

Changing the while statement in PlaceTimeGrid function to this should fix
it:

    while ((i < len(lines)) && matchstr(lines[i],'\%24c\d\d:\d\d') )

Please let me know if that does indeed fix the problem.

Regards,

Herb

@progo
Copy link
Author

progo commented Sep 5, 2012

On Wed, Sep 5, 2012 at 9:30 PM, hsitz [email protected] wrote:

On Wed, Sep 5, 2012 at 7:56 AM, Mikael [email protected] wrote:

Error detected while processing function OrgAgendaDashboard..
80_RunCustom..OrgRunAgenda..80_DateDictToScreen..
80_PlaceTimeGrid: line 8: E684: list index out of range: 8 E116:
Invalid arguments for function matchstr(lines[i],'%24c\d\d:\d\d') && i <
len(lines)) E15: Invalid expression: (matchstr(lines[i],'%24c\d\d:\d\d')
&& i < len(lines))

As the date looks perfectly normal (org-capture) I'm pretty confused about
this.

Mikael --

Turns out the error is when you're specifying times as well as date, occurs
in current day (or any day with time events if you're doing single day view
in agenda) and timegrid function is on (which it is by default).

The error message was pretty spot on, it looks like it was misordered
conditions in the while statement, since the first condition is intended to
short-circuit the 'AND' and exit the while loop.

Changing the while statement in PlaceTimeGrid function to this should fix
it:

while ((i < len(lines)) && matchstr(lines[i],'%24c\d\d:\d\d') )

Please let me know if that does indeed fix the problem.

Regards,

Herb


Reply to this email directly or view it on GitHub.

Yes, that change did indeed fix the minimal test org and my greater org
files as well.

Thank you for quick respoonse on the matter.

  • Mike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants