summaryrefslogtreecommitdiffstats
path: root/lisp/ravi-init-files.el
diff options
context:
space:
mode:
authorRavi R Kiran <aine.marina@gmail.com>2015-10-23 18:57:59 (GMT)
committerRavi R Kiran <aine.marina@gmail.com>2015-10-23 18:57:59 (GMT)
commitcd1924466152177ea06b17c843f256463c1b91b8 (patch)
treeaf90afe028e5e392f242a3ea36302aafe1c1769d /lisp/ravi-init-files.el
parent5561df232cfa49822f322196d98170f95aa1139e (diff)
parent74c319ef12dd3130f6afc17abc59404b59d601d1 (diff)
downloaddotemacs-cd1924466152177ea06b17c843f256463c1b91b8.zip
dotemacs-cd1924466152177ea06b17c843f256463c1b91b8.tar.gz
dotemacs-cd1924466152177ea06b17c843f256463c1b91b8.tar.bz2
Merge branch 'master' into rtags-attempt
* master: (139 commits) Add pdf-tools as a nicer replacement for doc-view Add pdf-tools submodule Fix maildir data with correct path Add desktop notifications for email Potential use for modes without repls Attach files more easily in mu Update to newest version of mu Please remove tooltips after a while, please ace-window gets confused when tooltips are present Sometimes the dispatch list does come in handy Pre-populate searches Succumb to muscle memory of control keys Remove ropemacs due to disuse Do not let company-quickhelp steal a global key Manage word navigation Use proper helm function to replace completing-read Electric operators on python mode Use which-key in preference to guide-key Navigate easier Simplify config with magit 2.1.0 ...
Diffstat (limited to 'lisp/ravi-init-files.el')
-rw-r--r--lisp/ravi-init-files.el159
1 files changed, 159 insertions, 0 deletions
diff --git a/lisp/ravi-init-files.el b/lisp/ravi-init-files.el
new file mode 100644
index 0000000..9ac482d
--- /dev/null
+++ b/lisp/ravi-init-files.el
@@ -0,0 +1,159 @@
+;;; ravi-init-files.el --- file-handling
+
+;; Copyright (C) 2013
+
+;; Author: <ravi@nero.lan>
+;; Keywords:
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; File handling
+
+;;; Code:
+
+(setq auto-save-list-file-prefix (ravi/emacs-file "past/auto-save-list/.saves-"))
+(setq delete-auto-save-files t)
+(setq dired-listing-switches "-Flag")
+(setq completion-ignored-extensions
+ (append completion-ignored-extensions
+ (quote (".bak" ".#*#" ".ps" ".pdf"))))
+
+;; Auto refresh buffers
+(global-auto-revert-mode 1)
+
+;; Also auto refresh dired, but be quiet about it
+(setq global-auto-revert-non-file-buffers t)
+(setq global-auto-revert-ignore-modes '(TeX-output-mode))
+(setq auto-revert-verbose nil)
+
+;; Transparently open compressed files
+(auto-compression-mode t)
+
+;; UTF-8 please
+(setq locale-coding-system 'utf-8) ; pretty
+(set-terminal-coding-system 'utf-8) ; pretty
+(set-keyboard-coding-system 'utf-8) ; pretty
+(set-selection-coding-system 'utf-8) ; please
+(prefer-coding-system 'utf-8) ; with sugar on top
+
+(setq history-length 100)
+(setq savehist-file (ravi/emacs-file "past/history"))
+(savehist-mode 1)
+(setq history-delete-duplicates t)
+
+(require 'saveplace)
+(setq-default save-place t)
+(setq save-place-file (ravi/emacs-file "past/places"))
+
+(use-package recentf
+ :init
+ (progn
+ (setq recentf-save-file (ravi/emacs-file "past/recentf"))
+ (setq recentf-max-saved-items 100) ;; just 20 is too recent
+ )
+ :config
+ (progn
+ (add-to-list 'recentf-exclude "/COMMIT_EDITMSG$")
+ (add-to-list 'recentf-exclude "/kmail[[:alnum:]]*\\.tmp$")
+ (add-to-list 'recentf-exclude "/elpa/.*/*-autoloads.el$")
+ ))
+
+(require 'uniquify)
+(setq uniquify-buffer-name-style 'post-forward)
+(setq uniquify-after-kill-buffer-p t) ; rename after killing uniquified
+(setq uniquify-ignore-buffers-re "^\\*") ; don't muck with special buffers
+
+(setq minibuffer-completion-confirm t)
+(setq find-file-confirm-nonexistent-file t)
+(setq find-file-visit-truename t)
+
+;; Automatic loading of file trees
+(defun ravi-check-dir-accessible-p (name)
+ "Check whether NAME is accessible as a directory"
+ (let* ((topname (file-name-as-directory name))
+ (name-exists (and (file-exists-p topname)
+ (file-directory-p topname)
+ (file-accessible-directory-p topname)
+ topname)))
+ name-exists
+ ))
+
+(defun ravi-filecache-add-tree (root recursive simple)
+ "Add list of directories to filecache for easy opening.
+ROOT is the root of the tree to be added. RECURSIVE is a list of
+relative paths whose subdirectories are added recursively, while
+relative paths in SIMPLE are added non-recursively. If a path does
+not exist, it is not added to the filecache."
+
+ (let ((topname (ravi-check-dir-accessible-p root))
+ (dirval nil))
+ (when topname
+ (dolist (dir recursive)
+ (setq dirval (ravi-check-dir-accessible-p
+ (expand-file-name dir topname)))
+ (and dirval
+ (file-cache-add-directory-recursively dirval)))
+ (dolist (dir simple)
+ (setq dirval (ravi-check-dir-accessible-p
+ (expand-file-name dir topname)))
+ (and dirval
+ (file-cache-add-directory dirval)))
+ )))
+
+;; Write backup files to own directory
+(make-directory (ravi/emacs-file "past/backups/") t)
+(setq backup-by-copying t)
+(setq backup-directory-alist
+ `(("." . ,(ravi/emacs-file "past/backups/"))
+ (,tramp-file-name-regexp nil)))
+
+;; Make backups of files, even when they're in version control
+(setq vc-make-backup-files t)
+
+;; Git/svn/etc. projects
+(use-package projectile
+ :init
+ (progn
+ (use-package pkg-info
+ :ensure t
+ )
+ (setq projectile-known-projects-file
+ (ravi/emacs-file "past/projectile-bookmarks.eld"))
+ )
+ :config
+ (progn
+ (projectile-global-mode)
+
+ (when (and (boundp 'ravi/use-helm-instead-of-ido) ravi/use-helm-instead-of-ido)
+
+ (setq projectile-completion-system 'helm)
+
+ (use-package helm-projectile
+ :config
+ (helm-projectile-on)
+ :ensure t)
+ ))
+ :diminish projectile-mode
+ :ensure t
+ )
+
+;; Use emacsclient as external editor for kmail
+(add-to-list 'auto-mode-alist
+ (cons (concat temporary-file-directory ".*/kmail[[:alnum:]]*.tmp\\'") 'message-mode))
+(setq gnus-message-highlight-citation t)
+
+(provide 'ravi-init-files)
+;;; ravi-init-files.el ends here