Xavier Maillard <x...@gnu.org> writes: > Care to share it with us ? >
Of course with pleasure, it's quite simple but very nice --8<---------------cut here---------------start------------->8--- (defun org-add-eventually() "Adding a file to org-agenda when saved" (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) --8<---------------cut here---------------end--------------->8--- org-agenda-file-to-front as someone said use the customization thing, so your agenda-files variable will be written at the end of .emacs/init.el or wherever you have it. It works quite well, then if you remove some files the next time you see the agenda it will just ask you if you want to remove them from the agenda as well, fairly simple then. See http://github.com/AndreaCrotti/Emacs-conf/blob/master/.emacs.d/conf/org.el for my full emacs configuration (that file linked is only for org-mode). _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode