From c4001ccd1864293b64aa37d83a9d9457eb875e70 Mon Sep 17 00:00:00 2001
From: Chizi123 <joelgrun@gmail.com>
Date: Sat, 17 Nov 2018 12:52:56 +0000
Subject: [PATCH] added command to remove backup files

---
 custom/setup-environment.el |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/custom/setup-environment.el b/custom/setup-environment.el
index cb2bd49..125e410 100644
--- a/custom/setup-environment.el
+++ b/custom/setup-environment.el
@@ -12,3 +12,10 @@
 
 (add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
 (load-theme 'zenburn t)
+
+;; remove backup files
+(when (eq system-type 'windows-nt)
+  (defadvice backup-buffer (after my-backup-make-hidden activate)
+    (let ((backup-file-name (make-backup-file-name (buffer-file-name))))
+      (when (file-exists-p backup-file-name)
+	(call-process "attrib.exe" nil nil nil "+I" "+H" backup-file-name)))))

--
Gitblit v1.9.3