Emacs and Dropbox

28 10 2008

Emacs usually creates backup files(filename~) and autosave files(#filename#)
when you modify existing text files.

In my opinion, this behavior is not optimum for Dropbox folder because

  1. The Dropbox folder is already version controlled, so you don’t need backup copies
  2. Frequent writes to a remote folder result in waste of network bandwidth

These elisp configurations prevents Emacs from creating backup and autosave files
inside the Dropbox folder.

Don’t create backup files.

(setq backup-enable-predicate
      (lambda (name)
        (not (string-match "Dropbox" name))))

Create autosaves under /tmp/jgoamakf.

(setq auto-save-file-name-transforms '((".*/Dropbox/.*" "/tmp/jgoamakf/\\1" t)))