Commits

kurtharriger  committed f4aa674

revert to old autosave method + first-change

  • Participants
  • Parent commits 4499a79

Comments (0)

Files changed (4)

File init.d/60-auto-save.el

+(defvar autosave-dir
+ (concat dotfiles-dir "autosaves/"))
+(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) "#")))))
+
+
+;; Keep emacs in sync with file system and vs versa
+(setq auto-save-list-file-prefix nil)
+(setq auto-save-interval 0)
+(setq auto-save-timeout 1)
+(global-auto-revert-mode t)
+
+;; (setq auto-save-visited-file-name t) doesn't seem to work, try hook instead
+(setq auto-save-visited-file-name t)
+(defun save-buffer-if-visiting-file (&optional args)
+  "Save the current buffer only if it is visiting a file"
+  (interactive)
+  (if (buffer-file-name)
+      (save-buffer args)))
+
+(defun make-auto-save-file-name ()
+  nil)
+
+(defun make-auto-save-file-name-p ()
+  nil)
+
+
+(add-hook 'auto-save-hook 'save-buffer-if-visiting-file)
+(add-hook 'first-change-hook 'save-buffer-if-visiting-file)

File init.d/70-auto-save.el

-
-(setq backup-inhibited t)
-(setq auto-save-default nil)
-(global-auto-revert-mode t)
-(add-hook 'first-change-hook 'save-buffer )
-

File init.d/80-font.el

-(set-face-attribute 'default nil :height 160)
+(set-face-attribute 'default nil :height 120)
+(set-face-attribute 'default nil :font "FixedSys")
+

File init.d/90-slime.el

 (defun slime-bootstrap-clojure ()
   (interactive)
   (slime-interactive-eval
-   "(use 'clojure.repl)
-    (use 'clojure.reflect)
-    (use 'clojure.pprint)
+   "(require '[clojure.java.io :as io])
+    (require '[clojure.walk :as walk])
+    (require '[clojure.repl :as repl])
+    (require '[clojure.reflect :as reflect])
+    (require '[clojure.pprint :as pprint])
     (require '[clojure.string :as string])"))
 
 (defun clojure-mode-slime-font-lock ()
-            (require 'clojure-mode)
-            (let (font-lock-mode)
-              (clojure-mode-font-lock-setup)))
+  (require 'clojure-mode)
+  (paredit-mode)
+  (let (font-lock-mode)
+    (clojure-mode-font-lock-setup)))
 
 (add-hook 'slime-repl-mode-hook 'clojure-mode-slime-font-lock)
 (add-hook 'slime-connected-hook 'slime-bootstrap-clojure)