From e215cd454fc29d07787be5c6819c27b02a2ce88e Mon Sep 17 00:00:00 2001 From: finga Date: Sun, 20 Sep 2015 00:08:37 +0200 Subject: [PATCH] handling autosaves --- .emacs.d/init.el | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 8f491fa..b708378 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -14,6 +14,10 @@ '(show-paren-mode t) '(tool-bar-mode nil)) +;; Use UTF-8 for file name encoding +(setq file-name-coding-system 'utf-8) +(prefer-coding-system 'utf-8) + ;; No fancy graphic stuff (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) (if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) @@ -62,17 +66,30 @@ ;; No am/pm here (setq display-time-24hr-format t) +;; enable some commands disabled by default +(put 'narrow-to-region 'disabled nil) +(put 'upcase-region 'disabled nil) (put 'downcase-region 'disabled nil) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(default ((t (:family "DejaVu Sans Mono" :foundry "unknown" :slant normal :weight normal :height 98 :width normal))))) +;; disable backups when using su or sudo +(setq backup-enable-predicate + (lambda (name) + (and (normal-backup-enable-predicate name) + (not + (let ((method (file-remote-p name 'method))) + (when (stringp method) + (member method '("su" "sudo")))))))) + +;; save autobackups to ~/.emacs.d/backups +(add-to-list 'backup-directory-alist + (cons "." "~/.emacs.d/backups/")) +(setq tramp-backup-directory-alist backup-directory-alist) + +;; arduino mode ''(add-to-list 'load-path "~/.emacs.d/vendor/arduino-mode") (setq auto-mode-alist (cons '("\\.\\(pde\\|ino\\)$" . arduino-mode) auto-mode-alist)) (autoload 'arduino-mode "arduino-mode" "Arduino editing mode." t) + (add-to-list 'load-path "~/.emacs.d/lisp") (setq-default x-stretch-cursor t)