browsing a working directory full of files and their backups, cli or gui wise, was turning into an annoying vision.
So, finally i decided to make those backups go elsewhere!
With the help of the friendly irc ppl (#emacs in irc.freenode.org) and building on Ryan Barrett (from /snarfed.org) i came into this:
;; create an invisible backup directory and make the backups also invisable
(defun make-backup-file-name (filename)
(defvar backups-dir "./.backups/")
(make-directory backups-dir t)
(concat backups-dir "." (file-name-nondirectory filename) "~")
Put those lines in .emacs (on your home folder ‘~/’) and on the next time you start your emacs the backups will be placed inside a hidden folder (.backups) on the directory were your file is visited (opened) and these backups will also be hidden (.namefile~). So, if you are visiting /some/dir/somefile.el it will create /some/dir/.backups/.somefile.el~
simple isn’t it?
also i’ve learned to evaluate a function inside emacs:
M-x eval-defun RET
(place the cursor on the line of the function to be evaluated)
M-x toggle-debug-on-error RET will make emacs show up a backtrace if an error comes up