Hi Bernt, org-mode developers, * Bernt Hansen <be...@norang.ca> [05. Jan. 2012]: > Gregor Zattler <telegr...@gmx.net> writes: >> I use org-mode to record my working time. If I want to know the >> total time worked on a project I do a M-X org-clock-display. >> >> But this suddenly gives me this error message: >> >> org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 >> 0 ...], 61 >> >> I checked the org file but do not find any irregularities in the >> clock tables. I even deleted all individual `=> HH:MM' time >> ranges but this did not help.
With something like bisecting I narrowed the problem down to a few headlines consisting of subheadings, bullet lists, checkboxed lists a few inline tasks etc. All in all 253 lines of text. It looks totally harmless to me. >> This happens with emacs23.3, org-mode 6.33 as with Emacs-snapshot >> and newest org-mode so I assume it is something like a syntax >> error in my org file. In both cases I startet Emacs with -Q so this is not a configuration issue -- besides a few #+STARTUP lines at the beginning orf the org file. >> Any idea where to look for the cause of the error? > > If you generate a backtrace with uncompiled org source files you should > get an indication of where the problem is. I did as you said but the backtrace is totally opaque to me: Debugger entered--Lisp error: (args-out-of-range [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) 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) (> (aref ltimes level) 0) (or (> t1 0) (> (aref ltimes level) 0)) (if (or (> t1 0) (> (aref ltimes level) 0)) (progn (when (or headline-included headline-forced) (if headline-included (loop for l from 0 to level do (aset ltimes l (+ (aref ltimes l) t1)))) (setq time (aref ltimes level)) (goto-char (match-beginning 0)) (put-text-property (point) (point-at-eol) :org-clock-minutes time) (if headline-filter (save-excursion (save-match-data (while (> ... 1) (outline-up-heading 1 t) (put-text-property ... ... :org-clock-force-headline-inclusion t)))))) (setq t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0)))) (when (or (> t1 0) (> (aref ltimes level) 0)) (when (or headline-included headline-forced) (if headline-included (loop for l from 0 to level do (aset ltimes l (+ (aref ltimes l) t1)))) (setq time (aref ltimes level)) (goto-char (match-beginning 0)) (put-text-property (point) (point-at-eol) :org-clock-minutes time) (if headline-filter (save-excursion (save-match-data (while (> (funcall outline-level) 1) (outline-up-heading 1 t) (put-text-property (point) (point-at-eol) :org-clock-force-headline-inclusion t)))))) (setq t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0))) (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))) (when (or (> t1 0) (> (aref ltimes level) 0)) (when (or headline-included headline-forced) (if headline-included (loop for l from 0 to level do (aset ltimes l (+ (aref ltimes l) t1)))) (setq time (aref ltimes level)) (goto-char (match-beginning 0)) (put-text-property (point) (point-at-eol) :org-clock-minutes time) (if headline-filter (save-excursion (save-match-data (while (> ... 1) (outline-up-heading 1 t) (put-text-property ... ... :org-clock-force-headline-inclusion t)))))) (setq t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0)))) (cond ((match-end 2) (setq ts (match-string 2) te (match-string 3) ts (org-float-time (apply (quote encode-time) (org-parse-time-string ts))) te (org-float-time (apply (quote encode-time) (org-parse-time-string te))) ts (if tstart (max ts tstart) ts) te (if tend (min te tend) te) dt (- te ts) t1 (if (> dt 0) (+ t1 (floor (/ dt 60))) t1))) ((match-end 4) (setq t1 (+ t1 (string-to-number (match-string 5)) (* 60 (string-to-number (match-string 4)))))) (t (when (and org-clock-report-include-clocking-task (equal (org-clocking-buffer) (current-buffer)) (equal (marker-position org-clock-hd-marker) (point)) tstart tend (>= (org-float-time org-clock-start-time) tstart) (<= (org-float-time org-clock-start-time) tend)) (let ((time (floor (- ... ...) 60))) (setq t1 (+ t1 time)))) (let* ((headline-forced (get-text-property (point) :org-clock-force-headline-inclusion)) (headline-included (or (null headline-filter) (save-excursion (save-match-data ...))))) (setq level (- (match-end 1) (match-beginning 1))) (when (or (> t1 0) (> (aref ltimes level) 0)) (when (or headline-included headline-forced) (if headline-included (loop for l from 0 to level do (aset ltimes l ...))) (setq time (aref ltimes level)) (goto-char (match-beginning 0)) (put-text-property (point) (point-at-eol) :org-clock-minutes time) (if headline-filter (save-excursion (save-match-data ...)))) (setq t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0)))))) (while (re-search-backward re nil t) (cond ((match-end 2) (setq ts (match-string 2) te (match-string 3) ts (org-float-time (apply (quote encode-time) (org-parse-time-string ts))) te (org-float-time (apply (quote encode-time) (org-parse-time-string te))) ts (if tstart (max ts tstart) ts) te (if tend (min te tend) te) dt (- te ts) t1 (if (> dt 0) (+ t1 (floor (/ dt 60))) t1))) ((match-end 4) (setq t1 (+ t1 (string-to-number (match-string 5)) (* 60 (string-to-number (match-string 4)))))) (t (when (and org-clock-report-include-clocking-task (equal (org-clocking-buffer) (current-buffer)) (equal (marker-position org-clock-hd-marker) (point)) tstart tend (>= (org-float-time org-clock-start-time) tstart) (<= (org-float-time org-clock-start-time) tend)) (let ((time (floor ... 60))) (setq t1 (+ t1 time)))) (let* ((headline-forced (get-text-property (point) :org-clock-force-headline-inclusion)) (headline-included (or (null headline-filter) (save-excursion ...)))) (setq level (- (match-end 1) (match-beginning 1))) (when (or (> t1 0) (> (aref ltimes level) 0)) (when (or headline-included headline-forced) (if headline-included (loop for l from 0 to level do ...)) (setq time (aref ltimes level)) (goto-char (match-beginning 0)) (put-text-property (point) (point-at-eol) :org-clock-minutes time) (if headline-filter (save-excursion ...))) (setq t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0))))))) (save-excursion (goto-char (point-max)) (while (re-search-backward re nil t) (cond ((match-end 2) (setq ts (match-string 2) te (match-string 3) ts (org-float-time (apply (quote encode-time) (org-parse-time-string ts))) te (org-float-time (apply (quote encode-time) (org-parse-time-string te))) ts (if tstart (max ts tstart) ts) te (if tend (min te tend) te) dt (- te ts) t1 (if (> dt 0) (+ t1 (floor ...)) t1))) ((match-end 4) (setq t1 (+ t1 (string-to-number (match-string 5)) (* 60 (string-to-number ...))))) (t (when (and org-clock-report-include-clocking-task (equal (org-clocking-buffer) (current-buffer)) (equal (marker-position org-clock-hd-marker) (point)) tstart tend (>= (org-float-time org-clock-start-time) tstart) (<= (org-float-time org-clock-start-time) tend)) (let ((time ...)) (setq t1 (+ t1 time)))) (let* ((headline-forced (get-text-property ... :org-clock-force-headline-inclusion)) (headline-included (or ... ...))) (setq level (- (match-end 1) (match-beginning 1))) (when (or (> t1 0) (> ... 0)) (when (or headline-included headline-forced) (if headline-included ...) (setq time ...) (goto-char ...) (put-text-property ... ... :org-clock-minutes time) (if headline-filter ...)) (setq t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0))))))) (setq org-clock-file-total-minutes (aref ltimes 0))) (let* ((bmp (buffer-modified-p)) (re (concat "^\\(\\*+\\)[ ]\\|^[ ]*" org-clock-string "[ ]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[ ]+\\([0-9]+\\):\\([0-9]+\\)\\)")) (lmax 30) (ltimes (make-vector lmax 0)) (t1 0) (level 0) ts te dt time) (if (stringp tstart) (setq tstart (org-time-string-to-seconds tstart))) (if (stringp tend) (setq tend (org-time-string-to-seconds tend))) (if (consp tstart) (setq tstart (org-float-time tstart))) (if (consp tend) (setq tend (org-float-time tend))) (remove-text-properties (point-min) (point-max) (quote (:org-clock-minutes t :org-clock-force-headline-inclusion t))) (save-excursion (goto-char (point-max)) (while (re-search-backward re nil t) (cond ((match-end 2) (setq ts (match-string 2) te (match-string 3) ts (org-float-time (apply ... ...)) te (org-float-time (apply ... ...)) ts (if tstart (max ts tstart) ts) te (if tend (min te tend) te) dt (- te ts) t1 (if (> dt 0) (+ t1 ...) t1))) ((match-end 4) (setq t1 (+ t1 (string-to-number ...) (* 60 ...)))) (t (when (and org-clock-report-include-clocking-task (equal ... ...) (equal ... ...) tstart tend (>= ... tstart) (<= ... tend)) (let (...) (setq t1 ...))) (let* ((headline-forced ...) (headline-included ...)) (setq level (- ... ...)) (when (or ... ...) (when ... ... ... ... ... ...) (setq t1 0) (loop for l from level to ... do ...)))))) (setq org-clock-file-total-minutes (aref ltimes 0))) (set-buffer-modified-p bmp)) org-clock-sum() (let (time h m p) (org-clock-sum) (unless total-only (save-excursion (goto-char (point-min)) (while (or (and (equal (setq p ...) (point-min)) (get-text-property p :org-clock-minutes)) (setq p (next-single-property-change (point) :org-clock-minutes))) (goto-char p) (when (setq time (get-text-property p :org-clock-minutes)) (org-clock-put-overlay time (funcall outline-level)))) (setq h (/ org-clock-file-total-minutes 60) m (- org-clock-file-total-minutes (* 60 h))) (when org-remove-highlights-with-change (org-add-hook (quote before-change-functions) (quote org-clock-remove-overlays) nil (quote local))))) (if org-time-clocksum-use-fractional (message (concat "Total file time: " org-time-clocksum-fractional-format " (%d hours and %d minutes)") (/ (+ (* h 60.0) m) 60.0) h m) (message (concat "Total file time: " org-time-clocksum-format " (%d hours and %d minutes)") h m h m))) org-clock-display() call-interactively(org-clock-display t nil) execute-extended-command(nil) call-interactively(execute-extended-command nil nil) Any further ideas what to try next? Ciao, Gregor -- -... --- .-. . -.. ..--.. ...-.-