(menu-bar-mode -1) (font-lock-mode t) ;; Shut off message buffer (setq message-log-max nil) (kill-buffer "*Messages*") ;; Error trace on .emacs loading failure (setq debug-on-error t) ;; Set garbage collection hundred times the default, supposedly speeds up startup time (setq gc-cons-threshold 50000000) ;; Ask me whether I want to close. No more accidents. ;; http://www.dotemacs.de/dotfiles/KilianAFoth.emacs.html (global-set-key [(control x) (control c)] (function (lambda () (interactive) (cond ((y-or-n-p "Quit? ") (save-buffers-kill-emacs)))))) ;; C-x C-k should be the same as C-x k (global-set-key "\C-x\C-k" 'kill-this-buffer) ;; Don't echo passwords when communicating with interactive programs (add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt) ;; Use ANSI colors within shell-mode (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) ;; Disable over-write mode (put 'overwrite-mode 'disabled t) ;; Paste at cursor, not mouse (setq mouse-yank-at-point t) ;; Activate font-lock-mode (global-font-lock-mode t) ;; Maximum colors (setq font-lock-maximum-decoration t) ;; Change backup behavior to save in a directory, and not screw up my filesystem (setq backup-by-copying t ; don't clobber symlinks backup-directory-alist '(("." . "~/.saves")) ; don't litter my fs tree delete-old-versions t kept-new-versions 6 kept-old-versions 2 version-control t) ; use versioned backups ;; Fix the whole huge-jumps-scrolling-between-windows nastiness (setq scroll-conservatively 5) ;; "Don't hscroll unless needed"- ? More voodoo lisp. (setq hscroll-margin 1) ;; Keep cursor in the same relative row during page up / down (setq scroll-preserve-screen-position t) ;; Start scrolling when 2 lines from top/bottom (setq scroll-margin 2) ;; Push mouse out of the way when the cursor approaches (mouse-avoidance-mode 'jump) ;; SavePlace - this puts the cursor in the last place you edited ;; a particular file. Very useful for large files. (require 'saveplace) (setq-default save-place t) ;; This apparently allows seamless editting of files in a tar/jar/zip ;; file. (auto-compression-mode 1) ;; Highlight regions so one can see what one is doing (transient-mark-mode 1) ;; We can get completion in the mini-buffer as well (icomplete-mode t) ;; Text files should end in newlines (setq require-final-newline t) ;; Autocompile .emacs (defun autocompile nil "compile itself if ~/.emacs" (interactive) (require 'bytecomp) (if (string= (buffer-file-name) (expand-file-name (concat default-directory ".emacs"))) (byte-compile-file (buffer-file-name)))) (add-hook 'after-save-hook 'autocompile) ;; Always remember, the StumpWM dotfile is in lisp (setq auto-mode-alist (cons '(".stumpwmrc$" . lisp-mode) auto-mode-alist)) ;; Set Home and End keys (global-set-key [home] 'beginning-of-buffer) (global-set-key [end] 'end-of-buffer) ;; Set easy buffer scrolling, like in Conkeror (global-set-key (kbd "M-n") 'next-buffer) (global-set-key (kbd "M-p") 'previous-buffer) ;; Set up load path (add-to-list 'load-path "/usr/local/lib/emacs/site-lisp") (add-to-list 'load-path "/usr/local/share/emacs/site-lisp") ;; Clojure (require 'clojure-mode) ;; (add-to-list 'load-path "/usr/local/lib/emacs/site-lisp/swank-clojure") ;; (require 'swank-clojure-autoload) ;; Slime (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/slime") (setq inferior-lisp-program "/usr/local/bin/sbcl") (require 'slime) (slime-setup) (global-set-key [f1] 'slime-documentation) ;; VM (autoload 'vm "vm" "Start VM on your primary inbox." t) (autoload 'vm-other-frame "vm" "Like `vm' but starts in another frame." t) (autoload 'vm-visit-folder "vm" "Start VM on an arbitrary folder." t) (autoload 'vm-visit-virtual-folder "vm" "Visit a VM virtual folder." t) (autoload 'vm-mode "vm" "Run VM major mode on a buffer" t) (autoload 'vm-mail "vm" "Send a mail message using VM." t) (autoload 'vm-submit-bug-report "vm" "Send a bug report about VM." t) ;; (shell-command "fetchmail") (setq vm-spool-files '("~/mail/inbox") vm-quit-hook 'vm-expunge-folder vm-mode-hook #'(lambda () (shell-command "fetchmail"))) (setq inhibit-startup-message t) (defalias 'yes-or-no-p 'y-or-n-p) ;; UTF-8 (setq slime-net-coding-system 'utf-8-unix) (set-language-environment 'utf-8) (prefer-coding-system 'utf-8) ;; Browsing (setq browse-url-generic-program "conkeror") ;; Forth (load-library "gforth.el") (autoload 'forth-mode "gforth.el") (setq auto-mode-alist (cons '("\\.fs\\'" . forth-mode) auto-mode-alist)) (autoload 'forth-block-mode "gforth.el") (setq auto-mode-alist (cons '("\\.fb\\'" . forth-block-mode) auto-mode-alist)) (add-hook 'forth-mode-hook (function (lambda () (setq forth-indent-level 4) (setq forth-minor-indent-level 2) (setq forth-hilight-level 3)))) ;; ColorTheme (add-to-list 'load-path "/usr/local/lib/emacs/site-lisp/color-theme") (load-library "color-theme.el") ;; Scala (require 'scala-mode-auto) (put 'downcase-region 'disabled nil)