In my current setup, I sometimes start emacs with some directories in which I keep my org-mode files, not existing. I.e. for work I use encrypted files, so for example, my ~/projects/foobar/notes doesn't exist, because my ~/projects/foobar directory is empty (because the disk is not mounted into it).

Because of that, when I start emacs and my ~/projects/foobar it not mounted, I get the message:

Non-existent agenda file `~/projects/foobar/notes`. [R]emove from list or [A]bort?

And both options are no good. Abort it obviously not what I want, and Remove removes the directory permamently (by adding org-agenda-files into custom-set-variables section without that directory), so when I later run emacs with disk mounted, the files are not loaded. I need to edit my emacs config, remove that automatically added org-agenda-files in custom-set-variables section, save, exit, restart emacs.

Is there a way to tell org-mode to ignore if the file doesn't exist and just proceed with the files which exists? Ideally, they would be picked up after I refresh agenda, but I can live with being forced to reinitialize my agenda (C-c a a)

1 Answer 1


Customize org-agenda-skip-unavailable-files and set it to t.

C-h v org-agenda-skip-unavailable-files says (note that I've customized my setting to t already):

org-agenda-skip-unavailable-files is a variable defined in ‘org.el’.

Its value is t
Original value was nil

Non-nil means to just skip non-reachable files in ‘org-agenda-files’.
A nil value means to remove them, after a query, from the list.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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