Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can either move them to their own folder with the following code:</p> <pre><code>;; Don't clutter up directories with files~ (setq backup-directory-alist `(("." . ,(expand-file-name (concat dotfiles-dir "backups"))))) ;; Don't clutter with #files either (setq auto-save-file-name-transforms `((".*" ,(expand-file-name (concat dotfiles-dir "backups"))))) </code></pre> <p>Or you can remove them completely, like so:</p> <pre><code>(setq make-backup-files nil) (setq auto-save-default nil) </code></pre> <p>Personally I would be wary of removing them as they can come in useful. Further discussion is here: </p> <ul> <li><a href="http://www.emacswiki.org/emacs/BackupDirectory" rel="noreferrer">http://www.emacswiki.org/emacs/BackupDirectory</a></li> <li><a href="http://www.emacswiki.org/emacs/AutoSave" rel="noreferrer">http://www.emacswiki.org/emacs/AutoSave</a></li> </ul> <p>I would recommend checking out the <strong>emacs-starter-kit</strong> it sorts out a load of issues that people have when coming to emacs, and is pretty heavily used.</p> <p><a href="http://github.com/technomancy/emacs-starter-kit/blob/master/starter-kit-misc.el" rel="noreferrer">http://github.com/technomancy/emacs-starter-kit/blob/master/starter-kit-misc.el</a></p> <hr> <p>Update:</p> <p>There seems to be much confusion over how to use the functions. I'm going to have a little play around later but here is some more information. Note that <code>auto-save-file-name-transforms</code>:</p> <blockquote> <p>lets you specify a series of regular expressions and replacements to transform the auto save file name <a href="http://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Save-Files.html" rel="noreferrer">[emacs-manual]</a></p> </blockquote> <p>so it's not just as simple as adding in a folder name. That said it seems from a quick google search the following might just do what you all want:</p> <pre><code>;;; backup/autosave (defvar backup-dir (expand-file-name "~/.emacs.d/backup/")) (defvar autosave-dir (expand-file-name "~/.emacs.d/autosave/")) (setq backup-directory-alist (list (cons ".*" backup-dir))) (setq auto-save-list-file-prefix autosave-dir) (setq auto-save-file-name-transforms `((".*" ,autosave-dir t))) </code></pre> <p><a href="http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=auto-save-file-name-transforms&amp;sbtn=Search" rel="noreferrer">http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=auto-save-file-name-transforms&amp;sbtn=Search</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload