ichernyshovvv / org-timeblock

Schedule your day visually, using timeblocking technique inside Emacs
GNU General Public License v3.0
275 stars 18 forks source link

Wrong type argument: integer-or-marker-p #39

Closed vikram-mandyam closed 8 months ago

vikram-mandyam commented 9 months ago

When I run org-timeblock I get the following error:

Wrong type argument: integer-or-marker-p, (headline (:raw-value "The Case of the Dead Russian Spy by Owen Parr" :begin 71508 :end 71724 :pre-blank 0 :contents-begin 71564 ...))

I am on Emacs 28.2 and Org mode version 9.5.5.

Below is the stacktrace:

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p (headline (:raw-value "The Case of the Dead Russian Spy by Owen Parr" :begin 71508 :end 71604 :pre-blank 0 :contents-begin 71564 :contents-end 71603 :level 4 :priority nil :tags nil :todo-keyword #("TODO" 0 4 (face (org-todo org-level-4) wrap-prefix #("******* " 0 8 (face org-indent)) line-prefix #("***" 0 3 (face org-indent)) org-category "gtd" fontified t)) :todo-type todo :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 71508 :scheduled (timestamp (:type active :raw-value "<2023-12-13 Wed 18:00 .+1d>" :year-start 2023 :month-start 12 :day-start 13 :hour-start 18 :minute-start 0 :year-end 2023 :month-end 12 :day-end 13 :hour-end 18 :minute-end 0 :begin 71575 :end 71602 :post-blank 0 :repeater-type restart :repeater-value 1 :repeater-unit day)) :title "The Case of the Dead Russian Spy by Owen Parr")))
  org-get-tags((headline (:raw-value "The Case of the Dead Russian Spy by Owen Parr" :begin 71508 :end 71604 :pre-blank 0 :contents-begin 71564 :contents-end 71603 :level 4 :priority nil :tags nil :todo-keyword #("TODO" 0 4 (face (org-todo org-level-4) wrap-prefix #("******* " 0 8 (face org-indent)) line-prefix #("***" 0 3 (face org-indent)) org-category "gtd" fontified t)) :todo-type todo :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 71508 :scheduled (timestamp (:type active :raw-value "<2023-12-13 Wed 18:00 .+1d>" :year-start 2023 :month-start 12 :day-start 13 :hour-start 18 :minute-start 0 :year-end 2023 :month-end 12 :day-end 13 :hour-end 18 :minute-end 0 :begin 71575 :end 71602 :post-blank 0 :repeater-type restart :repeater-value 1 :repeater-unit day)) :title "The Case of the Dead Russian Spy by Owen Parr")))
  (mapcar #'substring-no-properties (org-get-tags (org-element-at-point)))
  (let ((title (org-get-heading t nil t t)) (sched (org-element-property :scheduled (org-element-at-point))) (event (org-timeblock-get-event-timestamp)) (marker (copy-marker (point) t)) (tags (mapcar #'substring-no-properties (org-get-tags (org-element-at-point))))) (cons (if event (progn (propertize (concat (org-timeblock--construct-entry-prefix event t) title) 'event event 'marker marker 'tags tags 'id (org-timeblock-construct-id nil t) 'title title))) (if sched (progn (propertize (concat (org-timeblock--construct-entry-prefix sched) title) 'sched sched 'marker marker 'tags tags 'id (org-timeblock-construct-id) 'title title)))))
  (closure ((files "~/somefolder/inbox.org" "~/somefolder/gtd.org" "~/somefolder/tickler.org" "~/somefolder/Birthdays.org" "~/somefolder/meetings.org") (with-time) (exclude-dateranges) (sort-func) (--cl-rest--) org-timeblock-list-mode-abbrev-table org-timeblock-list-mode-syntax-table org-timeblock-mode-abbrev-table org-timeblock-mode-syntax-table t) nil (let ((title (org-get-heading t nil t t)) (sched (org-element-property :scheduled (org-element-at-point))) (event (org-timeblock-get-event-timestamp)) (marker (copy-marker (point) t)) (tags (mapcar #'substring-no-properties (org-get-tags (org-element-at-point))))) (cons (if event (progn (propertize (concat (org-timeblock--construct-entry-prefix event t) title) 'event event 'marker marker 'tags tags 'id (org-timeblock-construct-id nil t) 'title title))) (if sched (progn (propertize (concat (org-timeblock--construct-entry-prefix sched) title) 'sched sched 'marker marker 'tags tags 'id (org-timeblock-construct-id) 'title title))))))()
  org-ql--select(:query (and (not (done)) (and (not (done)) (org-timeblock-active-ts #s(ts :hour nil :minute nil :second nil :day 13 :month 12 :year 2023 :dow nil :day-abbr nil :day-name nil :doy nil :woy nil :month-abbr nil :month-name nil :tz-abbr nil :tz-offset nil :internal nil :unix 1702459262.686986) #s(ts :hour nil :minute nil :second nil :day 13 :month 12 :year 2023 :dow nil :day-abbr nil :day-name nil :doy nil :woy nil :month-abbr nil :month-name nil :tz-abbr nil :tz-offset nil :internal nil :unix 1702459262.0) :exclude-dateranges nil :with-time nil))) :preamble "<\\([[:digit:]]\\{4\\}-[[:digit:]]\\{2\\}-[[:digit:]]\\{..." :preamble-case-fold nil :predicate #f(compiled-function () #<bytecode 0xda52764258dafb8>) :action (closure ((files "~/somefolder/inbox.org" "~/somefolder/gtd.org" "~/somefolder/tickler.org" "~/somefolder/Birthdays.org" "~/somefolder/meetings.org") (with-time) (exclude-dateranges) (sort-func) (--cl-rest--) org-timeblock-list-mode-abbrev-table org-timeblock-list-mode-syntax-table org-timeblock-mode-abbrev-table org-timeblock-mode-syntax-table t) nil (let ((title (org-get-heading t nil t t)) (sched (org-element-property :scheduled (org-element-at-point))) (event (org-timeblock-get-event-timestamp)) (marker (copy-marker (point) t)) (tags (mapcar #'substring-no-properties (org-get-tags (org-element-at-point))))) (cons (if event (progn (propertize (concat ... title) 'event event 'marker marker 'tags tags 'id (org-timeblock-construct-id nil t) 'title title))) (if sched (progn (propertize (concat ... title) 'sched sched 'marker marker 'tags tags 'id (org-timeblock-construct-id) 'title title)))))) :narrow nil)
  org-ql--select-cached(:query (and (not (done)) (and (not (done)) (org-timeblock-active-ts #s(ts :hour nil :minute nil :second nil :day 13 :month 12 :year 2023 :dow nil :day-abbr nil :day-name nil :doy nil :woy nil :month-abbr nil :month-name nil :tz-abbr nil :tz-offset nil :internal nil :unix 1702459262.686986) #s(ts :hour nil :minute nil :second nil :day 13 :month 12 :year 2023 :dow nil :day-abbr nil :day-name nil :doy nil :woy nil :month-abbr nil :month-name nil :tz-abbr nil :tz-offset nil :internal nil :unix 1702459262.0) :exclude-dateranges nil :with-time nil))) :preamble "<\\([[:digit:]]\\{4\\}-[[:digit:]]\\{2\\}-[[:digit:]]\\{..." :preamble-case-fold nil :predicate #f(compiled-function () #<bytecode 0xda52764258dafb8>) :action (closure ((files "~/somefolder/inbox.org" "~/somefolder/gtd.org" "~/somefolder/tickler.org" "~/somefolder/Birthdays.org" "~/somefolder/meetings.org") (with-time) (exclude-dateranges) (sort-func) (--cl-rest--) org-timeblock-list-mode-abbrev-table org-timeblock-list-mode-syntax-table org-timeblock-mode-abbrev-table org-timeblock-mode-syntax-table t) nil (let ((title (org-get-heading t nil t t)) (sched (org-element-property :scheduled (org-element-at-point))) (event (org-timeblock-get-event-timestamp)) (marker (copy-marker (point) t)) (tags (mapcar #'substring-no-properties (org-get-tags (org-element-at-point))))) (cons (if event (progn (propertize (concat ... title) 'event event 'marker marker 'tags tags 'id (org-timeblock-construct-id nil t) 'title title))) (if sched (progn (propertize (concat ... title) 'sched sched 'marker marker 'tags tags 'id (org-timeblock-construct-id) 'title title)))))) :narrow nil)
  #f(compiled-function (it) #<bytecode 0x3a67e9e466625df>)(#<buffer gtd.org>)
  org-ql-select(("~/somefolder/inbox.org" "~/somefolder/gtd.org" "~/somefolder/tickler.org" "~/somefolder/Birthdays.org" "~/somefolder/meetings.org") (and (not (done)) (org-timeblock-active-ts #s(ts :hour nil :minute nil :second nil :day 13 :month 12 :year 2023 :dow nil :day-abbr nil :day-name nil :doy nil :woy nil :month-abbr nil :month-name nil :tz-abbr nil :tz-offset nil :internal nil :unix 1702459262.686986) #s(ts :hour nil :minute nil :second nil :day 13 :month 12 :year 2023 :dow nil :day-abbr nil :day-name nil :doy nil :woy nil :month-abbr nil :month-name nil :tz-abbr nil :tz-offset nil :internal nil :unix 1702459262.0) :exclude-dateranges nil :with-time nil)) :action (closure ((files "~/somefolder/inbox.org" "~/somefolder/gtd.org" "~/somefolder/tickler.org" "~/somefolder/Birthdays.org" "~/somefolder/meetings.org") (with-time) (exclude-dateranges) (sort-func) (--cl-rest--) org-timeblock-list-mode-abbrev-table org-timeblock-list-mode-syntax-table org-timeblock-mode-abbrev-table org-timeblock-mode-syntax-table t) nil (let ((title (org-get-heading t nil t t)) (sched (org-element-property :scheduled (org-element-at-point))) (event (org-timeblock-get-event-timestamp)) (marker (copy-marker (point) t)) (tags (mapcar #'substring-no-properties (org-get-tags (org-element-at-point))))) (cons (if event (progn (propertize (concat ... title) 'event event 'marker marker 'tags tags 'id (org-timeblock-construct-id nil t) 'title title))) (if sched (progn (propertize (concat ... title) 'sched sched 'marker marker 'tags tags 'id (org-timeblock-construct-id) 'title title)))))))
  (let ((result (org-ql-select files (if (cdr org-timeblock-daterange) (list 'and '(not ...) (list 'org-timeblock-active-ts (car org-timeblock-daterange) (cdr org-timeblock-daterange) ':exclude-dateranges exclude-dateranges ':with-time with-time)) (list 'and '(not ...) (list 'org-timeblock-active-ts-on (car org-timeblock-daterange) ':exclude-dateranges exclude-dateranges ':with-time with-time))) :action #'(lambda nil (let (... ... ... ... ...) (cons ... ...))))) flattened) (let ((--dolist-tail-- result)) (while --dolist-tail-- (let ((el (car --dolist-tail--))) (and (car el) (setq flattened (cons (car el) flattened))) (and (cdr el) (setq flattened (cons (cdr el) flattened))) (setq --dolist-tail-- (cdr --dolist-tail--)))) flattened))
  (mapcar #'(lambda (entry) (let ((timestamp (or (get-text-property 0 ... entry) (get-text-property 0 ... entry)))) (let ((--dolist-tail-- (org-timeblock-get-dates))) (while --dolist-tail-- (let (...) (if ... ...) (setq --dolist-tail-- ...))))) entry) (let ((result (org-ql-select files (if (cdr org-timeblock-daterange) (list 'and '... (list ... ... ... ... exclude-dateranges ... with-time)) (list 'and '... (list ... ... ... exclude-dateranges ... with-time))) :action #'(lambda nil (let ... ...)))) flattened) (let ((--dolist-tail-- result)) (while --dolist-tail-- (let ((el (car --dolist-tail--))) (and (car el) (setq flattened (cons ... flattened))) (and (cdr el) (setq flattened (cons ... flattened))) (setq --dolist-tail-- (cdr --dolist-tail--)))) flattened)))
  (sort (mapcar #'(lambda (entry) (let ((timestamp (or ... ...))) (let ((--dolist-tail-- ...)) (while --dolist-tail-- (let ... ... ...)))) entry) (let ((result (org-ql-select files (if (cdr org-timeblock-daterange) (list ... ... ...) (list ... ... ...)) :action #'(lambda nil ...))) flattened) (let ((--dolist-tail-- result)) (while --dolist-tail-- (let ((el ...)) (and (car el) (setq flattened ...)) (and (cdr el) (setq flattened ...)) (setq --dolist-tail-- (cdr --dolist-tail--)))) flattened))) (or sort-func org-timeblock-sort-function))
  (if files (sort (mapcar #'(lambda (entry) (let ((timestamp ...)) (let (...) (while --dolist-tail-- ...))) entry) (let ((result (org-ql-select files (if ... ... ...) :action #'...)) flattened) (let ((--dolist-tail-- result)) (while --dolist-tail-- (let (...) (and ... ...) (and ... ...) (setq --dolist-tail-- ...))) flattened))) (or sort-func org-timeblock-sort-function)) nil)
  (let* ((files (and t (org-agenda-files)))) (if files (sort (mapcar #'(lambda (entry) (let (...) (let ... ...)) entry) (let ((result (org-ql-select files ... :action ...)) flattened) (let ((--dolist-tail-- result)) (while --dolist-tail-- (let ... ... ... ...)) flattened))) (or sort-func org-timeblock-sort-function)) nil))
  (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:sort-func :exclude-dateranges :with-time :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ... --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:sort-func :exclud..." (car --cl-keys--)))))) (let* ((files (and t (org-agenda-files)))) (if files (sort (mapcar #'(lambda (entry) (let ... ...) entry) (let ((result ...) flattened) (let (...) (while --dolist-tail-- ...) flattened))) (or sort-func org-timeblock-sort-function)) nil)))
  (let* ((sort-func (car (cdr (plist-member --cl-rest-- ':sort-func)))) (exclude-dateranges (car (cdr (plist-member --cl-rest-- ':exclude-dateranges)))) (with-time (car (cdr (plist-member --cl-rest-- ':with-time))))) (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '...) (setq --cl-keys-- (cdr ...))) ((car (cdr ...)) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:sort-func :exclud..." (car --cl-keys--)))))) (let* ((files (and t (org-agenda-files)))) (if files (sort (mapcar #'(lambda ... ... entry) (let (... flattened) (let ... ... flattened))) (or sort-func org-timeblock-sort-function)) nil))))
  org-timeblock-get-entries()
  (let ((inhibit-read-only t) (entries (org-timeblock-get-entries)) (dates (org-timeblock-get-dates))) (erase-buffer) (org-timeblock-list-mode) (setq header-line-format (substitute-command-keys (format "\\<org-timeblock-list-mode-map>Sorted by %s propert..." (cond ((eq org-timeblock-sort-function 'org-timeblock-order<) (let nil "SORTING-ORDER")) ((eq org-timeblock-sort-function 'org-timeblock-sched-or-event<) (let nil "SCHEDULED")) ((symbolp org-timeblock-sort-function) (let nil (symbol-name org-timeblock-sort-function))))))) (let ((--dolist-tail-- dates)) (while --dolist-tail-- (let ((date (car --dolist-tail--))) (let ((entries (seq-filter ... entries)) (date-beg (point))) (insert (propertize (concat ... ...) 'face 'org-timeblock-list-header)) (insert "\n") (let ((--dolist-tail-- entries)) (while --dolist-tail-- (let ... ... ...))) (if (eq org-timeblock-sort-function #'org-timeblock-order<) (progn (goto-char date-beg) (forward-line ...) (insert ...))) (goto-char (point-max))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (goto-char (point-min)) (if (get-buffer-window org-timeblock-buffer) (progn (org-timeblock-redraw-timeblocks))))
  (save-current-buffer (set-buffer (get-buffer-create org-timeblock-list-buffer)) (let ((inhibit-read-only t) (entries (org-timeblock-get-entries)) (dates (org-timeblock-get-dates))) (erase-buffer) (org-timeblock-list-mode) (setq header-line-format (substitute-command-keys (format "\\<org-timeblock-list-mode-map>Sorted by %s propert..." (cond ((eq org-timeblock-sort-function ...) (let nil "SORTING-ORDER")) ((eq org-timeblock-sort-function ...) (let nil "SCHEDULED")) ((symbolp org-timeblock-sort-function) (let nil ...)))))) (let ((--dolist-tail-- dates)) (while --dolist-tail-- (let ((date (car --dolist-tail--))) (let ((entries ...) (date-beg ...)) (insert (propertize ... ... ...)) (insert "\n") (let (...) (while --dolist-tail-- ...)) (if (eq org-timeblock-sort-function ...) (progn ... ... ...)) (goto-char (point-max))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (goto-char (point-min)) (if (get-buffer-window org-timeblock-buffer) (progn (org-timeblock-redraw-timeblocks)))))
  org-timeblock-redraw-buffers()
  org-timeblock()
  funcall-interactively(org-timeblock)
  command-execute(org-timeblock record)
  helm-M-x-execute-command(org-timeblock)

Do let me know if you need more info.

ichernyshovvv commented 9 months ago

Hi, thanks for the report. Fixed in https://github.com/ichernyshovvv/org-timeblock/commit/cf326f5dadbf7b90750f54455b00fcd0b8b60b0a. New MELPA build will be available within 3-4 hours. Let me know if it works for you.