Error loading org-timer module in emacs

I want to use the pomodoro technique in org mode, as described in http://orgmode.org/worg/org-gtd-etc.html

I added the following lines to the .emacs file

(add-to-list 'org-modules 'org-timer) (setq org-timer-default-timer 25) (add-hook 'org-clock-in-hook '(lambda () (if (not org-timer-current-timer) (org-timer-set-timer '(16))))) 

When emacs starts, the following warning is displayed in the warning buffer.

 Symbol value as variable is void: org-modules 

I am using the org-mode version - 7.7.291.g37db, which is cloned from git: //orgmode.org/org-mode.git

How to get rid of an error.

+6
source share
1 answer

org-modules is defined in org.el If you want to add an item to the list, you need to wait until a variable is defined (with the default list). One way to do this is to delay adding until org.el :

 (defun my-after-load-org () (add-to-list 'org-modules 'org-timer)) (eval-after-load "org" '(my-after-load-org)) 

Note that add-hook can handle a variable that is not yet defined, but add-to-list cannot. You can write (setq org-modules '(org-timer)) , but this will replace the default list of modules instead of adding to it.

+8
source

Source: https://habr.com/ru/post/897785/


All Articles