Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hammy-start-org-clock-in error with "⅓-time" timer #13

Closed
Rickyfs opened this issue Sep 2, 2023 · 8 comments
Closed

hammy-start-org-clock-in error with "⅓-time" timer #13

Rickyfs opened this issue Sep 2, 2023 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@Rickyfs
Copy link

Rickyfs commented Sep 2, 2023

Starting 'hammy-start-org-clock-in' with "⅓-time" timer on org heading results in:

Hammy (⅓-time): Starting work time (advance to break when ready).
funcall-interactively: Wrong type argument: listp, #[257 "�!�>�\0�D\"�H�\0K\0�!�>.\0�D\"�C��!�>E\0��D\"�HBI" [cl-struct-hammy-tags unused-break type-of signal wrong-type-argument hammy 11 nil] 9 "

(fn HAMMY)"]

After error occurs hammy and clock in is running however when stopping hammy it doesn't clock out

@alphapapa
Copy link
Owner

Please re-evaluate the hammy.el file's code so it's not byte compiled, then enable debug-on-error, then cause the error again, and paste the backtrace here.

@alphapapa alphapapa self-assigned this Sep 3, 2023
@alphapapa alphapapa added the bug Something isn't working label Sep 3, 2023
@Rickyfs
Copy link
Author

Rickyfs commented Sep 3, 2023

This is very strange. I added :build (:not compile) in straight so hammy is not compiled but now it acts different. 'hammy-start-org-clock-in' with "⅓-time" starts without any issue but when I call hammy-stop it gives me void-function closure:

