I'm trying to make a little script that will allow me to list and clock in on recent tasks from the command line, so that I can put it into an Argos script and have it be basically have it be an org clock GNOME shell extension. I noticed that there's the variable org-clock-history which is a list of markers. And I'm guessing markers are character offsets? So I might be able to translate those markers into headings, and so forth. But there must be an easier way, I'm guessing.

So, is there a way to get a list of recently clocked tasks (i.e., headings) from the org-mode clock? I've discovered that I can run emacsclient --eval '(elisp here)' to run elisp. Now all I have to do is figure out what to put in there.

  • See the chapter on markers in the Emacs Lisp manual and more particularly the section on information from Markers in that chapter.
    – NickD
    Sep 25, 2020 at 1:31
  • What should I be looking for there? I don't see anything relevant
    – Jonathan
    Sep 25, 2020 at 4:45
  • org-clock-history is a list of markers. For each of those markers you can get the relevant buffer and the position in the buffer using the functions on that page.
    – NickD
    Sep 25, 2020 at 12:46
  • Ok, but then you have the position in the buffer, and the buffer, but how does that help me to get a list of clocked tasks from the command line?
    – Jonathan
    Sep 26, 2020 at 21:16


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.

Browse other questions tagged or ask your own question.