[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] org-clock-sum: Wrong type argument: fixnump, nil [9.7-pre (rel
From: |
Gregor Zattler |
Subject: |
Re: [BUG] org-clock-sum: Wrong type argument: fixnump, nil [9.7-pre (release_9.6.22-1309-g8507ef @ /home/grfz/src/org-mode/lisp/)] |
Date: |
Wed, 27 Mar 2024 00:11:24 +0100 |
Hi Ihor,
* Ihor Radchenko <yantar92@posteo.net> [2024-03-26; 10:27 GMT]:
> Gregor Zattler <telegraph@gmx.net> writes:
>
>> In the file.org_archive, with point on a clock line:
>>
>> Debugger entered--Lisp error: (wrong-type-argument fixnump nil)
>> encode-time((0 nil nil nil nil nil nil -1 nil))
>> (float-time (encode-time (list 0 (org-element--property :minute-start
>> timestamp nil nil) (org-element--property :hour-start timestamp nil nil)
>> (org-element--property :day-start timestamp nil nil) (org-element--property
>> :month-start timestamp nil nil) (org-element--property :year-start timestamp
>> nil nil) nil -1 nil)))
>
> This is helpful. You have some very strange timestamp.
> May you, when the backtrace window is active, press
> e (buffer-substring-no-properties (line-beginning-position -2)
> (line-end-position 3)) <RET>
> It should display text around the problematic timestamp.
>
> I'd like to see the problematic timestamp to understand what might be
> going on there.
thanks for your instructions, I edited it a bit:
" - SxxxxxII VPN vxx USB Sxxxx (xxxx)
CLOCK: [2012-02-02 Do 14:00]--[2012-02-02 Do 16:00] => 2:00
- SxxxxxII; Rxxxxxx kxxxxx, nxxxxxxxxxxxx xxxxxxxxxx
Clock: [2012-02-01 Mi 17:34]--[2012-02-01 Mi 18:24] => 0:50
- Gxxxxxxx-... #NV -Fxxxxx axxxxxxxx
CLOCK: [2012-02-01 Mi 17:04]--[2012-02-01 Mi 17:33] => 0:29"
>> seems to be somewhat truncated. Is there a way to get
>> it unabbreviated?
>
> Press "." (M-x backtrace-expand-ellipses)
this way I get:
Debugger entered--Lisp error: (wrong-type-argument fixnump nil)
encode-time((0 nil nil nil nil nil nil -1 nil))
(float-time (encode-time (list 0 (org-element--property :minute-start
timestamp nil nil) (org-element--property :hour-start timestamp nil nil)
(org-element--property :day-start timestamp nil nil) (org-element--property
:month-start timestamp nil nil) (org-element--property :year-start timestamp
nil nil) nil -1 nil)))
(let* ((timestamp (org-element--property :value element nil nil)) (ts
(float-time (encode-time (list 0 (org-element--property :minute-start timestamp
nil nil) (org-element--property :hour-start timestamp nil nil)
(org-element--property :day-start timestamp nil nil) (org-element--property
:month-start timestamp nil nil) (org-element--property :year-start timestamp
nil nil) nil -1 nil)))) (te (float-time (encode-time (list 0
(org-element--property :minute-end timestamp nil nil) (org-element--property
:hour-end timestamp nil nil) (org-element--property :day-end timestamp nil nil)
(org-element--property :month-end timestamp nil nil) (org-element--property
:year-end timestamp nil nil) nil -1 nil)))) (dt (- (if tend (min te tend) te)
(if tstart (max ts tstart) ts)))) (if (> dt 0) (progn (setq t1 (+ t1 (floor dt
60))))))
(cond ((and (eq element-type 'clock) (match-end 2)) (let* ((timestamp
(org-element--property :value element nil nil)) (ts (float-time (encode-time
(list 0 (org-element--property :minute-start timestamp nil nil)
(org-element--property :hour-start timestamp nil nil) (org-element--property
:day-start timestamp nil nil) (org-element--property :month-start timestamp nil
nil) (org-element--property :year-start timestamp nil nil) nil -1 nil)))) (te
(float-time (encode-time (list 0 (org-element--property :minute-end timestamp
nil nil) (org-element--property :hour-end timestamp nil nil)
(org-element--property :day-end timestamp nil nil) (org-element--property
:month-end timestamp nil nil) (org-element--property :year-end timestamp nil
nil) nil -1 nil)))) (dt (- (if tend (min te tend) te) (if tstart (max ts
tstart) ts)))) (if (> dt 0) (progn (setq t1 (+ t1 (floor dt 60)))))))
((match-end 4) (setq t1 (+ t1 (string-to-number (match-string 5)) (* 60
(string-to-number (match-string 4)))))) ((memq element-type '(headline
inlinetask)) (if (and org-clock-report-include-clocking-task (eq
(org-clocking-buffer) (current-buffer)) (eq (marker-position
org-clock-hd-marker) (point)) tstart tend (>= (float-time org-clock-start-time)
tstart) (<= (float-time org-clock-start-time) tend)) (progn (let ((time (floor
(org-time-convert-to-integer (time-since org-clock-start-time)) 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 (let ((saved-match-data (match-data)))
(unwind-protect (progn (funcall headline-filter)) (set-match-data
saved-match-data t))))))) (setq level (- (match-end 1) (match-beginning 1)))
(if (>= level lmax) (progn (progn (setq ltimes (vconcat ltimes (make-vector
lmax 0))) (setq lmax (* 2 lmax))))) (if (or (> t1 0) (> (aref ltimes level) 0))
(progn (if (or headline-included headline-forced) (progn (if headline-included
(let* ((l 0) (--cl-var-- level)) (while (<= l --cl-var--) (aset ltimes l (+
(aref ltimes l) t1)) (setq l (+ l 1))) nil)) (setq time (aref ltimes level))
(goto-char (match-beginning 0)) (put-text-property (point) (line-end-position)
(or propname :org-clock-minutes) time) (if headline-filter (progn
(save-excursion (let ((saved-match-data (match-data))) (unwind-protect (progn
(while (org-up-heading-safe) (put-text-property (point) (line-end-position)
:org-clock-force-headline-inclusion t))) (set-match-data saved-match-data
t)))))))) (setq t1 0) (let* ((l level) (--cl-var-- (1- lmax))) (while (<= l
--cl-var--) (aset ltimes l 0) (setq l (+ l 1))) nil))))))
(let* ((element (let ((saved-match-data (match-data))) (unwind-protect (progn
(org-element-at-point)) (set-match-data saved-match-data t)))) (element-type
(org-element-type element))) (cond ((and (eq element-type 'clock) (match-end
2)) (let* ((timestamp (org-element--property :value element nil nil)) (ts
(float-time (encode-time (list 0 (org-element--property :minute-start timestamp
nil nil) (org-element--property :hour-start timestamp nil nil)
(org-element--property :day-start timestamp nil nil) (org-element--property
:month-start timestamp nil nil) (org-element--property :year-start timestamp
nil nil) nil -1 nil)))) (te (float-time (encode-time (list 0
(org-element--property :minute-end timestamp nil nil) (org-element--property
:hour-end timestamp nil nil) (org-element--property :day-end timestamp nil nil)
(org-element--property :month-end timestamp nil nil) (org-element--property
:year-end timestamp nil nil) nil -1 nil)))) (dt (- (if tend (min te tend) te)
(if tstart (max ts tstart) ts)))) (if (> dt 0) (progn (setq t1 (+ t1 (floor dt
60))))))) ((match-end 4) (setq t1 (+ t1 (string-to-number (match-string 5)) (*
60 (string-to-number (match-string 4)))))) ((memq element-type '(headline
inlinetask)) (if (and org-clock-report-include-clocking-task (eq
(org-clocking-buffer) (current-buffer)) (eq (marker-position
org-clock-hd-marker) (point)) tstart tend (>= (float-time org-clock-start-time)
tstart) (<= (float-time org-clock-start-time) tend)) (progn (let ((time (floor
(org-time-convert-to-integer (time-since org-clock-start-time)) 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 (let ((saved-match-data (match-data)))
(unwind-protect (progn (funcall headline-filter)) (set-match-data
saved-match-data t))))))) (setq level (- (match-end 1) (match-beginning 1)))
(if (>= level lmax) (progn (progn (setq ltimes (vconcat ltimes (make-vector
lmax 0))) (setq lmax (* 2 lmax))))) (if (or (> t1 0) (> (aref ltimes level) 0))
(progn (if (or headline-included headline-forced) (progn (if headline-included
(let* ((l 0) (--cl-var-- level)) (while (<= l --cl-var--) (aset ltimes l (+
(aref ltimes l) t1)) (setq l (+ l 1))) nil)) (setq time (aref ltimes level))
(goto-char (match-beginning 0)) (put-text-property (point) (line-end-position)
(or propname :org-clock-minutes) time) (if headline-filter (progn
(save-excursion (let ((saved-match-data (match-data))) (unwind-protect (progn
(while (org-up-heading-safe) (put-text-property (point) (line-end-position)
:org-clock-force-headline-inclusion t))) (set-match-data saved-match-data
t)))))))) (setq t1 0) (let* ((l level) (--cl-var-- (1- lmax))) (while (<= l
--cl-var--) (aset ltimes l 0) (setq l (+ l 1))) nil)))))))
(while (re-search-backward re nil t) (let* ((element (let ((saved-match-data
(match-data))) (unwind-protect (progn (org-element-at-point)) (set-match-data
saved-match-data t)))) (element-type (org-element-type element))) (cond ((and
(eq element-type 'clock) (match-end 2)) (let* ((timestamp
(org-element--property :value element nil nil)) (ts (float-time (encode-time
(list 0 (org-element--property :minute-start timestamp nil nil)
(org-element--property :hour-start timestamp nil nil) (org-element--property
:day-start timestamp nil nil) (org-element--property :month-start timestamp nil
nil) (org-element--property :year-start timestamp nil nil) nil -1 nil)))) (te
(float-time (encode-time (list 0 (org-element--property :minute-end timestamp
nil nil) (org-element--property :hour-end timestamp nil nil)
(org-element--property :day-end timestamp nil nil) (org-element--property
:month-end timestamp nil nil) (org-element--property :year-end timestamp nil
nil) nil -1 nil)))) (dt (- (if tend (min te tend) te) (if tstart (max ts
tstart) ts)))) (if (> dt 0) (progn (setq t1 (+ t1 (floor dt 60)))))))
((match-end 4) (setq t1 (+ t1 (string-to-number (match-string 5)) (* 60
(string-to-number (match-string 4)))))) ((memq element-type '(headline
inlinetask)) (if (and org-clock-report-include-clocking-task (eq
(org-clocking-buffer) (current-buffer)) (eq (marker-position
org-clock-hd-marker) (point)) tstart tend (>= (float-time org-clock-start-time)
tstart) (<= (float-time org-clock-start-time) tend)) (progn (let ((time (floor
(org-time-convert-to-integer (time-since org-clock-start-time)) 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 (let ((saved-match-data (match-data)))
(unwind-protect (progn (funcall headline-filter)) (set-match-data
saved-match-data t))))))) (setq level (- (match-end 1) (match-beginning 1)))
(if (>= level lmax) (progn (progn (setq ltimes (vconcat ltimes (make-vector
lmax 0))) (setq lmax (* 2 lmax))))) (if (or (> t1 0) (> (aref ltimes level) 0))
(progn (if (or headline-included headline-forced) (progn (if headline-included
(let* ((l 0) (--cl-var-- level)) (while (<= l --cl-var--) (aset ltimes l (+
(aref ltimes l) t1)) (setq l (+ l 1))) nil)) (setq time (aref ltimes level))
(goto-char (match-beginning 0)) (put-text-property (point) (line-end-position)
(or propname :org-clock-minutes) time) (if headline-filter (progn
(save-excursion (let ((saved-match-data (match-data))) (unwind-protect (progn
(while (org-up-heading-safe) (put-text-property (point) (line-end-position)
:org-clock-force-headline-inclusion t))) (set-match-data saved-match-data
t)))))))) (setq t1 0) (let* ((l level) (--cl-var-- (1- lmax))) (while (<= l
--cl-var--) (aset ltimes l 0) (setq l (+ l 1))) nil))))))))
(save-excursion (goto-char (point-max)) (while (re-search-backward re nil t)
(let* ((element (let ((saved-match-data (match-data))) (unwind-protect (progn
(org-element-at-point)) (set-match-data saved-match-data t)))) (element-type
(org-element-type element))) (cond ((and (eq element-type 'clock) (match-end
2)) (let* ((timestamp (org-element--property :value element nil nil)) (ts
(float-time (encode-time (list 0 (org-element--property :minute-start timestamp
nil nil) (org-element--property :hour-start timestamp nil nil)
(org-element--property :day-start timestamp nil nil) (org-element--property
:month-start timestamp nil nil) (org-element--property :year-start timestamp
nil nil) nil -1 nil)))) (te (float-time (encode-time (list 0
(org-element--property :minute-end timestamp nil nil) (org-element--property
:hour-end timestamp nil nil) (org-element--property :day-end timestamp nil nil)
(org-element--property :month-end timestamp nil nil) (org-element--property
:year-end timestamp nil nil) nil -1 nil)))) (dt (- (if tend (min te tend) te)
(if tstart (max ts tstart) ts)))) (if (> dt 0) (progn (setq t1 (+ t1 (floor dt
60))))))) ((match-end 4) (setq t1 (+ t1 (string-to-number (match-string 5)) (*
60 (string-to-number (match-string 4)))))) ((memq element-type '(headline
inlinetask)) (if (and org-clock-report-include-clocking-task (eq
(org-clocking-buffer) (current-buffer)) (eq (marker-position
org-clock-hd-marker) (point)) tstart tend (>= (float-time org-clock-start-time)
tstart) (<= (float-time org-clock-start-time) tend)) (progn (let ((time (floor
(org-time-convert-to-integer (time-since org-clock-start-time)) 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 (let ((saved-match-data (match-data)))
(unwind-protect (progn (funcall headline-filter)) (set-match-data
saved-match-data t))))))) (setq level (- (match-end 1) (match-beginning 1)))
(if (>= level lmax) (progn (progn (setq ltimes (vconcat ltimes (make-vector
lmax 0))) (setq lmax (* 2 lmax))))) (if (or (> t1 0) (> (aref ltimes level) 0))
(progn (if (or headline-included headline-forced) (progn (if headline-included
(let* ((l 0) (--cl-var-- level)) (while (<= l --cl-var--) (aset ltimes l (+
(aref ltimes l) t1)) (setq l (+ l 1))) nil)) (setq time (aref ltimes level))
(goto-char (match-beginning 0)) (put-text-property (point) (line-end-position)
(or propname :org-clock-minutes) time) (if headline-filter (progn
(save-excursion (let ((saved-match-data (match-data))) (unwind-protect (progn
(while (org-up-heading-safe) (put-text-property (point) (line-end-position)
:org-clock-force-headline-inclusion t))) (set-match-data saved-match-data
t)))))))) (setq t1 0) (let* ((l level) (--cl-var-- (1- lmax))) (while (<= l
--cl-var--) (aset ltimes l 0) (setq l (+ l 1))) nil)))))))) (setq
org-clock-file-total-minutes (aref ltimes 0)))
(let* ((re (concat "^\\(\\*+\\)[ \11]\\|^[ \11]*" org-clock-string "[
\11]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[
\11]+\\([0-9]+\\):\\([0-9]+\\)\\)")) (lmax 30) (ltimes (make-vector lmax 0))
(level 0) (tstart (cond ((stringp tstart) (org-time-string-to-seconds tstart))
((consp tstart) (float-time tstart)) (t tstart))) (tend (cond ((stringp tend)
(org-time-string-to-seconds tend)) ((consp tend) (float-time tend)) (t tend)))
(t1 0) time) (remove-text-properties (point-min) (point-max) (cons (or propname
:org-clock-minutes) '(t :org-clock-force-headline-inclusion t)))
(save-excursion (goto-char (point-max)) (while (re-search-backward re nil t)
(let* ((element (let ((saved-match-data (match-data))) (unwind-protect (progn
(org-element-at-point)) (set-match-data saved-match-data t)))) (element-type
(org-element-type element))) (cond ((and (eq element-type 'clock) (match-end
2)) (let* ((timestamp (org-element--property :value element nil nil)) (ts
(float-time (encode-time (list 0 (org-element--property :minute-start timestamp
nil nil) (org-element--property :hour-start timestamp nil nil)
(org-element--property :day-start timestamp nil nil) (org-element--property
:month-start timestamp nil nil) (org-element--property :year-start timestamp
nil nil) nil -1 nil)))) (te (float-time (encode-time (list 0
(org-element--property :minute-end timestamp nil nil) (org-element--property
:hour-end timestamp nil nil) (org-element--property :day-end timestamp nil nil)
(org-element--property :month-end timestamp nil nil) (org-element--property
:year-end timestamp nil nil) nil -1 nil)))) (dt (- (if tend (min te tend) te)
(if tstart (max ts tstart) ts)))) (if (> dt 0) (progn (setq t1 (+ t1 (floor dt
60))))))) ((match-end 4) (setq t1 (+ t1 (string-to-number (match-string 5)) (*
60 (string-to-number (match-string 4)))))) ((memq element-type '(headline
inlinetask)) (if (and org-clock-report-include-clocking-task (eq
(org-clocking-buffer) (current-buffer)) (eq (marker-position
org-clock-hd-marker) (point)) tstart tend (>= (float-time org-clock-start-time)
tstart) (<= (float-time org-clock-start-time) tend)) (progn (let ((time (floor
(org-time-convert-to-integer (time-since org-clock-start-time)) 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 (let ((saved-match-data (match-data)))
(unwind-protect (progn (funcall headline-filter)) (set-match-data
saved-match-data t))))))) (setq level (- (match-end 1) (match-beginning 1)))
(if (>= level lmax) (progn (progn (setq ltimes (vconcat ltimes (make-vector
lmax 0))) (setq lmax (* 2 lmax))))) (if (or (> t1 0) (> (aref ltimes level) 0))
(progn (if (or headline-included headline-forced) (progn (if headline-included
(let* ((l 0) (--cl-var-- level)) (while (<= l --cl-var--) (aset ltimes l (+
(aref ltimes l) t1)) (setq l (+ l 1))) nil)) (setq time (aref ltimes level))
(goto-char (match-beginning 0)) (put-text-property (point) (line-end-position)
(or propname :org-clock-minutes) time) (if headline-filter (progn
(save-excursion (let ((saved-match-data (match-data))) (unwind-protect (progn
(while (org-up-heading-safe) (put-text-property (point) (line-end-position)
:org-clock-force-headline-inclusion t))) (set-match-data saved-match-data
t)))))))) (setq t1 0) (let* ((l level) (--cl-var-- (1- lmax))) (while (<= l
--cl-var--) (aset ltimes l 0) (setq l (+ l 1))) nil)))))))) (setq
org-clock-file-total-minutes (aref ltimes 0))))
(progn (let* ((re (concat "^\\(\\*+\\)[ \11]\\|^[ \11]*" org-clock-string "[
\11]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[
\11]+\\([0-9]+\\):\\([0-9]+\\)\\)")) (lmax 30) (ltimes (make-vector lmax 0))
(level 0) (tstart (cond ((stringp tstart) (org-time-string-to-seconds tstart))
((consp tstart) (float-time tstart)) (t tstart))) (tend (cond ((stringp tend)
(org-time-string-to-seconds tend)) ((consp tend) (float-time tend)) (t tend)))
(t1 0) time) (remove-text-properties (point-min) (point-max) (cons (or propname
:org-clock-minutes) '(t :org-clock-force-headline-inclusion t)))
(save-excursion (goto-char (point-max)) (while (re-search-backward re nil t)
(let* ((element (let ((saved-match-data (match-data))) (unwind-protect (progn
(org-element-at-point)) (set-match-data saved-match-data t)))) (element-type
(org-element-type element))) (cond ((and (eq element-type 'clock) (match-end
2)) (let* ((timestamp (org-element--property :value element nil nil)) (ts
(float-time (encode-time (list 0 (org-element--property :minute-start timestamp
nil nil) (org-element--property :hour-start timestamp nil nil)
(org-element--property :day-start timestamp nil nil) (org-element--property
:month-start timestamp nil nil) (org-element--property :year-start timestamp
nil nil) nil -1 nil)))) (te (float-time (encode-time (list 0
(org-element--property :minute-end timestamp nil nil) (org-element--property
:hour-end timestamp nil nil) (org-element--property :day-end timestamp nil nil)
(org-element--property :month-end timestamp nil nil) (org-element--property
:year-end timestamp nil nil) nil -1 nil)))) (dt (- (if tend (min te tend) te)
(if tstart (max ts tstart) ts)))) (if (> dt 0) (progn (setq t1 (+ t1 (floor dt
60))))))) ((match-end 4) (setq t1 (+ t1 (string-to-number (match-string 5)) (*
60 (string-to-number (match-string 4)))))) ((memq element-type '(headline
inlinetask)) (if (and org-clock-report-include-clocking-task (eq
(org-clocking-buffer) (current-buffer)) (eq (marker-position
org-clock-hd-marker) (point)) tstart tend (>= (float-time org-clock-start-time)
tstart) (<= (float-time org-clock-start-time) tend)) (progn (let ((time (floor
(org-time-convert-to-integer (time-since org-clock-start-time)) 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 (let ((saved-match-data (match-data)))
(unwind-protect (progn (funcall headline-filter)) (set-match-data
saved-match-data t))))))) (setq level (- (match-end 1) (match-beginning 1)))
(if (>= level lmax) (progn (progn (setq ltimes (vconcat ltimes (make-vector
lmax 0))) (setq lmax (* 2 lmax))))) (if (or (> t1 0) (> (aref ltimes level) 0))
(progn (if (or headline-included headline-forced) (progn (if headline-included
(let* ((l 0) (--cl-var-- level)) (while (<= l --cl-var--) (aset ltimes l (+
(aref ltimes l) t1)) (setq l (+ l 1))) nil)) (setq time (aref ltimes level))
(goto-char (match-beginning 0)) (put-text-property (point) (line-end-position)
(or propname :org-clock-minutes) time) (if headline-filter (progn
(save-excursion (let ((saved-match-data (match-data))) (unwind-protect (progn
(while (org-up-heading-safe) (put-text-property (point) (line-end-position)
:org-clock-force-headline-inclusion t))) (set-match-data saved-match-data
t)))))))) (setq t1 0) (let* ((l level) (--cl-var-- (1- lmax))) (while (<= l
--cl-var--) (aset ltimes l 0) (setq l (+ l 1))) nil)))))))) (setq
org-clock-file-total-minutes (aref ltimes 0)))))
(unwind-protect (progn (let* ((re (concat "^\\(\\*+\\)[ \11]\\|^[ \11]*"
org-clock-string "[ \11]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[
\11]+\\([0-9]+\\):\\([0-9]+\\)\\)")) (lmax 30) (ltimes (make-vector lmax 0))
(level 0) (tstart (cond ((stringp tstart) (org-time-string-to-seconds tstart))
((consp tstart) (float-time tstart)) (t tstart))) (tend (cond ((stringp tend)
(org-time-string-to-seconds tend)) ((consp tend) (float-time tend)) (t tend)))
(t1 0) time) (remove-text-properties (point-min) (point-max) (cons (or propname
:org-clock-minutes) '(t :org-clock-force-headline-inclusion t)))
(save-excursion (goto-char (point-max)) (while (re-search-backward re nil t)
(let* ((element (let ((saved-match-data (match-data))) (unwind-protect (progn
(org-element-at-point)) (set-match-data saved-match-data t)))) (element-type
(org-element-type element))) (cond ((and (eq element-type 'clock) (match-end
2)) (let* ((timestamp (org-element--property :value element nil nil)) (ts
(float-time (encode-time (list 0 (org-element--property :minute-start timestamp
nil nil) (org-element--property :hour-start timestamp nil nil)
(org-element--property :day-start timestamp nil nil) (org-element--property
:month-start timestamp nil nil) (org-element--property :year-start timestamp
nil nil) nil -1 nil)))) (te (float-time (encode-time (list 0
(org-element--property :minute-end timestamp nil nil) (org-element--property
:hour-end timestamp nil nil) (org-element--property :day-end timestamp nil nil)
(org-element--property :month-end timestamp nil nil) (org-element--property
:year-end timestamp nil nil) nil -1 nil)))) (dt (- (if tend (min te tend) te)
(if tstart (max ts tstart) ts)))) (if (> dt 0) (progn (setq t1 (+ t1 (floor dt
60))))))) ((match-end 4) (setq t1 (+ t1 (string-to-number (match-string 5)) (*
60 (string-to-number (match-string 4)))))) ((memq element-type '(headline
inlinetask)) (if (and org-clock-report-include-clocking-task (eq
(org-clocking-buffer) (current-buffer)) (eq (marker-position
org-clock-hd-marker) (point)) tstart tend (>= (float-time org-clock-start-time)
tstart) (<= (float-time org-clock-start-time) tend)) (progn (let ((time (floor
(org-time-convert-to-integer (time-since org-clock-start-time)) 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 (let ((saved-match-data (match-data)))
(unwind-protect (progn (funcall headline-filter)) (set-match-data
saved-match-data t))))))) (setq level (- (match-end 1) (match-beginning 1)))
(if (>= level lmax) (progn (progn (setq ltimes (vconcat ltimes (make-vector
lmax 0))) (setq lmax (* 2 lmax))))) (if (or (> t1 0) (> (aref ltimes level) 0))
(progn (if (or headline-included headline-forced) (progn (if headline-included
(let* ((l 0) (--cl-var-- level)) (while (<= l --cl-var--) (aset ltimes l (+
(aref ltimes l) t1)) (setq l (+ l 1))) nil)) (setq time (aref ltimes level))
(goto-char (match-beginning 0)) (put-text-property (point) (line-end-position)
(or propname :org-clock-minutes) time) (if headline-filter (progn
(save-excursion (let ((saved-match-data (match-data))) (unwind-protect (progn
(while (org-up-heading-safe) (put-text-property (point) (line-end-position)
:org-clock-force-headline-inclusion t))) (set-match-data saved-match-data
t)))))))) (setq t1 0) (let* ((l level) (--cl-var-- (1- lmax))) (while (<= l
--cl-var--) (aset ltimes l 0) (setq l (+ l 1))) nil)))))))) (setq
org-clock-file-total-minutes (aref ltimes 0))))) (if (or (not modified) (eq
modified 'autosaved)) (progn (restore-buffer-modified-p modified))))
(let* ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only
t) (inhibit-modification-hooks t)) (unwind-protect (progn (let* ((re (concat
"^\\(\\*+\\)[ \11]\\|^[ \11]*" org-clock-string "[
\11]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[
\11]+\\([0-9]+\\):\\([0-9]+\\)\\)")) (lmax 30) (ltimes (make-vector lmax 0))
(level 0) (tstart (cond ((stringp tstart) (org-time-string-to-seconds tstart))
((consp tstart) (float-time tstart)) (t tstart))) (tend (cond ((stringp tend)
(org-time-string-to-seconds tend)) ((consp tend) (float-time tend)) (t tend)))
(t1 0) time) (remove-text-properties (point-min) (point-max) (cons (or propname
:org-clock-minutes) '(t :org-clock-force-headline-inclusion t)))
(save-excursion (goto-char (point-max)) (while (re-search-backward re nil t)
(let* ((element (let ((saved-match-data (match-data))) (unwind-protect (progn
(org-element-at-point)) (set-match-data saved-match-data t)))) (element-type
(org-element-type element))) (cond ((and (eq element-type 'clock) (match-end
2)) (let* ((timestamp (org-element--property :value element nil nil)) (ts
(float-time (encode-time (list 0 (org-element--property :minute-start timestamp
nil nil) (org-element--property :hour-start timestamp nil nil)
(org-element--property :day-start timestamp nil nil) (org-element--property
:month-start timestamp nil nil) (org-element--property :year-start timestamp
nil nil) nil -1 nil)))) (te (float-time (encode-time (list 0
(org-element--property :minute-end timestamp nil nil) (org-element--property
:hour-end timestamp nil nil) (org-element--property :day-end timestamp nil nil)
(org-element--property :month-end timestamp nil nil) (org-element--property
:year-end timestamp nil nil) nil -1 nil)))) (dt (- (if tend (min te tend) te)
(if tstart (max ts tstart) ts)))) (if (> dt 0) (progn (setq t1 (+ t1 (floor dt
60))))))) ((match-end 4) (setq t1 (+ t1 (string-to-number (match-string 5)) (*
60 (string-to-number (match-string 4)))))) ((memq element-type '(headline
inlinetask)) (if (and org-clock-report-include-clocking-task (eq
(org-clocking-buffer) (current-buffer)) (eq (marker-position
org-clock-hd-marker) (point)) tstart tend (>= (float-time org-clock-start-time)
tstart) (<= (float-time org-clock-start-time) tend)) (progn (let ((time (floor
(org-time-convert-to-integer (time-since org-clock-start-time)) 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 (let ((saved-match-data (match-data)))
(unwind-protect (progn (funcall headline-filter)) (set-match-data
saved-match-data t))))))) (setq level (- (match-end 1) (match-beginning 1)))
(if (>= level lmax) (progn (progn (setq ltimes (vconcat ltimes (make-vector
lmax 0))) (setq lmax (* 2 lmax))))) (if (or (> t1 0) (> (aref ltimes level) 0))
(progn (if (or headline-included headline-forced) (progn (if headline-included
(let* ((l 0) (--cl-var-- level)) (while (<= l --cl-var--) (aset ltimes l (+
(aref ltimes l) t1)) (setq l (+ l 1))) nil)) (setq time (aref ltimes level))
(goto-char (match-beginning 0)) (put-text-property (point) (line-end-position)
(or propname :org-clock-minutes) time) (if headline-filter (progn
(save-excursion (let ((saved-match-data (match-data))) (unwind-protect (progn
(while (org-up-heading-safe) (put-text-property (point) (line-end-position)
:org-clock-force-headline-inclusion t))) (set-match-data saved-match-data
t)))))))) (setq t1 0) (let* ((l level) (--cl-var-- (1- lmax))) (while (<= l
--cl-var--) (aset ltimes l 0) (setq l (+ l 1))) nil)))))))) (setq
org-clock-file-total-minutes (aref ltimes 0))))) (if (or (not modified) (eq
modified 'autosaved)) (progn (restore-buffer-modified-p modified)))))
org-clock-sum()
eval((org-clock-sum) t)
#f(compiled-function () #<bytecode -0x929962e206d445e>)()
#f(compiled-function () #<bytecode -0x5db3e1955cb81d1>)()
eval-expression((org-clock-sum) nil nil 127)
funcall-interactively(eval-expression (org-clock-sum) nil nil 127)
command-execute(eval-expression)
HTH, Gregor
- [BUG] org-clock-sum: Wrong type argument: fixnump, nil [9.7-pre (release_9.6.22-1309-g8507ef @ /home/grfz/src/org-mode/lisp/)], Gregor Zattler, 2024/03/23
- Re: [BUG] org-clock-sum: Wrong type argument: fixnump, nil [9.7-pre (release_9.6.22-1309-g8507ef @ /home/grfz/src/org-mode/lisp/)], Ihor Radchenko, 2024/03/24
- Re: [BUG] org-clock-sum: Wrong type argument: fixnump, nil [9.7-pre (release_9.6.22-1309-g8507ef @ /home/grfz/src/org-mode/lisp/)], Gregor Zattler, 2024/03/25
- Re: [BUG] org-clock-sum: Wrong type argument: fixnump, nil [9.7-pre (release_9.6.22-1309-g8507ef @ /home/grfz/src/org-mode/lisp/)], Ihor Radchenko, 2024/03/25
- Re: [BUG] org-clock-sum: Wrong type argument: fixnump, nil [9.7-pre (release_9.6.22-1309-g8507ef @ /home/grfz/src/org-mode/lisp/)], Gregor Zattler, 2024/03/25
- Re: [BUG] org-clock-sum: Wrong type argument: fixnump, nil [9.7-pre (release_9.6.22-1309-g8507ef @ /home/grfz/src/org-mode/lisp/)], Ihor Radchenko, 2024/03/26
- Re: [BUG] org-clock-sum: Wrong type argument: fixnump, nil [9.7-pre (release_9.6.22-1309-g8507ef @ /home/grfz/src/org-mode/lisp/)],
Gregor Zattler <=
- Re: [BUG] org-clock-sum: Wrong type argument: fixnump, nil [9.7-pre (release_9.6.22-1309-g8507ef @ /home/grfz/src/org-mode/lisp/)], Ihor Radchenko, 2024/03/27
- Re: [BUG] org-clock-sum: Wrong type argument: fixnump, nil [9.7-pre (release_9.6.22-1309-g8507ef @ /home/grfz/src/org-mode/lisp/)], Gregor Zattler, 2024/03/28
- Re: [BUG] org-clock-sum: Wrong type argument: fixnump, nil [9.7-pre (release_9.6.22-1309-g8507ef @ /home/grfz/src/org-mode/lisp/)], Max Nikulin, 2024/03/26