myotis
myotis

Reputation: 423

Org mode: problem with computer dependent loading of .org files

I have my org mode agenda files (.org) on dropbox, and use them from different computers with different user-login-names. Hence, when listing mye agenda files I use the following command, where the user-login-name is a variable

(setq org-agenda-files '((format "c:/Users/%s/Dropbox/todo.org" user-login-name)) )

However, the commad does not work. When trying to extract my agenda, emacs does not find any of the org files, and therefor non of my todos.

Whats wrong with my command above?

Upvotes: 1

Views: 55

Answers (1)

8n8
8n8

Reputation: 1382

The problem with your command is that the quote mark is stopping the evaluation of the elements in the list. So it will cause org-agenda-files to be literally

((format "c:/Users/%s/Dropbox/todo.org" user-login-name))

when it should be a list of strings. Try this instead:

(setq org-agenda-files (list (format "c:/Users/%s/Dropbox/todo.org" user-login-name)) )

Upvotes: 1

Related Questions