5

Is there a way to make the list of recently clocked-in tasks in org-mode persistent across Emacs restarts and (more importantly) closed buffers? It's annoying having to find the previous task just because I happened to exit a file.

  • 1
    org-clock-default-task is a marker. I guess I want a permanent marker. – unhammer Jan 5 '16 at 8:53
  • This would indeed be useful. – OrgAddict Jan 12 '16 at 16:14
4

I made a little package org-mru-clock to solve this.

When I run org-mru-clock-select-recent-task or org-mru-clock-in it finds all recently-clocked-in tasks from org files and stores the top org-mru-clock-how-many in org-history; that takes about 5 seconds, so it doesn't do anything if org-history already has that many entries. This is nicer than saving to disk, since I have the org files version controlled, and the initial 5 second wait is acceptable.

I use it with ivy; my init.el has this:

(use-package org-mru-clock
  :ensure t
  :defer t
  :bind* (("<f8>" . org-mru-clock-in))
  :commands (org-mru-clock-in org-mru-clock-select-recent-task)
  :config
  (setq org-mru-clock-how-many 50
        ;;;;;;;;;;;;;; Also possible: #'ido-completing-read
        org-mru-clock-completing-read #'ivy-completing-read))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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