Nick Dokos <[email protected]> wrote:
> Gregor Zattler <[email protected]> wrote:
>
>
> > Debugger entered--Lisp error: (args-out-of-range [49569 49569 49569 39957 3=
> > 9957 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 61)
> > aref([49569 49569 49569 39957 39957 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0=
> > 0 0 0 0 0 0] 61)
>
> This tries to get the 61st element of a vector that has at most 30 or so
> elements, hence the complaint. But of course, that's hardly
> enlightening. However, the backtrace shows that this code is inside the
> function org-clock-sum (in org-clock.el). And if you look at that
> function, you see (where I have elided large swathes of code):
>
> (let* (...
> (lmax 30)
> (ltimes (make-vector lmax 0))
> ...
>
> So ltimes is a vector with *exactly* 30 elements. I would change that 30
> to 100 or so (something greater than 61 in any case) and retest. If that
> fixes it, then we know the culprit and then we can dedice which is the
> unreasonable one: the code or your subtree :-)
>
Or maybe that 61 is way off base. After all, there are only 5 non-trivial
entries in the vector.
The code that sets the level seems suspect to me:
(let* ((headline-forced
(get-text-property (point)
:org-clock-force-headline-inclusion))
(headline-included
(or (null headline-filter)
(save-excursion
(save-match-data (funcall headline-filter))))))
(setq level (- (match-end 1) (match-beginning 1)))
What do match-beginning/match-end return if headline-filter is nil?
The save-match-data is not done, so we get the results of whatever
random search was done last before this code executed.
Nick