0

I can't org-clock-in anymore in org-mode. I don't know how I've achieved this.

The time the error shows isn't the current time of day when I run org-clock-in. It seems stuck in the past.

There are no other clocks running. For a moment it seemed to work again after I ran package-initialize, however I restarted Emacs and the problem returned. The other thing I've been playing with is desktop-save where I've been limiting how many buffers it restores on restart using '(desktop-restore-eager 5).

I am wondering if I've caused this after running package-autoremove yesterday which cleared out four packages (Is org dependent on something else?), however I can't find a log that will let me go back and see what those packages were (yes stupid me).

I understand that the time-stamp is missing hyphens between the numerals. My .emacs.el file is purely just loading packages as opposed to running custom functions. I don't think I've got anything in there or in customize-group that would adjust the date format.

   Debugger entered--Lisp error: (error #("Not an Org time string: [2020 09 23 Wed 13:41]" 24 46 (fontified nil line-prefix #("        " 0 8 (face org-indent)) wrap-prefix #("        " 0 8 (face org-indent)) org-category "notes")))
      signal(error (#("Not an Org time string: [2020 09 23 Wed 13:41]" 24 46 (fontified nil line-prefix #("        " 0 8 (face org-indent)) wrap-prefix #("        " 0 8 (face org-indent)) org-category "notes"))))
      error("Not an Org time string: %s" #("[2020 09 23 Wed 13:41]" 0 22 (org-category "notes" wrap-prefix #("        " 0 8 (face org-indent)) line-prefix #("        " 0 8 (face org-indent)) fontified nil)))
      org-parse-time-string(#("[2020 09 23 Wed 13:41]" 0 22 (org-category "notes" wrap-prefix #("        " 0 8 (face org-indent)) line-prefix #("        " 0 8 (face org-indent)) fontified nil)))
      org-time-string-to-time(#("[2020 09 23 Wed 13:41]" 0 22 (org-category "notes" wrap-prefix #("        " 0 8 (face org-indent)) line-prefix #("        " 0 8 (face org-indent)) fontified nil)))
      org-find-open-clocks("/Users/patrick/Documents/org/notes.org")
      org-resolve-clocks()
      org-clock-in(nil)
      funcall-interactively(org-clock-in nil)
      call-interactively(org-clock-in record nil)
      command-execute(org-clock-in record)
      execute-extended-command(nil "org-clock-in")
      smex-read-and-run(("org-clock-in" "toggle-debug-on-error" "org-time-stamp-inactive" "org-agenda-clock-in" "org-time-stamp" "package-initialize" "org-roam-mode" "helm-M-x" "org-babel-tangle" "package-install" "package-autoremove" "load-theme" "compare-windows" "helm-projectile-ag" "org-archive-subtree" "comment-line" "package-delete" "org-capture" "ilog-show-in-new-frame" "org-refile" "eval-expression" "customize-group" "org-roam-find-file" "mc/mark-all-like-this" "package-list-packages" "iedit-mode" "list-packages" "org-clock-out" "helm-do-ag" "server-start" "balance-windows" "split-window-right" "org-roam-buffer-toggle-display" "org-mode" "org-roam" "load-file" "org-agenda" "describe-mode" "org-clock-goto" "save-some-buffers" "helm-projectile-grep" "helm-ag" "ido-mode" "customize" "helm-mode" "lisp-mode" "multi-occur" "org-version" "windmove-up" "desktop-save" ...))
      smex()
      funcall-interactively(smex)
      call-interactively(smex nil nil)
      command-execute(smex nil nil :special)
      xah-fly-M-x()
      funcall-interactively(xah-fly-M-x)
      call-interactively(xah-fly-M-x nil nil)
      command-execute(xah-fly-M-x)

Would anyone have a suggestion on how to figure out what I've broken?

Thank you for your time.

1 Answer 1

2

You probably have a bad time stamp in one of your Org mode files. In particular, the time stamp that causes the error is missing the dashes: 2020-09-23 Wed 13:41. The question is how to find the file that contains that time (non)stamp. Backtrace to the rescue:

...
org-find-open-clocks("/Users/patrick/Documents/org/notes.org")
...

That's where I would start looking: see if the string is in that file, fix it with dashes and you should be OK.

I would run M-x org-lint in that file (and eventually on every other Org mode file that you can get your hands on) to identify any more problems that might exist. In fact, run it before you fix it and see what it says.

How the bad time string ended up in there cannot be determined, except by you: did you enter the time stamp manually? If so, don't do that: use the helpful functions that Org mode provides, in particular org-time-stamp which is conveniently bound to C-c . and the scheduled/deadline versions org-schedule bound to C-c C-s and org-deadline bound to C-c C-d.

3
  • Thank you! I searched for the string 2020 09 23 and found the time stamp that was missing the the hyphens within a :LOGBOOK: drawer. This also helped me understand what I did wrong. I have recently swapped from Spacemacs to Xah-fly-keys and found a key called xah-cycle-hyphen-underscore-space yesterday accidentally as it's bound to the ' key. This will be when the time stamp was converted from dashes to spaces.
    – Patrick
    Sep 24, 2020 at 22:16
  • org-lint did not identify this issue. Seems like a handy function though. Thanks!
    – Patrick
    Sep 24, 2020 at 22:26
  • It is, but I guess it needs enhancement! Glad you found the problem.
    – NickD
    Sep 24, 2020 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.