emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] org-clock-sum: Wrong type argument: fixnump, nil [9.7-pre (release_9.6.22-1309-g8507ef @ /home/grfz/src/org-mode/lisp/)]
@ 2024-03-23 22:20 Gregor Zattler
  2024-03-24 13:27 ` Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Gregor Zattler @ 2024-03-23 22:20 UTC (permalink / raw)
  To: emacs-orgmode

Dear org-mode developers, Ihor, 

the following is with GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, cairo version 1.16.0)
 of 2024-02-27

with point on the following frame for a clock table:

#+BEGIN: clocktable :scope ("/home/absolute/path/file.org_archive")
#+END:

org-clock-report with

emacs -Q

(that is, with Org mode version 9.6.15 (release_9.6.15 @ /home/xxxx/src/emacs-master--32b4f9d21b14190f1ed1611515751abe4b90fa68--2024-02-27T09-36+01-00/lisp/org/)

produces a nice clock report table.

If instead I use a very fresh org-mode from main, specifically

Org mode version 9.7-pre (release_9.6.22-1309-g8507ef @ /home/xxxx/src/org-mode/lisp/)

like so:

emacs -L ~/src/org-mode/lisp -L ~/src/org-mode/contrib/lisp -Q

org-clock-report

with point on said frame of a clock table produces

Updating dynamic block ‘clocktable’ at line 13...
org-clock-sum: Wrong type argument: fixnump, nil


file.org_archive has 2376 clock lines.

The problem does not occur with file.org which has
only 86 clock lines.  I especially archive the nodes
with clock lines, because or performance reasons.


Doing a git bisect produced:

2e901ed23667b04642847701bae2070862b8ee6e is the first bad commit
commit 2e901ed23667b04642847701bae2070862b8ee6e
Author: Ihor Radchenko <yantar92@posteo.net>
Date:   Fri Feb 3 15:08:18 2023 +0300

    org-clock-sum: Optimize performance

    * lisp/org-clock.el (org-clock-sum): Do not re-parse the timestamps,
    reusing already-parser element.

 lisp/org-clock.el | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)


I cannot disclose said file, because it contains loads
of sensitive data.  I extracted the clock lines only,
but a single node with a LOGBOOK drawer filled with
this clock lines does not trigger the bug.  But I would
be happy to test a patch on my file.org to test it (or
help otherwise).


HTH, Gregor


^ permalink raw reply	[flat|nested] 10+ messages in thread

* 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/)]
  2024-03-23 22:20 [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-24 13:27 ` Ihor Radchenko
  2024-03-25 15:46   ` Gregor Zattler
  0 siblings, 1 reply; 10+ messages in thread
From: Ihor Radchenko @ 2024-03-24 13:27 UTC (permalink / raw)
  To: Gregor Zattler; +Cc: emacs-orgmode

Gregor Zattler <telegraph@gmx.net> writes:

> with point on the following frame for a clock table:
>
> #+BEGIN: clocktable :scope ("/home/absolute/path/file.org_archive")
> #+END:
> ...
> If instead I use a very fresh org-mode from main, specifically
>
> Org mode version 9.7-pre (release_9.6.22-1309-g8507ef @ /home/xxxx/src/org-mode/lisp/)
>
> like so:
>
> emacs -L ~/src/org-mode/lisp -L ~/src/org-mode/contrib/lisp -Q
>
> org-clock-report
>
> with point on said frame of a clock table produces
>
> Updating dynamic block ‘clocktable’ at line 13...
> org-clock-sum: Wrong type argument: fixnump, nil

What if you do the same starting from "make repro" in ~/src/org-mode ?
The backtrace should then appear rather than just an error line.
I would like to see that backtrace to understand what went wrong.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* 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/)]
  2024-03-24 13:27 ` Ihor Radchenko
@ 2024-03-25 15:46   ` Gregor Zattler
  2024-03-25 18:20     ` Ihor Radchenko
  2024-03-26 11:34     ` Max Nikulin
  0 siblings, 2 replies; 10+ messages in thread
From: Gregor Zattler @ 2024-03-25 15:46 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Hi Ihor,
* Ihor Radchenko <yantar92@posteo.net> [2024-03-24; 13:27 GMT]:
> Gregor Zattler <telegraph@gmx.net> writes:
>
>> with point on the following frame for a clock table:
>>
>> #+BEGIN: clocktable :scope ("/home/absolute/path/file.org_archive")
>> #+END:
>> ...
>> If instead I use a very fresh org-mode from main, specifically
>>
>> Org mode version 9.7-pre (release_9.6.22-1309-g8507ef @ /home/xxxx/src/org-mode/lisp/)
>>
>> like so:
>>
>> emacs -L ~/src/org-mode/lisp -L ~/src/org-mode/contrib/lisp -Q
>>
>> org-clock-report
>>
>> with point on said frame of a clock table produces
>>
>> Updating dynamic block ‘clocktable’ at line 13...
>> org-clock-sum: Wrong type argument: fixnump, nil
>
> What if you do the same starting from "make repro" in ~/src/org-mode ?
> The backtrace should then appear rather than just an error line.

I did

rm -rf *; git checkout -f; make repro

in ~/src/org-mode.  make repro is very quick.

Then I tested again with the above mentioned clock
table frame and emacs command line invocation: Same
result.  No backtrace.

Am I missing something?

> I would like to see that backtrace to understand what went wrong.

Do you have further hints how to produce this
backtrace?

Ciao; Gregor


^ permalink raw reply	[flat|nested] 10+ messages in thread

* 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/)]
  2024-03-25 15:46   ` Gregor Zattler
@ 2024-03-25 18:20     ` Ihor Radchenko
  2024-03-25 18:37       ` Gregor Zattler
  2024-03-26 11:34     ` Max Nikulin
  1 sibling, 1 reply; 10+ messages in thread
From: Ihor Radchenko @ 2024-03-25 18:20 UTC (permalink / raw)
  To: Gregor Zattler; +Cc: emacs-orgmode

Gregor Zattler <telegraph@gmx.net> writes:

> I did
>
> rm -rf *; git checkout -f; make repro
>
> in ~/src/org-mode.  make repro is very quick.
>
> Then I tested again with the above mentioned clock
> table frame and emacs command line invocation: Same
> result.  No backtrace.
>
> Am I missing something?

Looks like some caller is intercepting errors, demoting them to messages.

What happens if you run M-: (org-clock-sum) <RET> directly in the
problematic buffer?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* 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/)]
  2024-03-25 18:20     ` Ihor Radchenko
@ 2024-03-25 18:37       ` Gregor Zattler
  2024-03-26 10:27         ` Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Gregor Zattler @ 2024-03-25 18:37 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Hi Ihor,
* Ihor Radchenko <yantar92@posteo.net> [2024-03-25; 18:20 GMT]:
> Gregor Zattler <telegraph@gmx.net> writes:
>
>> I did
>>
>> rm -rf *; git checkout -f; make repro
>>
>> in ~/src/org-mode.  make repro is very quick.
>>
>> Then I tested again with the above mentioned clock
>> table frame and emacs command line invocation: Same
>> result.  No backtrace.
>>
>> Am I missing something?
>
> Looks like some caller is intercepting errors, demoting them to messages.
>
> What happens if you run M-: (org-clock-sum) <RET> directly in the
> problematic buffer?

on the clock table frame?

0 (#o0, #x0, ?\C-@)

I don't know what that means.

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)))
  (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 ... ... ... ... ... nil -1 nil)))) (te (float-time (encode-time (list 0 ... ... ... ... ... 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 ... 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 ... ...))))) (setq level (- (match-end 1) (match-beginning 1))) (if (>= level lmax) (progn (progn (setq ltimes (vconcat ltimes ...)) (setq lmax (* 2 lmax))))) (if (or (> t1 0) (> (aref ltimes level) 0)) (progn (if (or headline-included headline-forced) (progn (if headline-included ...) (setq time ...) (goto-char ...) (put-text-property ... ... ... time) (if headline-filter ...))) (setq t1 0) (let* ((l level) (--cl-var-- ...)) (while (<= l --cl-var--) (aset ltimes l 0) (setq l ...)) 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 ...))) (te (float-time (encode-time ...))) (dt (- (if tend ... te) (if tstart ... ts)))) (if (> dt 0) (progn (setq t1 (+ t1 ...)))))) ((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 ...)) (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))) (if (>= level lmax) (progn (progn (setq ltimes ...) (setq lmax ...)))) (if (or (> t1 0) (> (aref ltimes level) 0)) (progn (if (or headline-included headline-forced) (progn ... ... ... ... ...)) (setq t1 0) (let* (... ...) (while ... ... ...) 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 ...)) (te (float-time ...)) (dt (- ... ...))) (if (> dt 0) (progn (setq t1 ...))))) ((match-end 4) (setq t1 (+ t1 (string-to-number (match-string 5)) (* 60 (string-to-number ...))))) ((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 (...) (setq t1 ...)))) (let* ((headline-forced (get-text-property ... :org-clock-force-headline-inclusion)) (headline-included (or ... ...))) (setq level (- (match-end 1) (match-beginning 1))) (if (>= level lmax) (progn (progn ... ...))) (if (or (> t1 0) (> ... 0)) (progn (if ... ...) (setq t1 0) (let* ... ... nil))))))))
  (save-excursion (goto-char (point-max)) (while (re-search-backward re nil t) (let* ((element (let ((saved-match-data ...)) (unwind-protect (progn ...) (set-match-data saved-match-data t)))) (element-type (org-element-type element))) (cond ((and (eq element-type 'clock) (match-end 2)) (let* ((timestamp ...) (ts ...) (te ...) (dt ...)) (if (> dt 0) (progn ...)))) ((match-end 4) (setq t1 (+ t1 (string-to-number ...) (* 60 ...)))) ((memq element-type '(headline inlinetask)) (if (and org-clock-report-include-clocking-task (eq ... ...) (eq ... ...) tstart tend (>= ... tstart) (<= ... tend)) (progn (let ... ...))) (let* ((headline-forced ...) (headline-included ...)) (setq level (- ... ...)) (if (>= level lmax) (progn ...)) (if (or ... ...) (progn ... ... ...))))))) (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 (...) (unwind-protect ... ...))) (element-type (org-element-type element))) (cond ((and (eq element-type ...) (match-end 2)) (let* (... ... ... ...) (if ... ...))) ((match-end 4) (setq t1 (+ t1 ... ...))) ((memq element-type '...) (if (and org-clock-report-include-clocking-task ... ... tstart tend ... ...) (progn ...)) (let* (... ...) (setq level ...) (if ... ...) (if ... ...)))))) (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 ... ...)) (element-type (org-element-type element))) (cond ((and ... ...) (let* ... ...)) ((match-end 4) (setq t1 ...)) ((memq element-type ...) (if ... ...) (let* ... ... ... ...))))) (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 ...) (element-type ...)) (cond (... ...) (... ...) (... ... ...)))) (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 (... ...) (... ...) (t tstart))) (tend (cond (... ...) (... ...) (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* (... ...) (cond ... ... ...))) (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 -0x88ae3ad503f545e>)()
  #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)



seems to be somewhat truncated.  Is there a way to get
it unabbreviated?

I tried to do --eval "(setq load-suffixes '(".el"))"
...  but that gave an error.

Any other ideas, or is this already helpful?


Ciao; Gregor 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* 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/)]
  2024-03-25 18:37       ` Gregor Zattler
@ 2024-03-26 10:27         ` Ihor Radchenko
  2024-03-26 23:11           ` Gregor Zattler
  0 siblings, 1 reply; 10+ messages in thread
From: Ihor Radchenko @ 2024-03-26 10:27 UTC (permalink / raw)
  To: Gregor Zattler; +Cc: emacs-orgmode

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.

> seems to be somewhat truncated.  Is there a way to get
> it unabbreviated?

Press "." (M-x backtrace-expand-ellipses)

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* 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/)]
  2024-03-25 15:46   ` Gregor Zattler
  2024-03-25 18:20     ` Ihor Radchenko
@ 2024-03-26 11:34     ` Max Nikulin
  1 sibling, 0 replies; 10+ messages in thread
From: Max Nikulin @ 2024-03-26 11:34 UTC (permalink / raw)
  To: emacs-orgmode

On 25/03/2024 22:46, Gregor Zattler wrote:
> rm -rf *; git checkout -f

git clean -dffx

should be a bit safer. However there is still risk to lost files have 
not been committed to git.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* 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/)]
  2024-03-26 10:27         ` Ihor Radchenko
@ 2024-03-26 23:11           ` Gregor Zattler
  2024-03-27 12:00             ` Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Gregor Zattler @ 2024-03-26 23:11 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* 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/)]
  2024-03-26 23:11           ` Gregor Zattler
@ 2024-03-27 12:00             ` Ihor Radchenko
  2024-03-28  7:53               ` Gregor Zattler
  0 siblings, 1 reply; 10+ messages in thread
From: Ihor Radchenko @ 2024-03-27 12:00 UTC (permalink / raw)
  To: Gregor Zattler; +Cc: emacs-orgmode

Gregor Zattler <telegraph@gmx.net> writes:

>> 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

The parser had inconsistent handling of case-sensitivity in "CLOCK:"
keyword. Now, fixed - it should be case-insensitive.

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3f20e32f8

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* 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/)]
  2024-03-27 12:00             ` Ihor Radchenko
@ 2024-03-28  7:53               ` Gregor Zattler
  0 siblings, 0 replies; 10+ messages in thread
From: Gregor Zattler @ 2024-03-28  7:53 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Hi Ihor,
* Ihor Radchenko <yantar92@posteo.net> [2024-03-27; 12:00 GMT]:
> Gregor Zattler <telegraph@gmx.net> writes:
>
>>> 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
>
> The parser had inconsistent handling of case-sensitivity in "CLOCK:"
> keyword. Now, fixed - it should be case-insensitive.

I did not realize this glitch --although I stumbled
upon such one before.

> Fixed, on main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3f20e32f8

Thanks so much.  I confirm it works now with my file
(after finding another glitch).

Ciao, gregor


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-03-28  7:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-23 22:20 [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-24 13:27 ` Ihor Radchenko
2024-03-25 15:46   ` Gregor Zattler
2024-03-25 18:20     ` Ihor Radchenko
2024-03-25 18:37       ` Gregor Zattler
2024-03-26 10:27         ` Ihor Radchenko
2024-03-26 23:11           ` Gregor Zattler
2024-03-27 12:00             ` Ihor Radchenko
2024-03-28  7:53               ` Gregor Zattler
2024-03-26 11:34     ` Max Nikulin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).