Use write-file-functions
Merge branch 'master' of https://github.com/peterbreton/emacs-tree