Debugger entered--Lisp error: (void-function closure)
  closure(#s(hammy :name "⅓-time" :documentation "Breaks that are ⅓ as long as the..." :history ((#s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before ... :after ... :advance ...) (25844 32905 397922 798000) (25844 32916 6067 562000))) :cycles 0 :intervals (0 2 . [#s(hammy-interval :name "Break" :documentation "" :face nil :duration ... :before ... :after ... :advance ...) #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before ... :after ... :advance ...)]) :interval #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure ... ... ...)) :after (hammy--org-clock-out) :advance ((closure ... ... ... ... ... ... ... ...))) :current-interval-start-time (25844 32905 397922 798000) :current-duration 5400 :last-duration nil :timer nil :etc ((org-clock-hd-marker . #<marker at 22845 in README.org>)) :before nil :after nil :stopped (hammy--org-clock-out closure ((--cl-cancel-reminder-- closure #5 ... ...) (--cl-remind-- closure #5 ... "\n\n(fn DELAY &rest FNS)" ...) (--cl-climb-- closure ... ... "\n\n(fn FROM TO &key DESCEND STEP)" ...) (--cl-cycles-- closure ... ... ...) (--cl-history-- closure ... ... ...) (--cl-num-intervals-- closure ... ... ...) (--cl-elapsed-- closure ... ... "Call `hammy-elapsed', which see." ...) (--cl-interval-- closure ... ... "\n\n(fn &rest ARGS)" ...) (--cl-duration-- closure ... ... ...) (--cl-run-- closure ... ... ...) hammy-log-mode-abbrev-table hammy-log-mode-syntax-table cl-struct-hammy-interval-tags cl-struct-hammy-tags t) (hammy) (progn (ignore hammy) (let* ... ...))) :complete-p nil :overduep nil))
  apply(closure #s(hammy :name "⅓-time" :documentation "Breaks that are ⅓ as long as the..." :history ((#s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before ... :after ... :advance ...) (25844 32905 397922 798000) (25844 32916 6067 562000))) :cycles 0 :intervals (0 2 . [#s(hammy-interval :name "Break" :documentation "" :face nil :duration ... :before ... :after ... :advance ...) #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before ... :after ... :advance ...)]) :interval #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure ... ... ...)) :after (hammy--org-clock-out) :advance ((closure ... ... ... ... ... ... ... ...))) :current-interval-start-time (25844 32905 397922 798000) :current-duration 5400 :last-duration nil :timer nil :etc ((org-clock-hd-marker . #<marker at 22845 in README.org>)) :before nil :after nil :stopped (hammy--org-clock-out closure ((--cl-cancel-reminder-- closure #6 ... ...) (--cl-remind-- closure #6 ... "\n\n(fn DELAY &rest FNS)" ...) (--cl-climb-- closure ... ... "\n\n(fn FROM TO &key DESCEND STEP)" ...) (--cl-cycles-- closure ... ... ...) (--cl-history-- closure ... ... ...) (--cl-num-intervals-- closure ... ... ...) (--cl-elapsed-- closure ... ... "Call `hammy-elapsed', which see." ...) (--cl-interval-- closure ... ... "\n\n(fn &rest ARGS)" ...) (--cl-duration-- closure ... ... ...) (--cl-run-- closure ... ... ...) hammy-log-mode-abbrev-table hammy-log-mode-syntax-table cl-struct-hammy-interval-tags cl-struct-hammy-tags t) (hammy) (progn (ignore hammy) (let* ... ...))) :complete-p nil :overduep nil))
  (let ((fn (car --dolist-tail--))) (apply fn args) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (while --dolist-tail-- (let ((fn (car --dolist-tail--))) (apply fn args) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (let ((--dolist-tail-- fn-or-fns)) (while --dolist-tail-- (let ((fn (car --dolist-tail--))) (apply fn args) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  (cond ((null fn-or-fns) nil) ((functionp fn-or-fns) (apply fn-or-fns args)) ((listp fn-or-fns) (let ((--dolist-tail-- fn-or-fns)) (while --dolist-tail-- (let ((fn (car --dolist-tail--))) (apply fn args) (setq --dolist-tail-- (cdr --dolist-tail--)))))))
  hammy-call((hammy--org-clock-out closure (... ... ... ... ... ... ... ... ... ... hammy-log-mode-abbrev-table hammy-log-mode-syntax-table cl-struct-hammy-interval-tags cl-struct-hammy-tags t) (hammy) (progn ... ...)) #s(hammy :name "⅓-time" :documentation "Breaks that are ⅓ as..." :history (...) :cycles 0 :intervals (0 2 . ...) :interval #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before ... :after ... :advance ...) :current-interval-start-time (25844 32905 397922 798000) :current-duration 5400 :last-duration nil :timer nil :etc (...) :before nil :after nil :stopped (hammy--org-clock-out closure ... ... ...) :complete-p nil :overduep nil))
  (progn (if internal-timer (progn (cancel-timer internal-timer) (progn (or (progn (and (memq ... cl-struct-hammy-tags) t)) (signal 'wrong-type-argument (list 'hammy hammy))) (let* ((v hammy)) (aset v 10 nil))) (hammy-log hammy message) (if quietly nil (message message)))) (if reminder (progn (cancel-timer reminder) (progn (or (progn (and (memq ... cl-struct-hammy-tags) t)) (signal 'wrong-type-argument (list 'hammy hammy))) (let* ((v hammy) (p (if ... ... ...))) (progn (if p (setcdr p nil) (aset v 11 ...)) nil))))) (hammy--record-interval hammy) (run-hook-with-args 'hammy-stopped hammy) (hammy-call (progn (or (progn (and (memq (type-of hammy) cl-struct-hammy-tags) t)) (signal 'wrong-type-argument (list 'hammy hammy))) (aref hammy 14)) hammy) (progn (progn (or (progn (and (memq (type-of hammy) cl-struct-hammy-tags) t)) (signal 'wrong-type-argument (list 'hammy hammy))) (let* ((v hammy)) (aset v 6 nil))) (setq hammy-active (remove hammy hammy-active))) hammy)
  (let* ((message "Stopped.")) (progn (if internal-timer (progn (cancel-timer internal-timer) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... hammy))) (let* ((v hammy)) (aset v 10 nil))) (hammy-log hammy message) (if quietly nil (message message)))) (if reminder (progn (cancel-timer reminder) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... hammy))) (let* ((v hammy) (p ...)) (progn (if p ... ...) nil))))) (hammy--record-interval hammy) (run-hook-with-args 'hammy-stopped hammy) (hammy-call (progn (or (progn (and (memq ... cl-struct-hammy-tags) t)) (signal 'wrong-type-argument (list 'hammy hammy))) (aref hammy 14)) hammy) (progn (progn (or (progn (and (memq ... cl-struct-hammy-tags) t)) (signal 'wrong-type-argument (list 'hammy hammy))) (let* ((v hammy)) (aset v 6 nil))) (setq hammy-active (remove hammy hammy-active))) hammy))
  (let ((internal-timer x44) (reminder x46)) (let* ((message "Stopped.")) (progn (if internal-timer (progn (cancel-timer internal-timer) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 10 nil))) (hammy-log hammy message) (if quietly nil (message message)))) (if reminder (progn (cancel-timer reminder) (progn (or (progn ...) (signal ... ...)) (let* (... ...) (progn ... nil))))) (hammy--record-interval hammy) (run-hook-with-args 'hammy-stopped hammy) (hammy-call (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... hammy))) (aref hammy 14)) hammy) (progn (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... hammy))) (let* ((v hammy)) (aset v 6 nil))) (setq hammy-active (remove hammy hammy-active))) hammy)))
  (let* ((x46 (map-elt x45 'reminder))) (let ((internal-timer x44) (reminder x46)) (let* ((message "Stopped.")) (progn (if internal-timer (progn (cancel-timer internal-timer) (progn (or ... ...) (let* ... ...)) (hammy-log hammy message) (if quietly nil (message message)))) (if reminder (progn (cancel-timer reminder) (progn (or ... ...) (let* ... ...)))) (hammy--record-interval hammy) (run-hook-with-args 'hammy-stopped hammy) (hammy-call (progn (or (progn ...) (signal ... ...)) (aref hammy 14)) hammy) (progn (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 6 nil))) (setq hammy-active (remove hammy hammy-active))) hammy))))
  (progn (ignore (mapp x45)) (let* ((x46 (map-elt x45 'reminder))) (let ((internal-timer x44) (reminder x46)) (let* ((message "Stopped.")) (progn (if internal-timer (progn (cancel-timer internal-timer) (progn ... ...) (hammy-log hammy message) (if quietly nil ...))) (if reminder (progn (cancel-timer reminder) (progn ... ...))) (hammy--record-interval hammy) (run-hook-with-args 'hammy-stopped hammy) (hammy-call (progn (or ... ...) (aref hammy 14)) hammy) (progn (progn (or ... ...) (let* ... ...)) (setq hammy-active (remove hammy hammy-active))) hammy)))))
  (let* ((x44 (aref hammy 10)) (x45 (aref hammy 11))) (progn (ignore (mapp x45)) (let* ((x46 (map-elt x45 'reminder))) (let ((internal-timer x44) (reminder x46)) (let* ((message "Stopped.")) (progn (if internal-timer (progn ... ... ... ...)) (if reminder (progn ... ...)) (hammy--record-interval hammy) (run-hook-with-args 'hammy-stopped hammy) (hammy-call (progn ... ...) hammy) (progn (progn ... ...) (setq hammy-active ...)) hammy))))))
  (progn (ignore (progn (and (memq (type-of hammy) cl-struct-hammy-tags) t))) (let* ((x44 (aref hammy 10)) (x45 (aref hammy 11))) (progn (ignore (mapp x45)) (let* ((x46 (map-elt x45 'reminder))) (let ((internal-timer x44) (reminder x46)) (let* ((message "Stopped.")) (progn (if internal-timer ...) (if reminder ...) (hammy--record-interval hammy) (run-hook-with-args ... hammy) (hammy-call ... hammy) (progn ... ...) hammy)))))))
  hammy-stop(#s(hammy :name "⅓-time" :documentation "Breaks that are ⅓ as long as the..." :history ((#s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before ... :after ... :advance ...) (25844 32905 397922 798000) (25844 32916 6067 562000))) :cycles 0 :intervals (0 2 . [#s(hammy-interval :name "Break" :documentation "" :face nil :duration ... :before ... :after ... :advance ...) #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before ... :after ... :advance ...)]) :interval #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure ... ... ...)) :after (hammy--org-clock-out) :advance ((closure ... ... ... ... ... ... ... ...))) :current-interval-start-time (25844 32905 397922 798000) :current-duration 5400 :last-duration nil :timer nil :etc ((org-clock-hd-marker . #<marker at 22845 in README.org>)) :before nil :after nil :stopped (hammy--org-clock-out closure ((--cl-cancel-reminder-- closure #5 ... ...) (--cl-remind-- closure #5 ... "\n\n(fn DELAY &rest FNS)" ...) (--cl-climb-- closure ... ... "\n\n(fn FROM TO &key DESCEND STEP)" ...) (--cl-cycles-- closure ... ... ...) (--cl-history-- closure ... ... ...) (--cl-num-intervals-- closure ... ... ...) (--cl-elapsed-- closure ... ... "Call `hammy-elapsed', which see." ...) (--cl-interval-- closure ... ... "\n\n(fn &rest ARGS)" ...) (--cl-duration-- closure ... ... ...) (--cl-run-- closure ... ... ...) hammy-log-mode-abbrev-table hammy-log-mode-syntax-table cl-struct-hammy-interval-tags cl-struct-hammy-tags t) (hammy) (progn (ignore hammy) (let* ... ...))) :complete-p nil :overduep nil))
  funcall-interactively(hammy-stop #s(hammy :name "⅓-time" :documentation "Breaks that are ⅓ as long as the..." :history ((#s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before ... :after ... :advance ...) (25844 32905 397922 798000) (25844 32916 6067 562000))) :cycles 0 :intervals (0 2 . [#s(hammy-interval :name "Break" :documentation "" :face nil :duration ... :before ... :after ... :advance ...) #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before ... :after ... :advance ...)]) :interval #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure ... ... ...)) :after (hammy--org-clock-out) :advance ((closure ... ... ... ... ... ... ... ...))) :current-interval-start-time (25844 32905 397922 798000) :current-duration 5400 :last-duration nil :timer nil :etc ((org-clock-hd-marker . #<marker at 22845 in README.org>)) :before nil :after nil :stopped (hammy--org-clock-out closure ((--cl-cancel-reminder-- closure #6 ... ...) (--cl-remind-- closure #6 ... "\n\n(fn DELAY &rest FNS)" ...) (--cl-climb-- closure ... ... "\n\n(fn FROM TO &key DESCEND STEP)" ...) (--cl-cycles-- closure ... ... ...) (--cl-history-- closure ... ... ...) (--cl-num-intervals-- closure ... ... ...) (--cl-elapsed-- closure ... ... "Call `hammy-elapsed', which see." ...) (--cl-interval-- closure ... ... "\n\n(fn &rest ARGS)" ...) (--cl-duration-- closure ... ... ...) (--cl-run-- closure ... ... ...) hammy-log-mode-abbrev-table hammy-log-mode-syntax-table cl-struct-hammy-interval-tags cl-struct-hammy-tags t) (hammy) (progn (ignore hammy) (let* ... ...))) :complete-p nil :overduep nil))
  command-execute(hammy-stop record)
  execute-extended-command(nil "hammy-stop" nil)
  funcall-interactively(execute-extended-command nil "hammy-stop" nil)
  command-execute(execute-extended-command)

Seems like it clocks out however its impossible to stop hammy, if I repeat stop function it outputs apply: Symbol’s function definition is void: closure without stopping

@Rickyfs
Copy link
Author

Rickyfs commented Sep 3, 2023

I hammy-define "⅓-time custom" in my config with exact same code and it works without any errors while the default inbuilt one gives errors. Also quick question is there a way to clear default timers from the list so I can have only my custom defined ones?

@alphapapa
Copy link
Owner

I can't help you with issues regarding Straight. It is a powerful piece of software but it does things differently and I don't use it. Please use a clean Emacs configuration without Straight for testing, e.g. you can use https://github.com/alphapapa/with-emacs.sh (And for future reference, whenever you report a bug about an Emacs package, you should be sure to test it in a clean, non-Straight configuration, and mention that you use Straight when you report the problem.)

Also quick question is there a way to clear default timers from the list so I can have only my custom defined ones?

Just (setq hammy-hammys nil) and then define yours.

@Rickyfs
Copy link
Author

Rickyfs commented Sep 4, 2023

No no, I didn't think it was straight issue. I tested in both my default emacs (hammy installed using package-install) and doom-emacs with their straight implementation. I just found slightly different behavior when its byte compiled and when its not.

Not compiled:
Starts without error
Throws error on hammy-stop, clocks-out from task but hammy timer is forever running, repeating hammy-stop gives error.

Debugger entered--Lisp error: (void-function closure)
  closure(#s(hammy :name "⅓-time" :documentation "Breaks that are ⅓ as long as the last work interva..." :history ((#s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) (25845 10609 714549 500000) (25845 10805 38892 152000)) (#s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) (25845 10609 714549 500000) (25845 10657 963073 53000))) :cycles 0 :intervals (0 2 . [#s(hammy-interval :name "Break" :documentation "" :face nil :duration (closure (t) (hammy) (progn (ignore hammy) (let* ... ...))) :before ((closure (t) (hammy) (progn ... ...))) :after ((closure (t) (hammy) (progn ... ...))) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...))))]) :interval #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn (ignore hammy) (hammy-announce hammy "Starting work time (advance to break when ready).") (hammy-notify hammy "Starting work time (advance to break when ready).")))) :after (hammy--org-clock-out) :advance ((closure ((fns (closure ... ... ...)) (delay . "10 minutes") (--cl-cancel-reminder-- closure (t) (hammy) (if ... ...)) (--cl-duration-- closure (t) (interval) (timer-duration interval))) (hammy) (if (listp (progn ... ...)) nil (progn (or ... ...) (let* ... ...))) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 13 ...))) (let ((tail fns)) (while tail (let ... ... ...))) (let ((delay-secs ...)) (progn (or ... ...) (let* ... ...))) (if (listp (progn ... ...)) nil (progn (or ... ...) (let* ... ...))) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 6 ...)))))) :current-interval-start-time (25845 10609 714549 500000) :current-duration 5400 :last-duration nil :timer nil :etc ((org-clock-hd-marker . #<marker at 1 in todo.org>)) :before nil :after nil :stopped (hammy--org-clock-out closure (t) (hammy) (progn (ignore hammy) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... hammy))) (let* ((v hammy) (p ...)) (progn (if p ... ...) nil))))) :complete-p nil :overduep nil))
  apply(closure #s(hammy :name "⅓-time" :documentation "Breaks that are ⅓ as long as the last work interva..." :history ((#s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) (25845 10609 714549 500000) (25845 10805 38892 152000)) (#s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) (25845 10609 714549 500000) (25845 10657 963073 53000))) :cycles 0 :intervals (0 2 . [#s(hammy-interval :name "Break" :documentation "" :face nil :duration (closure (t) (hammy) (progn (ignore hammy) (let* ... ...))) :before ((closure (t) (hammy) (progn ... ...))) :after ((closure (t) (hammy) (progn ... ...))) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...))))]) :interval #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn (ignore hammy) (hammy-announce hammy "Starting work time (advance to break when ready).") (hammy-notify hammy "Starting work time (advance to break when ready).")))) :after (hammy--org-clock-out) :advance ((closure ((fns (closure ... ... ...)) (delay . "10 minutes") (--cl-cancel-reminder-- closure (t) (hammy) (if ... ...)) (--cl-duration-- closure (t) (interval) (timer-duration interval))) (hammy) (if (listp (progn ... ...)) nil (progn (or ... ...) (let* ... ...))) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 13 ...))) (let ((tail fns)) (while tail (let ... ... ...))) (let ((delay-secs ...)) (progn (or ... ...) (let* ... ...))) (if (listp (progn ... ...)) nil (progn (or ... ...) (let* ... ...))) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 6 ...)))))) :current-interval-start-time (25845 10609 714549 500000) :current-duration 5400 :last-duration nil :timer nil :etc ((org-clock-hd-marker . #<marker at 1 in todo.org>)) :before nil :after nil :stopped (hammy--org-clock-out closure (t) (hammy) (progn (ignore hammy) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... hammy))) (let* ((v hammy) (p ...)) (progn (if p ... ...) nil))))) :complete-p nil :overduep nil))
  (let ((fn (car tail))) (apply fn args) (setq tail (cdr tail)))
  (while tail (let ((fn (car tail))) (apply fn args) (setq tail (cdr tail))))
  (let ((tail fn-or-fns)) (while tail (let ((fn (car tail))) (apply fn args) (setq tail (cdr tail)))))
  (cond ((null fn-or-fns) nil) ((functionp fn-or-fns) (apply fn-or-fns args)) ((listp fn-or-fns) (let ((tail fn-or-fns)) (while tail (let ((fn (car tail))) (apply fn args) (setq tail (cdr tail)))))))
  hammy-call((hammy--org-clock-out closure (t) (hammy) (progn (ignore hammy) (progn (or (progn (and (memq ... cl-struct-hammy-tags) t)) (signal 'wrong-type-argument (list 'hammy hammy))) (let* ((v hammy) (p (if ... ... ...))) (progn (if p (setcdr p nil) (aset v 11 ...)) nil))))) #s(hammy :name "⅓-time" :documentation "Breaks that are ⅓ as long as the last work interva..." :history ((#s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) (25845 10609 714549 500000) (25845 10805 38892 152000)) (#s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) (25845 10609 714549 500000) (25845 10657 963073 53000))) :cycles 0 :intervals (0 2 . [#s(hammy-interval :name "Break" :documentation "" :face nil :duration (closure (t) (hammy) (progn (ignore hammy) (let* ... ...))) :before ((closure (t) (hammy) (progn ... ...))) :after ((closure (t) (hammy) (progn ... ...))) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...))))]) :interval #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn (ignore hammy) (hammy-announce hammy "Starting work time (advance to break when ready).") (hammy-notify hammy "Starting work time (advance to break when ready).")))) :after (hammy--org-clock-out) :advance ((closure ((fns (closure ... ... ...)) (delay . "10 minutes") (--cl-cancel-reminder-- closure (t) (hammy) (if ... ...)) (--cl-duration-- closure (t) (interval) (timer-duration interval))) (hammy) (if (listp (progn ... ...)) nil (progn (or ... ...) (let* ... ...))) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 13 ...))) (let ((tail fns)) (while tail (let ... ... ...))) (let ((delay-secs ...)) (progn (or ... ...) (let* ... ...))) (if (listp (progn ... ...)) nil (progn (or ... ...) (let* ... ...))) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 6 ...)))))) :current-interval-start-time (25845 10609 714549 500000) :current-duration 5400 :last-duration nil :timer nil :etc ((org-clock-hd-marker . #<marker at 1 in todo.org>)) :before nil :after nil :stopped (hammy--org-clock-out closure (t) (hammy) (progn (ignore hammy) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... hammy))) (let* ((v hammy) (p ...)) (progn (if p ... ...) nil))))) :complete-p nil :overduep nil))
  (progn (if internal-timer (progn (cancel-timer internal-timer) (progn (or (progn (and (memq ... cl-struct-hammy-tags) t)) (signal 'wrong-type-argument (list 'hammy hammy))) (let* ((v hammy)) (aset v 10 nil))) (hammy-log hammy message) (if quietly nil (message message)))) (if reminder (progn (cancel-timer reminder) (progn (or (progn (and (memq ... cl-struct-hammy-tags) t)) (signal 'wrong-type-argument (list 'hammy hammy))) (let* ((v hammy) (p (if ... ... ...))) (progn (if p (setcdr p nil) (aset v 11 ...)) nil))))) (hammy--record-interval hammy) (run-hook-with-args 'hammy-stopped hammy) (hammy-call (progn (or (progn (and (memq (type-of hammy) cl-struct-hammy-tags) t)) (signal 'wrong-type-argument (list 'hammy hammy))) (aref hammy 14)) hammy) (progn (progn (or (progn (and (memq (type-of hammy) cl-struct-hammy-tags) t)) (signal 'wrong-type-argument (list 'hammy hammy))) (let* ((v hammy)) (aset v 6 nil))) (setq hammy-active (remove hammy hammy-active))) hammy)
  (let* ((message "Stopped.")) (progn (if internal-timer (progn (cancel-timer internal-timer) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... hammy))) (let* ((v hammy)) (aset v 10 nil))) (hammy-log hammy message) (if quietly nil (message message)))) (if reminder (progn (cancel-timer reminder) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... hammy))) (let* ((v hammy) (p ...)) (progn (if p ... ...) nil))))) (hammy--record-interval hammy) (run-hook-with-args 'hammy-stopped hammy) (hammy-call (progn (or (progn (and (memq ... cl-struct-hammy-tags) t)) (signal 'wrong-type-argument (list 'hammy hammy))) (aref hammy 14)) hammy) (progn (progn (or (progn (and (memq ... cl-struct-hammy-tags) t)) (signal 'wrong-type-argument (list 'hammy hammy))) (let* ((v hammy)) (aset v 6 nil))) (setq hammy-active (remove hammy hammy-active))) hammy))
  (let ((internal-timer x0) (reminder x2)) (let* ((message "Stopped.")) (progn (if internal-timer (progn (cancel-timer internal-timer) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 10 nil))) (hammy-log hammy message) (if quietly nil (message message)))) (if reminder (progn (cancel-timer reminder) (progn (or (progn ...) (signal ... ...)) (let* (... ...) (progn ... nil))))) (hammy--record-interval hammy) (run-hook-with-args 'hammy-stopped hammy) (hammy-call (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... hammy))) (aref hammy 14)) hammy) (progn (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... hammy))) (let* ((v hammy)) (aset v 6 nil))) (setq hammy-active (remove hammy hammy-active))) hammy)))
  (let* ((x2 (map-elt x1 'reminder))) (let ((internal-timer x0) (reminder x2)) (let* ((message "Stopped.")) (progn (if internal-timer (progn (cancel-timer internal-timer) (progn (or ... ...) (let* ... ...)) (hammy-log hammy message) (if quietly nil (message message)))) (if reminder (progn (cancel-timer reminder) (progn (or ... ...) (let* ... ...)))) (hammy--record-interval hammy) (run-hook-with-args 'hammy-stopped hammy) (hammy-call (progn (or (progn ...) (signal ... ...)) (aref hammy 14)) hammy) (progn (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 6 nil))) (setq hammy-active (remove hammy hammy-active))) hammy))))
  (progn (ignore (mapp x1)) (let* ((x2 (map-elt x1 'reminder))) (let ((internal-timer x0) (reminder x2)) (let* ((message "Stopped.")) (progn (if internal-timer (progn (cancel-timer internal-timer) (progn ... ...) (hammy-log hammy message) (if quietly nil ...))) (if reminder (progn (cancel-timer reminder) (progn ... ...))) (hammy--record-interval hammy) (run-hook-with-args 'hammy-stopped hammy) (hammy-call (progn (or ... ...) (aref hammy 14)) hammy) (progn (progn (or ... ...) (let* ... ...)) (setq hammy-active (remove hammy hammy-active))) hammy)))))
  (let* ((x0 (aref hammy 10)) (x1 (aref hammy 11))) (progn (ignore (mapp x1)) (let* ((x2 (map-elt x1 'reminder))) (let ((internal-timer x0) (reminder x2)) (let* ((message "Stopped.")) (progn (if internal-timer (progn ... ... ... ...)) (if reminder (progn ... ...)) (hammy--record-interval hammy) (run-hook-with-args 'hammy-stopped hammy) (hammy-call (progn ... ...) hammy) (progn (progn ... ...) (setq hammy-active ...)) hammy))))))
  (progn (ignore (progn (and (memq (type-of hammy) cl-struct-hammy-tags) t))) (let* ((x0 (aref hammy 10)) (x1 (aref hammy 11))) (progn (ignore (mapp x1)) (let* ((x2 (map-elt x1 'reminder))) (let ((internal-timer x0) (reminder x2)) (let* ((message "Stopped.")) (progn (if internal-timer ...) (if reminder ...) (hammy--record-interval hammy) (run-hook-with-args ... hammy) (hammy-call ... hammy) (progn ... ...) hammy)))))))
  hammy-stop(#s(hammy :name "⅓-time" :documentation "Breaks that are ⅓ as long as the last work interva..." :history ((#s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) (25845 10609 714549 500000) (25845 10805 38892 152000)) (#s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) (25845 10609 714549 500000) (25845 10657 963073 53000))) :cycles 0 :intervals (0 2 . [#s(hammy-interval :name "Break" :documentation "" :face nil :duration (closure (t) (hammy) (progn (ignore hammy) (let* ... ...))) :before ((closure (t) (hammy) (progn ... ...))) :after ((closure (t) (hammy) (progn ... ...))) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...))))]) :interval #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn (ignore hammy) (hammy-announce hammy "Starting work time (advance to break when ready).") (hammy-notify hammy "Starting work time (advance to break when ready).")))) :after (hammy--org-clock-out) :advance ((closure ((fns (closure ... ... ...)) (delay . "10 minutes") (--cl-cancel-reminder-- closure (t) (hammy) (if ... ...)) (--cl-duration-- closure (t) (interval) (timer-duration interval))) (hammy) (if (listp (progn ... ...)) nil (progn (or ... ...) (let* ... ...))) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 13 ...))) (let ((tail fns)) (while tail (let ... ... ...))) (let ((delay-secs ...)) (progn (or ... ...) (let* ... ...))) (if (listp (progn ... ...)) nil (progn (or ... ...) (let* ... ...))) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 6 ...)))))) :current-interval-start-time (25845 10609 714549 500000) :current-duration 5400 :last-duration nil :timer nil :etc ((org-clock-hd-marker . #<marker at 1 in todo.org>)) :before nil :after nil :stopped (hammy--org-clock-out closure (t) (hammy) (progn (ignore hammy) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... hammy))) (let* ((v hammy) (p ...)) (progn (if p ... ...) nil))))) :complete-p nil :overduep nil))
  funcall-interactively(hammy-stop #s(hammy :name "⅓-time" :documentation "Breaks that are ⅓ as long as the last work interva..." :history ((#s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) (25845 10609 714549 500000) (25845 10805 38892 152000)) (#s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) (25845 10609 714549 500000) (25845 10657 963073 53000))) :cycles 0 :intervals (0 2 . [#s(hammy-interval :name "Break" :documentation "" :face nil :duration (closure (t) (hammy) (progn (ignore hammy) (let* ... ...))) :before ((closure (t) (hammy) (progn ... ...))) :after ((closure (t) (hammy) (progn ... ...))) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...)))) #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn ... ... ...))) :after (hammy--org-clock-out) :advance ((closure (... ... ... ...) (hammy) (if ... nil ...) (progn ... ...) (let ... ...) (let ... ...) (if ... nil ...) (progn ... ...))))]) :interval #s(hammy-interval :name "Work" :documentation "" :face nil :duration "90 minutes" :before (hammy--org-clock-in (closure (t) (hammy) (progn (ignore hammy) (hammy-announce hammy "Starting work time (advance to break when ready).") (hammy-notify hammy "Starting work time (advance to break when ready).")))) :after (hammy--org-clock-out) :advance ((closure ((fns (closure ... ... ...)) (delay . "10 minutes") (--cl-cancel-reminder-- closure (t) (hammy) (if ... ...)) (--cl-duration-- closure (t) (interval) (timer-duration interval))) (hammy) (if (listp (progn ... ...)) nil (progn (or ... ...) (let* ... ...))) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 13 ...))) (let ((tail fns)) (while tail (let ... ... ...))) (let ((delay-secs ...)) (progn (or ... ...) (let* ... ...))) (if (listp (progn ... ...)) nil (progn (or ... ...) (let* ... ...))) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 6 ...)))))) :current-interval-start-time (25845 10609 714549 500000) :current-duration 5400 :last-duration nil :timer nil :etc ((org-clock-hd-marker . #<marker at 1 in todo.org>)) :before nil :after nil :stopped (hammy--org-clock-out closure (t) (hammy) (progn (ignore hammy) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... hammy))) (let* ((v hammy) (p ...)) (progn (if p ... ...) nil))))) :complete-p nil :overduep nil))
  command-execute(hammy-stop record)
  execute-extended-command(nil "hammy-stop" "hamm")
  funcall-interactively(execute-extended-command nil "hammy-stop" "hamm")
  command-execute(execute-extended-command)

Compiled:
Error on start (see bellow) but starts both hammy and clock-in, however running hammy-stop stops hammy timer but doesnt clock-out

Debugger entered--Lisp error: (wrong-type-argument listp #f(compiled-function (hammy) #<bytecode 0x340a84bd3dba39>))
  hammy-start-org-clock-in()
  funcall-interactively(hammy-start-org-clock-in)
  command-execute(hammy-start-org-clock-in record)
  execute-extended-command(nil "hammy-start-org-clock-in" nil)
  funcall-interactively(execute-extended-command nil "hammy-start-org-clock-in" nil)
  command-execute(execute-extended-command)

Error messages are from vanilla emacs, I tested both emacs version of 28.2 and 29.1

Strange is that I figured out this happens only when using inbuilt "⅓-time" hammy. If I define new "⅓-time" hammy with exact same code but different name then no errors occur and works as expected

alphapapa added a commit that referenced this issue Sep 4, 2023
@alphapapa
Copy link
Owner

I don't know why it doesn't seem to work without byte-compilation. If you're using Straight when encountering that, you should probably report a bug to Straight (or consider trying an alternative, like Elpaca).

This commit I just pushed seems to fix the problem: f2b3206 It was just an oversight on my part, and it only happens with the 1/3-time hammy because it's the only predefined one that uses the stopped slot.

Please let me know if it works for you. Thanks.

@Rickyfs
Copy link
Author

Rickyfs commented Sep 4, 2023

That was it, works fine now. Thanks!

@Rickyfs Rickyfs closed this as completed Sep 4, 2023
alphapapa added a commit that referenced this issue Sep 4, 2023
@alphapapa
Copy link
Owner

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants