First Things in my .emacs

Pardon the extra linebreaks. I don’t normally format my lisp code this way, but the layout of my blog makes this snippet linewrap and hard to read.

(global-font-lock-mode t)

(defvar autosave-dir "~/.emacs.d/autosave")
(make-directory autosave-dir t)

(defun auto-save-file-name-p (filename)
  (string-match "^#.*#$"
                     (file-name-nondirectory filename)))

(defun make-auto-save-file-name ()
  (concat autosave-dir
          (if buffer-file-name
              (concat "#"
                         (file-name-nondirectory buffer-file-name)
                         "#")
            (expand-file-name (concat "#%"
                                                 (buffer-name)
                                                 "#")))))

(defvar backup-dir "~/.emacs.d/backup")
(make-directory backup-dir t)
(setq backup-directory-alist (list (cons "." backup-dir)))

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>