Change everything.
[emacs.d.git] / lisp / os-rc.el
blobf672cf9b1db521c354f50346eadd58764df24d9a
1 ;;; A simple rc to configure Emacs' interface with the host OS.
3 ;;; No ad-hoc (sometimes redundant) versioning.
4 (setq make-backup-files nil)
6 ;;; Use clobbering sessions.
7 (setq desktop-dirname "~/.emacs.d/"
8 desktop-save t
9 desktop-load-locked-desktop t)
11 (desktop-save-mode)
13 ;;; Restoring a session sometimes opens a file with unsafe file local
14 ;;; variables. Emacs' default behavior is to ask the user for
15 ;;; confirmation except when run in batch mode where "it can't really
16 ;;; ask you so it assumes the answer n". "it can't really ask you" is
17 ;;; also the case in some startup situations, but Emacs still does
18 ;;; anyway, which blocks the startup process. Specifically, in the
19 ;;; situation where desktop-read is executed before window-setup-hook
20 ;;; (as is the case when desktop-save-mode is turned on), Emacs should
21 ;;; not ask the user about unsafe file local variables. Hence this
22 ;;; hack.
23 (setq enable-local-variables :safe)
24 (add-hook 'after-init-hook (lambda () (setq enable-local-variables t)))
26 ;;; User local info manuals.
27 (eval-after-load "info"
28 '(add-to-list 'Info-additional-directory-list "~/share/info/"))
30 ;;; Non system site-lisp for a system Emacs.
31 (add-to-list 'load-path "/usr/local/share/emacs/site-lisp")
33 ;;; Packages should be loadable without the package feature.
34 (let ((default-directory "~/.emacs.d/elpa"))
35 (when (file-exists-p default-directory)
36 (normal-top-level-add-subdirs-to-load-path)))
38 (prefer-coding-system 'utf-8)
40 ;;; More useful is to reuse the existing frame when responding to
41 ;;; GNUstep or Cocoa open file events.
42 (setq ns-pop-up-frames nil)
44 ;;; Oddly, the environment PATH and exec-path may differ after loading
45 ;;; e.g. on Mac OS X.
46 (setq exec-path (delete-dups (append (yard-get-environment-path) exec-path)))
48 (global-set-key (kbd "C-c r") 'yard-root-find-file)
49 (global-set-key (kbd "C-c c") 'save-buffers-kill-emacs)