Mac – Hiding emacs backup files in Finder

emacsfilefinder

I would like to find a way to hide all the *~ files in Finder, which are used as backup files by Emacs. Is there a general approach to make Finder hide all the files with their names matching certain patterns? Thanks.

Best Answer

If you don't like all the #*# and *~ files floating around in your working directory, put the following elisp code in your .emacs file.

;; Put autosave files (ie #foo#) and backup files (ie foo~) in ~/.emacs-backups/.
(custom-set-variables
  '(auto-save-file-name-transforms '((".*" "~/.emacs-backups/autosaves/\\1" t)))
  '(backup-directory-alist '((".*" . "~/.emacs-backups/backups/"))))

;; create the autosave dir if necessary, since emacs won't.
(make-directory "~/.emacs-backups/autosaves/" t)

Reference: http://snarfed.org/gnu_emacs_backup_files

Related Question