It seems that org-timer (org-clock) slows down Emacs when I display it in the mode line. Is there a way for it to not affect the speed while I keep it running and visible in the mode line? e.g. by changing the update speed? Currently I can see it count every second in the mode line. Or is there an lighter alternative?

  • 1
    I'm curious how you notice this slow-down? – JeanPierre Feb 19 '16 at 8:50

This does not seem to be configurable. In org-timer.el the function org-timer-set-mode-line ends with:

(when org-timer-display
  (setq org-timer-mode-line-timer
    (run-with-timer 1 1 'org-timer-update-mode-line))))))

In you really want to change that, you could edit this file to change both 1 to eg 10 if you want the display to be updated only every 10 seconds.

Beware this change will be overriden next time you update your emacs installation, though. Alternatively, you could copy the function in another file, make the modification there and ensure this is loaded after org-timer.el, so that your modified version overrides the original one. Beware any other changes in future versions of the function will be overriden by your modified version, though.

As suggested by @phils, a better way would be to define an after advice to the function, cancelling the timer and restarting it with the chosen values:

(defun my/change-org-timer (&optional restart no-insert-p)
  (when org-timer-display
    (cancel-timer org-timer-mode-line-timer)
    (setq org-timer-mode-line-timer
      (run-with-timer 3 3 'org-timer-update-mode-line))))

(advice-add 'org-timer-set-mode-line :after #'my/change-org-timer)
| improve this answer | |
  • After-advice to that function could be used to cancel that timer and set a new one. Or report it as a bug, and suggest that it be made configurable. – phils Feb 19 '16 at 10:49

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.