I added this function to my org conf ;; We also want to check that this is actually in base directories (defun org-add-eventually() "Adding a file to org-agenda when saved, with" (interactive) (if (string= major-mode "org-mode") (org-agenda-file-to-front)))
;;TODO: Check if a file is contained in some subdirectories (add-hook 'before-save-hook 'org-add-eventually) Looks like it's working and it's really nice, but now I have something writing a very long list in my init.el (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(org-agenda-files (quote ("~/org/tobuy.org" "/Users/andrea/Documents/calzitex/documentazione/doc.org" "/U... Who is writing it? And by the way I was thinking exactly to a way to "pickle" the list every time I quit emacs. Given that I only add files with emacs when I restart it would be nice to just read the list instead of generating it. Is that sufficient to write a "(setq org-agenda-files "...") every time I save a new org-file or there are smarter ways (like pickling/marshalling for example)? Thanks _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode