From Wikipedia, the free encyclopedia
;; -*- mode: lisp; -*-
;.emacs.el --- my own .emacs
;Copyright (C) 2006 by gwern branwen
;License: Public domain
;When: Time-stamp: "2007-01-28 23:04:31 gwern"
;Keywords: local,customization,Emacs,dot
;Commentary
;;This is divided into three sections. The first section sets and modifies
;;Emacs directly, invoking and tweaking packages and settings that
;;come with your vanilla Emacs CVS, such as scrolling or changing
;;key bindings. The second section loads all my downloaded Elisp files,
;;and sets them up. The third section contains some oddities. The fourth contains
;;Customize's settings. (This numbering isn't counting the ToDo section).
;;That's the smallest section, since I did most of this by hand.
;TOC
;;1: TODO
;;2: Emacs customizations in general
;;3: PACKAGES
;;4: MISC
;;5: CUSTOM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;TODO;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;work in powermacro <http://www.blackie.dk/emacs/>
;work in linkd? <http://dto.freeshell.org/notebook/Linkd.html>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;Emacs customizations in general
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;This is generally for everything that can be easily done with defuns
;;;or for customizations to Emacs proper, not merely adding in new stuff.
;;;Tested with Debian's snapshot package; should largely work on 21 as well.
;;Helpful error messages are great things. This'll be unset at the end.
(setq debug-on-error t)
;;We live dangerously and fast here in Emacs-land.
(declare (optimize (safety 0) (speed 3) (debug 1)))
;;Neat Lisp machine font for the win! Kudos to:
;;<http://www.eurogaran.com/downloads/lispmfont/>
;;BTW: you'll see the (if window-system etc sprinkled throughout.
;;That's equivalent to saying load this package/do this ONLY if there is a GUI such as X Window.
;;This avoids some errors and avoids loading some stuff which just doesn't look good
;;in a terminal window.
(if
(not (condition-case nil ;We try to see if the font exists. If it does not, it'll error out and return t.
(fontset-info "fontset-lispm")
(error nil)))
(create-fontset-from-fontset-spec ;We know the font does not exist, so we must create it.
"-lispm-fixed-medium-r-normal-*-13-*-*-*-*-*-fontset-lispm, ascii:-lispm-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*, latin-iso8859-1:-lispm-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*, latin-iso8859-15:-lispm-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*" t))
;;Now that the fontset has been defined, it can be invoked.
(if window-system
(set-default-font "fontset-lispm")
)
;;Since I use a modern Debian setup, UTF-8 is no problem, and this should guarantee that
;;Wikipedia articles won't get borked.
(set-language-environment "UTF-8")
(set-buffer-file-coding-system 'utf-8)
;;A more pointed error message.
(when (featurep 'xemacs)
(error "This .emacs file (probably) does not work with XEmacs."))
;;Add the directory I keep all my special .el files in into the
;;default load path.
(setq load-path (cons "~/.emacs.d/" load-path))
;;A fun start-up message, somewhat reminiscent of "The Matrix".
(defun emacs-reloaded ()
(animate-string (concat ";; Initialization successful. Welcome to "
(substring (emacs-version) 0 16)
".")
0 1)
(newline-and-indent))
(add-hook 'after-init-hook 'emacs-reloaded)
;;I've seen this in a few other .emacs, and it doesn't seem to do
;;anything *bad*...
(random t)
;;Do without those obnoxious startup messages- the whole GNU Emacs logo
;;thing, that is.
(setq inhibit-splash-screen t
inhibit-startup-echo-area-message t)
;;Might as well limit how many messages fill up in the message buffer.
;;Not that we'll ever get that many, but just in case!
(setq message-log-max 1000)
;;Enable the bell- but make it visible and not aural.
(setq visible-bell t)
;;Modify the mode-line as well. This is a cleaner setup than the
;;default settings for the mode-line.
(setq default-mode-line-format
'("-"
mode-line-mule-info
mode-line-modified
mode-line-frame-identification
mode-line-buffer-identification
" "
global-mode-string
" %[(" mode-name mode-line-process minor-mode-alist "%n"
")%]--"
(line-number-mode "L%l--")
(column-number-mode "C%c--")
(-3 . "%p")
"-%-"))
;;While we are getting rid of stuff, let's get rid of the buttons.
;;The menu is useful, so we will keep that (can be accessed by C-right click), but the
;;buttons are redundant with the menu options, and I know most of the keybindings
;;for the buttons, anyway.
(tool-bar-mode -1)
;(set-scroll-bar-mode nil)
(menu-bar-mode -1)
;;Rearrange the menubars, so it goes tools buffers help.
(setq menu-bar-final-items '(tools buffer help-menu))
;;I can't stop killing! Shut off message buffer. Note - if you need
;;to debug emacs, comment these out so you can see what's going on.
(kill-buffer "*Messages*")
;;Let's not have too-tiny windows.
(setq window-min-height 3)
;;This sets garbage collection to hundred times of the default.
;;Supposedly significantly speeds up startup time. (Seems to work
;;for me, but my computer is pretty modern. Disable if you are on
;;anything less than 1 ghz).
(setq gc-cons-threshold (* 1024 1024 30))
;;Don't echo passwords when communicating with interactive programs-
;;basic security.
(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)
;;Enable narrowing of regions
(put 'narrow-to-region 'disabled nil)
;;Allow a command to erase an entire buffer
(put 'erase-buffer 'disabled nil)
;;Change pasting behavior. Normally, it pastes where the mouse
;;is at, which is not necessarily where the cursor is. This changes
;;things so all pastes, whether they be middle-click or C-y or menu,
;;all paste at the cursor.
(setq mouse-yank-at-point t)
;;Activate font-lock-mode. Syntax coloring, yay!
(global-font-lock-mode t)
;;While we are at it, always flash for parens.
(show-paren-mode 1)
(setq show-paren-delay 0)
;;The autosave is typically done by keystrokes, but I'd like to save
;;after a certain amount of time as well.
(setq auto-save-timeout 180)
;;What would life be like if there were only saving, and never killing?
;;These two settings tell emacs to, every midnight, kill regular buffers
;;which haven't been used in a while.
;;<http://www.gnu.org/software/emacs/manual/html_node/Kill-Buffer.html>
(setq midnight-mode t)
;;Change backup behavior to save in a directory, not in a miscellany
;;of files all over the place.
(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
;;While we are thinking about symlinks, I don't like being asked
;;whether I want to follow a symlink; I do, already!
(setq vc-follow-symlinks t)
;;Come to think of it, version control programs like data
;;on who was making those changes.
(setq change-log-default-name "ChangeLog"
user-full-name "Gwern Branwen"
user-mail-address "postmaster@localhost")
;;This is kinda like RCS tags; records last modification date
;;in the file, if it has either in the first 8 lines:
;; Time-stamp: <>
;;; Time-stamp: " "
(add-hook 'before-save-hook 'time-stamp)
(add-hook 'write-file-hooks 'time-stamp)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;;Set the directory abbreviations are to be set in, and have abbrevs
;;auto-save itself and not ask questions.
;(setq abbrev-file-name "~/.emacs.d/abbrev_defs")
;(add-hook 'text-mode-hook (lambda () (abbrev-mode 1)))
;(setq save-abbrevs t)
;;Don't bother entering search and replace args if the buffer is
;;read-only. Duh.
(defadvice query-replace-read-args (before barf-if-buffer-read-only
activate)
"Signal a `buffer-read-only' error if the current buffer is
read-only."
(barf-if-buffer-read-only))
;;This starts up a server automatically, so it will be running to
;;accept things like wikipedia articles.
(server-start)
;;"To open the files designated by emacsclient in their own frame,
;;you can use the following hook as a Server Switch Hook which
;;can be setup in customize-group <RET> Server <RET>, or in your .emacs, as such:"
;;<http://www.emacswiki.org/cgi-bin/wiki/EmacsClient>
(if window-system
(add-hook 'server-switch-hook
(lambda nil
(let ((server-buf (current-buffer)))
(bury-buffer)
(switch-to-buffer-other-frame server-buf))))
)
;;"You might also want to close the frame when you're done with it.
;;To do this, setup a Server Done Hook in the same section to call delete-frame."
(if window-system
(add-hook 'server-done-hook 'delete-frame))
;;"I also like emacs to cleanup stuff when I finish the emacsclient,
;;so I add another hook to kill the buffer when finished. This also
;;takes care of weird buffer switching behaviors when closing client buffers."
(if window-system
(add-hook 'server-done-hook
(lambda nil (kill-buffer nil)))
)
;;"gnuclient's behavior of silently reloading the changed buffer is
;;probably preferable -- add the following lines to your .emacs file
;;to emulate gnuclient's behavior with emacsclient:"
;;<<http://docs.kde.org/development/en/kdegraphics/kdvi/inverse-search-editor.html>>
(defadvice server-visit-files (around save-buffers last activate)
"Try to emulate gnuclient behavior with emacsclient.
Works only for visiting one buffer at a time."
(let* ((filen (car (car (ad-get-arg 0))))
(buf (get-file-buffer filen))
(this-buf-modified-p nil))
;;; the following is copied from server-visit-files, with
;;; a modification for the `verify-visited-file-modtime' test
(if (and buf (set-buffer buf))
(if (file-exists-p filen)
;;; if the file has changed on disk, reload it
;;; using `find-file-noselect'
(if (not (verify-visited-file-modtime buf))
(progn
(find-file-noselect filen)
;;; if user answered `no', reset modtime anyway
;;; so that server-visit-files doesn't realize the
;;; difference:
(set-visited-file-modtime)))
;;; if file exists no longer, we let server-visit-files
;;; deal with that
t)
(setq buf (find-file-noselect filen)))
(setq this-buf-modified-p (buffer-modified-p buf))
(set-buffer buf)
(set-buffer-modified-p nil)
ad-do-it
(set-buffer-modified-p this-buf-modified-p)))
;;Call a function which will have the time displayed in the modeline
(display-time)
;;I don't find fundamental mode very useful. Things generally have a
;;specific mode, or they're text.
(setq default-major-mode 'text-mode)
;;Show column number in mode line
(setq column-number-mode t)
;;Turn off the status bar if we're not in a window system. I currently have it always off.
;(menu-bar-mode (if window-system 1 -1))
;;Ensure the w3m browser is loaded.
;(require 'w3m-load)
;;Need edmacro to work with buffer switching
(load "edmacro")
;;Answer y or n instead of yes or no at minibar prompts.
(defalias 'yes-or-no-p 'y-or-n-p)
;;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)
;;What it says. Keeps the cursor in the same relative row during
;;pgups and dwns.
(setq scroll-preserve-screen-position t)
;;;Accelerate the cursor when scrolling.
(load "accel" t t)
;;Start scrolling when 2 lines from top/bottom
(setq scroll-margin 2)
;;;Push the mouse out of the way when the cursor approaches.
(mouse-avoidance-mode 'jump)
;;Make cursor stay in the same column when scrolling using pgup/dn.
;;Previously pgup/dn clobbers column position, moving it to the
;;beginning of the line.
;;<http://www.dotemacs.de/dotfiles/ElijahDaniel.emacs.html>
(defadvice scroll-up (around ewd-scroll-up first act)
"Keep cursor in the same column."
(let ((col (current-column)))
ad-do-it
(move-to-column col)))
(defadvice scroll-down (around ewd-scroll-down first act)
"Keep cursor in the same column."
(let ((col (current-column)))
ad-do-it
(move-to-column col)))
;;;SavePlace- this puts the cursor in the last place you editted
;;;a particular file. This is very useful for large files.
(require 'saveplace)
(setq-default save-place t)
;;;I use sentences. Like this.
(setq sentence-end-double-space t)
;;Add good shortcut for flyspell. The hook makes sure when flyspell-mode is on,
;;the buffer gets scanned.
(defun flyspell nil "Do the expected default, which is run flyspell on the whole buffer."
(interactive)
(flyspell-buffer))
(add-hook 'flyspell-mode-hook 'flyspell-buffer)
;;Set text-mode to automatically use long-lines mode.
(add-hook 'text-mode-hook (lambda () (longlines-mode 1)))
;;This apparently allows seamless editing of files in a tar/jar/zip file.
;;<http://www.emacswiki.org/cgi-bin/wiki/AutoCompressionMode>
(auto-compression-mode 1)
;;Highlight regions so one can see what one is doing...
(transient-mark-mode 1)
;;Require C-x C-c prompt. I've closed too often by accident.
;;<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))))))
;;Add alternatives to M-x, on the recommendation of Steve Yegge.
;;<http://steve.yegge.googlepages.com/effective-emacs>
(global-set-key "\C-x\C-m" 'execute-extended-command)
(global-set-key "\C-c\C-m" 'execute-extended-command)
;; Kill default buffer without the extra emacs questions.
;;<http://johnnyjacob.wordpress.com/articles/emacs/>
(defun geosoft-kill-buffer ()
(interactive)
(kill-buffer (buffer-name)))
;;C-x k is a command I use often, but C-x C-k (an easy mistake) is
;;bound to nothing!
;;Set C-x C-k to same thing as C-x k.
(global-set-key "\C-x\C-k" 'geosoft-kill-buffer)
;;IMPORTANT! This overrides a default binding!
;;I don't use C-l much, and it makes more sense to me for it
;;to kill backwards the line, like C-k kills forward the line.
;;;define the function to kill the characters from the cursor
;;;to the beginning of the current line
(defun backward-kill-line (arg)
"Kill chars backward until encountering the end of a line."
(interactive "p")
(kill-line 0))
(global-set-key "\C-l" 'backward-kill-line)
;;I like M-g for goto-line
(global-set-key "\M-g" 'goto-line)
;;Change C-x C-b behavior so it uses bs; shows only interesting
;;buffers.
(global-set-key "\C-x\C-b" 'bs-show)
;;IMPORTANT! This overrides the default binding!
;;The idea is to sort of imitate stumpwm for buffer management, so to speak,
(global-set-key "\C-n" 'bury-buffer)
(global-set-key "\C-p" '(lambda () (interactive) (switch-to-buffer (other-buffer))))
;;I never use set-fill-column and I hate hitting it by accident.
(global-set-key "\C-x\ f" 'find-file)
;;M-dn and M-up do nothing! :( Let's make them do something, like M-left
;; and M-right do.
(global-set-key [M-down] '(lambda () (interactive) (progn (forward-line 10) (recenter) ) ))
(global-set-key [M-up] '(lambda () (interactive) (progn (forward-line -10) (recenter) ) ))
;;Set up msb mode. It is not as quick to use as regular buffer tab,
;;but for those I use C-x b, not the menu.
(require 'msb)
(msb-mode 1)
;;Add stumpwm-like buffer movement. First two require
;;cyclebuffer.el (available in the emacs-goodies-el Debian package).
(global-set-key "\356" (quote cyclebuffer-forward)) ;;M-n
(global-set-key "\360" (quote cyclebuffer-backward)) ;;M-p
(global-set-key "\215" (quote mode-line-other-buffer)) ;;M-RET
(global-set-key (quote [f5]) (quote mode-line-other-buffer)) ;;M-RET;
;;;This works becase function keys 7,8,9,11,12 are undefined
(global-set-key (quote [C-tab]) (quote other-window)) ;;C-Tab
;;Enable iswitchb buffer mode. I find it easier to use than the
;;regular buffer switching. While we are messing with buffer
;;movement, the second sexp hides all the buffers beginning
;;with "*". The third and fourth sexp does some remapping.
;;My instinct is to go left-right in a completion buffer, not C-s/C-r
(iswitchb-mode 1)
(defun iswitchb-local-keys ()
(mapc (lambda (K)
(let* ((key (car K)) (fun (cdr K)))
(define-key iswitchb-mode-map (edmacro-parse-keys key)
fun)))
'(("<right>" . iswitchb-next-match)
("<left>" . iswitchb-prev-match)
("<up>" . ignore )
("<down>" . ignore ))))
(add-hook 'iswitchb-define-mode-map-hook 'iswitchb-local-keys)
;;Completion ignores filenames ending in any string in this list.
(setq completion-ignored-extensions
'(".o" ".elc" ".class" "java~" ".ps" ".abs" ".mx" ".~jv" "#" ".gz" ".tgz" ".fasl"))
;;We can also get completion in the mini-buffer as well.
(icomplete-mode t)
;;"To hit tab to auto-complete (like bash does) put this in your .emacs:"
;;<http://www.emacswiki.org/cgi-bin/wiki/EmacsNiftyTricks>
(defun indent-or-complete ()
"Complete if point is at end of line, and indent line."
(interactive)
(if (and (looking-at "$") (not (looking-back "^\\s-*")))
(hippie-expand nil))
(indent-for-tab-command)
)
(add-hook 'find-file-hooks (function (lambda ()
(local-set-key (kbd "<tab>") 'indent-or-complete))))
;;Don't use Ispell, but the more modern Aspell
(setq ispell-program-name "aspell")
;;;Save new words in pdict without questioning
(setq ispell-silently-savep t)
;;Text files supposedly end in new lines. Or they should.
(setq require-final-newline t)
;;Have tabs actually be successions of spaces. More robust. See JWZ's explanation:
;;<http://www.jwz.org/doc/tabs-vs-spaces.html>
(setq indent-tabs-mode nil)
(defun ska-untabify ()
"My untabify function as discussed and described at
http://www.jwz.org/doc/tabs-vs-spaces.html
and improved by Claus Brunzema:
- return nil to get `write-contents-hooks' to work correctly
(see documentation there)
- `make-local-hook' instead of `make-local-variable'
- when instead of if"
(save-excursion
(goto-char (point-min))
(when (search-forward "\t" nil t)
(untabify (1- (point)) (point-max)))
nil))
(add-hook 'some-mode-hook
'(lambda ()
(make-local-hook 'write-contents-hooks)
(add-hook 'write-contents-hooks 'ska-untabify nil t)))
;;I always compile my .emacs, saves me about two seconds
;;startuptime. But that only helps if the .emacs.elc is newer
;;than the .emacs. So compile .emacs if it's not.
;;<http://www.emacswiki.org/cgi-bin/wiki/AutoCompileInit>
(defun byte-compile-init-file ()
(when (equal user-init-file buffer-file-name)
(when (file-exists-p (concat user-init-file ".elc"))
(delete-file (concat user-init-file ".elc")))
(byte-compile-file user-init-file)))
(add-hook 'after-save-hook 'byte-compile-init-file)
;;Same idea, but now do it with Gnus, Slime, and Stumpwm
(add-hook 'slime-mode-hook
(lambda ()
(if
(string= (buffer-file-name) (expand-file-name (concat
default-directory ".stumpwmrc")))
(unless (slime-connected-p)
(save-excursion
(slime-connect "127.0.0.1" "4005"))))))
(defun stump-autocompile nil "compile itself if ~/.stumpwmrc"
(interactive)
(require 'bytecomp)
(if
(string= (buffer-file-name) (expand-file-name (concat
default-directory ".stumpwmrc")))
(slime-compile-file (buffer-file-name))))
(add-hook 'after-save-hook 'stump-autocompile)
;;Byte Compile .gnus.el if it has changed since the last time visited
;;<http://www.linux-france.org/article/appli/emacs/bibliotheque/.gnus.el>
(defun GnusWait! ()
"If ~/.gnus.el exists and is newer than ~/.gnus, recompile it to ~/.gnus.elc and move the compiled version to ~/.gnus."
(cond
((file-newer-than-file-p "~/.gnus.el" "~/.gnus")
(let ((mode-line-format
"*** PLEASE STANDBY: RECOMPILING .gnus.el **"))
(sit-for 0)
(byte-compile-file "~/.gnus.el")
(message ".gnus recompiled --- reloading ...")
(rename-file "~/.gnus.elc" "~/.gnus" t))
)))
(add-hook 'after-save-hook 'GnusWait!)
;;"Redefine the Home/End keys to (nearly) the same as visual studio
;;behavior... special home and end by Shan-leung Maverick WOO
;;<sw77@cornell.edu>"
;;This is complex. In short, the first invocation of Home/End moves
;;to the beginning of the *text* line. A second invocation moves the
;;cursor to the beginning of the *absolute* line. Most of the time
;;this won't matter or even be noticeable, but when it does (in
;;comments, for example) it will be quite convenient.
(global-set-key [home] 'My-smart-home)
(global-set-key [end] 'My-smart-end)
(defun My-smart-home ()
"Odd home to beginning of line, even home to beginning of
text/code."
(interactive)
(if (and (eq last-command 'My-smart-home)
(/= (line-beginning-position) (point)))
(beginning-of-line)
(beginning-of-line-text))
)
(defun My-smart-end ()
"Odd end to end of line, even end to begin of text/code."
(interactive)
(if (and (eq last-command 'My-smart-end)
(= (line-end-position) (point)))
(end-of-line-text)
(end-of-line))
)
(defun end-of-line-text ()
"Move to end of current line and skip comments and trailing space.
Require `font-lock'."
(interactive)
(end-of-line)
(let ((bol (line-beginning-position)))
(unless (eq font-lock-comment-face (get-text-property bol 'face))
(while (and (/= bol (point))
(eq font-lock-comment-face
(get-text-property (point) 'face)))
(backward-char 1))
(unless (= (point) bol)
(forward-char 1) (skip-chars-backward " \t\n"))))
) ;;Done with home and end keys.
;;But what about the normal use for home and end?
;;We can still have them! Just prefixed with control.
(global-set-key [\C-home] 'beginning-of-buffer)
(global-set-key [\C-end] 'end-of-buffer)
;;"These tell emacs to associate certain filename extensions with
;;certain modes. I use cc-mode.el (c++-mode) for C as well as C++
;;code. It is fairly all-encompassing, also working with other
;;C-like languages, such as Objective C and Java."
(setq auto-mode-alist (cons '("\\.awk$" . awk-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.cc$" . c++-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.c$" . c++-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.C$" . c++-mode) auto-mode-alist)
auto-mode-alist (cons '("\\CHANGELOG" . c++-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.cpp$" . c++-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.cxx$" . c++-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.doc$" . text-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.doc$" . text-mode) auto-mode-alist)
auto-mode-alist (cons '("\.emacs" . lisp-mode) auto-mode-alist) ;;Make sure that .emacs file is edited in lisp mode:
auto-mode-alist (cons '("\\.h$" . c++-mode) auto-mode-alist)
auto-mode-alist (cons '("\\INSTALL" . text-mode) auto-mode-alist)
auto-mode-alist (cons '("\.lisp" . lisp-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.perl$" . perl-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.pl$" . perl-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.plx$" . perl-mode) auto-mode-alist)
auto-mode-alist (cons '("\\README$" . text-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.screenrc$" . shell-script-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.sh$" . shell-script-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.ss$" . scheme-mode) auto-mode-alist) ;;Scheme
auto-mode-alist (cons '("\.stumpwmrc" . slime-mode) auto-mode-alist)
auto-mode-alist (cons '("stumpwm.sbcl" . slime-mode) auto-mode-alist)
auto-mode-alist (cons '("\.stumpwm" . slime-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.tcl$" . tcl-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.text$" . text-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.toprc$" . shell-script-mode) auto-mode-alist)
auto-mode-alist (cons '("\\TODO$" . text-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.txt$" . text-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.txt$" . text-mode) auto-mode-alist)
auto-mode-alist (cons '("\\.zsh$" . shell-script-mode) auto-mode-alist)
completion-ignored-extensions (append completion-ignored-extensions '(".CKP" ".u" ".press" ".imp" ".BAK")))
(put 'eval-expression 'disabled nil)
;;These lines tell emacs to auto-magically font-lock buffers which
;;are covered by various modes.
(setq
emacs-lisp-mode-hook '(lambda () (font-lock-mode 1))
lisp-mode-hook '(lambda () (font-lock-mode 1))
c-mode-hook '(lambda () (font-lock-mode 1))
c++-mode-hook '(lambda () (font-lock-mode 1))
html-mode-hook '(lambda () (font-lock-mode 1))
makefile-mode-hook '(lambda () (font-lock-mode 1))
shell-mode-hook '(lambda () (font-lock-mode 1))
dired-mode-hook '(lambda () (font-lock-mode 1))
rmail-mode-hook '(lambda () (font-lock-mode 1))
compilation-mode-hook '(lambda () (font-lock-mode 1)))
;;Try'n'get tramp working. Commented out because this is the slowest
;;part of this whole .emacs according to pod.el, and I don't use it
;;regularly.
(require 'tramp)
(setq tramp-default-method "ssh")
;;Not quite sure how this helps, but what the hey.
;;<http://www.cabochon.com/~stevey/blog-rants/my-dot-emacs-file.html>
(add-hook 'isearch-mode-end-hook 'my-goto-match-beginning)
(defun my-goto-match-beginning ()
(when isearch-forward (goto-char isearch-other-end)))
;;This could be a useful command, if I ever bound it to something. Maybe
;;C-x w?
;;<http://www.cabochon.com/~stevey/blog-rants/my-dot-emacs-file.html>
(defun rename-file-and-buffer (new-name)
"Renames both current buffer and file it's visiting to NEW-NAME."
(interactive "sNew name: ")
(let ((name (buffer-name))
(filename (buffer-file-name)))
(if (not filename)
(message "Buffer '%s' is not visiting a file!" name)
(if (get-buffer new-name)
(message "A buffer named '%s' already exists!" new-name)
(progn
(rename-file name new-name 1)
(rename-buffer new-name)
(set-visited-file-name new-name)
(set-buffer-modified-p nil))))))
;;make completion buffers in a shell disappear after 4 seconds.
;;<http://snarfed.org/space/why+I+don't+run+shells+inside+Emacs>
(add-hook 'completion-setup-hook
(lambda () (run-at-time 5 nil
(lambda () (delete-windows-on "*Completions*")))))
;;C-F12 to restart the server
;;<http://ryan.barrett.name/dotfiles/.emacs>
(global-set-key [(control f12)] 'server-start)
;;This whole succession of lisp is to open a file as root, easily, and
;;bind it to a key. It is totally stolen from Alex Schroder.
;;<http://repose.cx/conf/.elisp/de-root.el>
(defvar find-file-root-prefix "/sudo:root@localhost:"
"*The filename prefix used to open a file with `find-file-root'.
This should look something like \"/sudo:root@localhost:\" (new style
TRAMP) or \"/[sudo:root@localhost]/\" (XEMacs or old style TRAMP).")
(defvar find-file-root-history nil
"History list for files found using `find-file-root'.")
(defvar find-file-root-hook nil
"Normal hook for functions to run after finding a \"root\" file.")
(defun find-file-root ()
"*Open a file as the root user.
Prepends `find-file-root-prefix' to the selected file name so that it
maybe accessed via the corresponding tramp method."
(interactive)
(require 'tramp)
(let* ( ;; We bind the variable `file-name-history' locally so we can
;; use a separate history list for "root" files.
(file-name-history find-file-root-history)
(name (or buffer-file-name default-directory))
(tramp (and (tramp-tramp-file-p name)
(tramp-dissect-file-name name)))
path dir file)
(when (setq file (read-file-name "Find file (UID = 0): " dir path))
(find-file (concat find-file-root-prefix file))
;; If this all succeeded save our new history list.
(setq find-file-root-history file-name-history)
;; allow some user customization
(run-hooks 'find-file-root-hook))))
(defface find-file-root-header-face
'((t (:foreground "white" :background "red3")))
"*Face use to display header-lines for files opened as root."
:group 'file-root)
(defun find-file-root-header-warning ()
"*Display a warning in header line of the current buffer.
This function is suitable to add to `find-file-root-hook'."
(let* ((warning "WARNING: EDITING FILE AS ROOT!")
(space (+ 6 (- (frame-width) (length warning))))
(bracket (make-string (/ space 2) ?-))
(warning (concat bracket warning bracket)))
(setq header-line-format
(propertize warning 'face 'find-file-root-header-face))))
(add-hook 'find-file-root-hook 'find-file-root-header-warning)
(global-set-key (kbd "C-x C-r") 'find-file-root)
;;;;Begin a section copied from browse-url.el
;;;;When Emacs 22 is officially released, suggest this for Emacs 22.1, at Ramone's advice
;;;;This section rewrites the browse-url-lynx-emacs command so it takes an arbitrary text browser
;;;;as a command.
(require 'term)
(require 'browse-url)
(defun browse-url-text-browser-emacs (url generic &optional new-buffer)
"Ask for a Web address and an arbitrary text browser.
When called interactively, if variable `browse-url-new-window-flag' is
non-nil, load the document in a new text browser in a new term window,
otherwise use any existing one. A non-nil interactive prefix argument
reverses the effect of `browse-url-new-window-flag'.
When called non-interactively, optional second argument NEW-WINDOW is
used instead of `browse-url-new-window-flag'."
(interactive "MWeb address: \nMBrowser: ")
(let* ((system-uses-terminfo t) ; Text browsers use terminfo?
(buf (get-buffer "*text-browser*"))
(proc (and buf (get-buffer-process buf)))
(n browse-url-lynx-input-attempts))
(if (and (browse-url-maybe-new-window new-buffer) buf)
;; Rename away the OLD buffer. This isn't very polite, but
;; term insists on working in a buffer named *lynx* and would
;; choke on *lynx*<1>
(progn (set-buffer buf)
(rename-uniquely)))
(if (or (browse-url-maybe-new-window new-buffer)
(not buf)
(not proc)
(not (memq (process-status proc) '(run stop))))
;; start a new text browser
(progn
(setq buf (apply #'make-term
`("text-browser" ,generic nil ,@browse-url-lynx-emacs-args
,url)))
(switch-to-buffer buf)
(term-char-mode)
(set-process-sentinel
(get-buffer-process buf)
;; Don't leave around a dead one (especially because of its
;; munged keymap.)
(lambda (process event)
(if (not (memq (process-status process) '(run stop)))
(let ((buf (process-buffer process)))
(if buf (kill-buffer buf)))))))
;; send the url to the text-browser in the old buffer
(let ((win (get-buffer-window buf t)))
(if win
(select-window win)
(switch-to-buffer buf)))
(if (eq (following-char) ?_)
(cond ((eq browse-url-lynx-input-field 'warn)
(error "Please move out of the input field first"))
((eq browse-url-lynx-input-field 'avoid)
(while (and (eq (following-char) ?_) (> n 0))
(term-send-down) ; down arrow
(sit-for browse-url-lynx-input-delay))
(if (eq (following-char) ?_)
(error "Cannot move out of the input field, sorry")))))
(term-send-string proc (concat "g" ; goto
"\C-u" ; kill default url
url
"\r")))))
(defun browse-url-lynx-emacs (url &optional new-buffer)
"Specializes browse-url-text-browser-emacs so it calls Lynx."
(interactive (browse-url-interactive-arg "URL for Lynx: "))
(browse-url-text-browser-emacs url "lynx" new-buffer))
(defun browse-url-elinks-emacs (url &optional new-buffer)
"Specializes browse-url-text-browser-emacs so it calls Elinks."
(interactive (browse-url-interactive-arg "URL for Elinks: "))
(browse-url-text-browser-emacs url "elinks" new-buffer))
(defun browse-url-links-emacs (url &optional new-buffer)
"Specializes browse-url-text-browser-emacs so it calls Links."
(interactive (browse-url-interactive-arg "URL for Links: "))
(browse-url-text-browser-emacs url "links" new-buffer))
(defun browse-url-links2-emacs (url &optional new-buffer)
"Specializes browse-url-text-browser-emacs so it calls Links2."
(interactive (browse-url-interactive-arg "URL for Links2: "))
(browse-url-text-browser-emacs url "links2" new-buffer))
(defun browse-url-netrik-emacs (url &optional new-buffer)
"Specializes browse-url-text-browser-emacs so it calls Netrik."
(interactive (browse-url-interactive-arg "URL for Netrik: "))
(browse-url-text-browser-emacs url "netrik" new-buffer))
(defun browse-url-w3m-emacs (url &optional new-buffer)
"Specializes browse-url-text-browser-emacs so it calls w3m."
(interactive (browse-url-interactive-arg "URL for w3m: "))
(browse-url-text-browser-emacs url "w3m" new-buffer))
;;When browsing in Gnus, sometimes it's a good idea to open up something graphically.
(global-set-key "\C-\M-b" 'browse-url-firefox)
;;Hush, Gnus.
(setq gnus-inhibit-startup-message t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;PACKAGES;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;I send all customizations dealing with Lisp files which set new modes
;;;here. Believe it or not, all the preceding dealt with vanilla Emacs options.
;;Set up ibs- lets you cycle through buffers using C-tab
;;<http://www.geekware.de/software/emacs/#ibs>
;(require 'ibs)
;;Add browse-kill-ring extension. Lets you see your kill-ring as a
;;buffer. Included in Emacs CVS or the Debian package emacs-goodies-el.
;;<http://www.todesschaf.org/projects/bkr.html>
;;(autoload 'browse-kill-ring "~/.emacs.d/browse-kill-ring.elc" "Enables
;;opening up of kill-ring in a buffer" t)
;;Add an educational game which tests you on esoteric keystrokes.
;;<http://www.ifa.au.dk/~harder/keywiz.el>
;(require 'keywiz)
;;Turn on a sort of flashing parentheses mode borrowed from Zmacs.
;;<http://www.splode.com/~friedman/software/emacs-lisp/src/flash-paren.el>
(autoload 'flash-paren-mode "~/.emacs.d/flash-paren.elc"
"Enable Zmacs style flashing of parentheses" t)
(flash-paren-mode 1)
;;Turn on a timeout for the parentheses; normally they blink
;;indefinitely, but this packages changes the length of time they
;;will blink to ~.6 seconds.
;;The timeout can be changed. I've set it to 1.5 seconds.
;;<http://web.comhem.se/~u83406637/emacs/paren-glint.el>
(autoload 'paren-glint "~/.emacs.d/paren-glint.elc"
"Adds a timeout for flashed parentheses." t)
(require 'paren-glint)
(paren-glint-mode 1)
;;;More display goodness- highlight-tail mode, which
;;colorizes recently added text, but the color diminishes
;;over time, so you can see what you most recently typed.
;;<http://nic-nac-project.de/~necui/ht.html>
;;When we compile .emacs, we need to have everything loaded,
;;even if it doesn't look good.
(eval-when-compile (require 'highlight-tail))
(if window-system (progn ;Only run if in a window-system
(require 'highlight-tail) ;Load it
(setq ;customize it
highlight-tail-steps 128 ;long-time
highlight-tail-timer 0.08 ;slower changes
highlight-tail-const-width 72 ;highlight a max of 72
highlight-tail-posterior-type 'const) ;highlight only so many
(highlight-tail-reload)))
;;This supposedly lets the VC interface use Darcs.
;;<http://www.emacswiki.org/cgi-bin/wiki/vc-darcs.el>
(require 'vc-darcs)
(add-to-list 'vc-handled-backends 'DARCS)
;;Auto-capitalize mode
;;<http://www.emacswiki.org/cgi-bin/wiki/auto-capitalize.el>
;(autoload 'auto-capitalize-mode "~/.emacs.d/auto-capitalize.elc"
; "Toggle `auto-capitalize' minor mode in this buffer." t)
;(add-hook 'text-mode-hook 'auto-capitalize-mode)
;;Sessions mode
;;<http://emacs-session.sourceforge.net/>
(require 'session)
(add-hook 'after-init-hook 'session-initialize)
;;"Recentf is a minor mode that builds a list of recently opened
;;files. This list is is automatically saved across Emacs sessions.
;;You can then access this list through a menu."
;;<http://www.emacswiki.org/cgi-bin/wiki/recentf-buffer.el>
(require 'recentf)
(setq recentf-auto-cleanup 'never) ;;To protect tramp
(recentf-mode 1)
;;Enable color-theme, a large collection of graphical themes and
;;commands for managing them. Also, choose a random one on boot.
;;Load is disabled as is included in emacs-goodies-el.
;;<http://www.emacswiki.org/cgi-bin/wiki/ColorTheme>
;;(autoload 'color-theme "~/.emacs.d/color-theme.elc" "Mode
;;which changes the graphical theme." t)
(require 'color-theme)
;;I like this color-theme best.
(color-theme-dark-laptop)
;;Enable setnu, set it to the setnu+ expansion, and turn it on for
;;text.
;;<http://www.emacswiki.org/cgi-bin/wiki/setnu%2b.el>
;(autoload 'setnu-mode "~/.emacs.d/setnu+.elc" "Minor mode for
;numbering lines for text." t)
;(dolist (hook '(text-mode-hook))
;(add-hook hook (lambda () (setnu-mode))))
;(add-hook 'text-mode-hook 'setnu-mode)
;;Force dupwords to be loaded. Dupwords goes through a text looking
;;for areas with the same word more than once within a set range.
;;Remember! The commands don't start with "dupwords", but with "dw"!
;;<http://www.damtp.cam.ac.uk/user/sje30/emacs/dupwords.el>
(autoload 'dupwords "~/.emacs.d/dupwords.elc" "A command which
finds duplicate words in a buffer." t)
;(add-hook 'text-mode-hook 'dw-check-to-end)
(setq dw-forward-words 1)
;;Add in pabbrev. Acts like OpenOffice's type-ahead feature, but
;;is buffer-specific, not working off of a generic dictionary like
;;OO or predictive-mode.
;;<http://homepages.cs.ncl.ac.uk/phillip.lord/download/emacs/pabbrev.el>
;(autoload 'pabbrev "~/.emacs.d/pabbrev.elc" "A mode which offers
;autocompletion for words, based on the buffer." t)
;(require 'pabbrev)
;(add-hook 'text-mode-hook 'pabbrev-mode)
;;Predictive mode. Interesting, but doesn't work as well in a buffer and has
;;some really annoying quirks, so I'm leaving it commented out.
;;<http://klibb.com/cgi-bin/wiki.pl/Emacs_Blog_2007-01-20>
;;<http://www.emacswiki.org/cgi-bin/wiki/PredictiveMode>
;(autoload 'predictive-mode "~/bin/predictive/predictive.el" "Predictive mode." t)
;;Wikipedia mode- syntax highlighting for Wikipedia, plus some
;;binding of moving around commands.
;;<http://www.emacswiki.org/cgi-bin/wiki/WikipediaMode>
(autoload 'wikipedia-mode "~/.emacs.d/wikipedia-mode.elc"
"Major mode for editing documents in Wikipedia markup." t)
(add-to-list 'auto-mode-alist
'("\\.wiki\\'" . wikipedia-mode)) ;;Duh.
(add-to-list 'auto-mode-alist
'("\\externaleditor.txt\\'" . wikipedia-mode)) ;;Duh.
(add-to-list 'auto-mode-alist
'("index.\\.*" . wikipedia-mode))
;;add auto-capitalize in addition to wikipedia-mode.
;(add-to-list 'auto-mode-alist
; '("index.\\.*" . auto-capitalize))
;(add-hook 'wikipedia-mode-hook 'setnu-mode)
(add-hook 'wikipedia-mode-hook 'pabbrev-mode)
;;I don't know why, but the author of Wikipedia mode added in some
;;seriously annoying key bindings. Let's kill them dead!
(defun unset-wikipedia-bindings ()
(interactive)
(local-unset-key (kbd "C-<up>"))
(local-unset-key (kbd "C-<down>"))
(local-unset-key (kbd "C-<left>"))
(local-unset-key (kbd "C-<right>")))
(add-hook 'wikipedia-mode-hook 'unset-wikipedia-bindings)
;;Crontab mode
;;<http://www.mahalito.net/~harley/elisp/crontab-mode.el>
(autoload 'crontab-mode "~/.emacs.d/crontab-mode.elc" "Major mode
for editing the crontab" t)
(add-to-list 'auto-mode-alist '("\\.cron\\(tab\\)?\\'" .
crontab-mode))
;;Remember.el is gotten from the Debian package.
;;This tells remember to append notes to ~/.notes
;;<http://packages.debian.org/stable/misc/remember-el>
(setq remember-handler-functions
'(remember-append-to-file))
;;Dired-sort-menu adds sorting of a dired-shown directory.
;;<http://centaur.maths.qmw.ac.uk/Emacs/files/dired-sort-menu.el>
(autoload 'dired-sort-menu "~/.emacs.d/dired-sort-menu.elc"
"Minor mode adding ls sort options to dired." t)
(add-hook 'dired-load-hook
(lambda () (require 'dired-sort-menu)))
;;Add in wide-column. Informs via changing cursor color when a line
;;is too wide, past 72 columns. My monitor is too wide, so making
;;it really wide is an easy mistake. This also enables it for text mode.
;;Currently doesn't work.
;;<http://homepages.cs.ncl.ac.uk/phillip.lord/download/emacs/wide-column.el>
;(require 'wide-column)
;(add-hook 'text-mode-hook 'wide-column-mode)
;;Enable undoc; a mode which edits MS Word .doc files.
;;<http://www.ccs.neu.edu/home/guttman/undoc.el>
(autoload 'undoc "~/.emacs.d/undoc.elc" "A minor mode which kills MS
Word files dead." t)
(autoload 'undoc-current-buffer "undoc" "" t)
(autoload 'undoc-region-after-mime-decode "undoc" "" t)
;;This enables abbrev-sort. When abbreviations are edited,
;;they will be auto-sorted for ease of editing.
;;<http://www.eskimo.com/~seldon/abbrev-sort.el>
(autoload 'abbrev-sort-mode "~/.emacs.d/abbrev-sort.elc"
"sorting abbrevs to make things easier." t)
(abbrev-sort-mode 1)
;;highlight-context-line replacement, highline.el
;;simply lightly highlights the current line- works well for scrolling as well.
(if window-system
(autoload 'highline "~/.emacs.d/highline.elc"
"Minor mode which highlights current line" t))
;;Allows incremental search of the minibuffer history. Neat!
;;<http://www.sodan.org/~knagano/emacs/minibuf-isearch/>
(require 'minibuf-isearch)
;;The normal man command doesn't allow tab-completion.
;;iman is a wrapper around man which does so allow.
;;<http://homepage1.nifty.com/bmonkey/emacs/elisp/iman.el>
(autoload 'iman "~/.emacs.d/iman.elc"
"Call the viewers of man pages and GNU Info with completion."
t nil)
(defalias 'man 'iman)
;;Haskell-mode is provided through Debian's haskell-mode.
;;This changes some of the modules loaded.
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
(add-hook 'haskell-mode-hook 'font-lock-mode)
(add-hook 'haskell-mode-hook 'imenu-add-menubar-index)
;;"Say you've installed javascript.el on machine A
;;but not on machine B. Ideally, your ~/.emacs file
;;should detect if javascript.el is installed: if it is,
;;it should use it, but if it isn't, it should fall back
;;on javascript-generic-mode from generic-x.el. This is
;;pretty easy stuff. First, require generic-x as above.
;;Then check for the presence of javascript.el, and
;;configure it if it's present:"
;;<http://emacsen.org/2005/09/26-javascript>
(require 'generic-x) ;;Sort of supports javascript highlighting.
(autoload 'ecmascript-mode "~/.emacs.d/ecmascript-mode.elc"
"A major mode for javascript and ECMA-262 standard languages.")
(when (locate-library "ecmascript-mode")
(add-to-list 'auto-mode-alist '("\.js\'" . ecmascript-mode)))
;;SLIME is provided through the Debian package.
(add-to-list 'load-path "~/.slime/") ; your SLIME directory
(setq inferior-lisp-program "/usr/bin/sbcl") ; your Lisp program
(require 'slime)
(slime-setup)
(add-to-list 'load-path "~/bin/stumpwm/")
;;twb's sticky-repl
;;<http://twb.ath.cx/~twb/canon/sticky-repl/sticky-repl.el>
(autoload 'sticky-repl-display "sticky-repl" nil t)
(setq special-display-function 'sticky-repl-display
compilation-window-height 12
same-window-buffer-names nil
special-display-buffer-names
'("*Apropos*"
"*Backtrace*"
"*Calculator*"
"*Compile-log*"
"*Help*"
"*Messages*"
"*Occur*"
"*Shell Command Output*"
"*compilation*"
"*grep*"
"*ielm*"
"*inferior-lisp*"
"*scheme*"
"*vc*"
"*vc-diff*")
special-display-regexps
'("\\*shell\\(<[0-9]+>\\)?\\*"
"\\*slime-repl .*\\*"
"\\*sldb .*\\*"))
;;"Why not use the cursor type and color to let you know what the current context is?
;;A bar cursor (vertical bar between characters) is handy for editing, but it is not
;;very noticeable in the middle of a sea of text. Why not change it to a box cursor
;;(on top of a character) when Emacs is idle, so you can spot it easier?"
;;<http://www.emacswiki.org/cgi-bin/wiki/ChangingCursorDynamically>
;;<http://www.emacswiki.org/cgi-bin/emacs/cursor-chg.el>
(require 'cursor-chg) ; Load the library
(toggle-cursor-type-when-idle 1) ; Turn on cursor change when Emacs is idle
(change-cursor-mode 1) ; Turn on change for overwrite, read-only, and input mode
(setq curchg-input-method-cursor-color "palegreen1")
(setq curchg-input-method-cursor-color "palegreen1")
;;Well, nethack and nethack-el and nethack.el are installed,
(eval-after-load "nethack"
'(progn
(define-key nh-map-mode-map (kbd "<left>") 'nethack-command-west)
(define-key nh-map-mode-map (kbd "<up>") 'nethack-command-north)
(define-key nh-map-mode-map (kbd "<down>") 'nethack-command-south)
(define-key nh-map-mode-map (kbd "<right>") 'nethack-command-east)
(define-key nh-map-mode-map (kbd "<home>") 'nethack-command-northwest)
(define-key nh-map-mode-map (kbd "<prior>") 'nethack-command-northeast)
(define-key nh-map-mode-map (kbd "<end>") 'nethack-command-southwest)
(define-key nh-map-mode-map (kbd "<next>") 'nethack-command-southeast)))
;;"Winner keeps track of your window configurations, and provides functions to easily
;;navigate your window configuration history."
;;<http://emacs.wordpress.com/2007/01/28/simple-window-configuration-management/>
(winner-mode 1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;CUSTOM;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(put 'scroll-left 'disabled t)
(put 'overwrite-mode 'disabled t)
(custom-set-variables
;; custom-set-variables 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.
'(auto-save-interval 50)
'(auto-save-timeout 180)
'(blink-cursor-delay 1)
'(blink-cursor-interval 0.6)
'(browse-url-browser-function (quote browse-url-elinks-emacs))
'(browse-url-xterm-program "aterm")
'(canlock-password "5bc71ceb746e5b6363c8f631c04f9551497c499f")
'(color-theme-history-max-length 20)
'(column-number-mode t)
'(completion-max-candidates 15)
'(completion-min-chars 3)
'(completion-resolve-old-method (quote reject))
'(curchg-default-cursor-color "green")
'(dired-recursive-copies (quote always))
'(display-battery-mode t)
'(display-hourglass t)
'(display-time-mode t)
'(erc-autojoin-channels-alist (quote (("irc.freenode.net" "#Emacs" "#Wikipedia"))))
'(erc-autojoin-mode t)
'(erc-fill-column 82)
'(erc-join-buffer (quote window))
'(erc-kill-buffer-on-part t)
'(erc-kill-queries-on-quit t)
'(erc-kill-server-buffer-on-quit t)
'(erc-manual-set-nick-on-bad-nick-p t)
'(erc-modules (quote (autoaway autojoin button fill irccontrols match netsplit noncommands completion ring scrolltobottom services sound stamp spelling track)))
'(erc-nick "Gwern")
'(erc-prompt-for-password nil)
'(erc-reuse-buffers nil)
'(erc-server "irc.freenode.net")
'(erc-user-full-name "Gwern")
'(erc-whowas-on-nosuchnick t)
'(gnus-asynchronous t)
'(hourglass-delay 2)
'(icomplete-compute-delay 0.2)
'(ispell-following-word t)
'(ispell-highlight-p t)
'(iswitchb-case t)
'(iswitchb-max-to-show 10)
'(iswitchb-mode t)
'(iswitchb-prompt-newbuffer t)
'(iswitchb-regexp t)
'(iswitchb-use-frame-buffer-list t)
'(iswitchb-use-virtual-buffers t nil (recentf))
'(jde-compile-option-command-line-args (quote ("")))
'(jde-compile-option-verbose t)
'(jde-compiler (quote ("javac" "/usr/bin/javac")))
'(kill-ring-max 120)
'(nethack-message-window-height 13)
'(nethack-status-highlight-delay 4)
'(nethack-status-window-height 5)
'(predictive-add-to-dict-ask nil)
'(predictive-auto-add-to-dict t)
'(predictive-auto-learn t)
'(predictive-completion-speed 0.01)
'(predictive-max-completions 15)
'(predictive-use-buffer-local-dict t)
'(show-paren-mode t)
'(slime-autodoc-use-multiline-p t)
'(slime-kill-without-query-p t)
'(slime-repl-history-file "~/.slime/.slime-history.eld")
'(slime-repl-wrap-history t)
'(slime-startup-animation nil)
'(text-mode-hook (quote (turn-on-auto-fill flyspell-prog-mode text-mode-hook-identify)))
'(transient-mark-mode t)
'(vc-make-backup-files t)
'(w3m-form-input-textarea-buffer-lines 30)
'(w3m-use-cookies t))
(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.
'(bbdb-field-name ((t (:foreground "cornflowerblue"))) t)
'(bbdb-name ((t (:foreground "aquamarine"))) t)
'(bold ((t (:weight bold))))
'(bold-italic ((t (:slant italic :weight bold))))
'(border ((t nil)))
'(brace-face ((((class color)) (:foreground "white"))))
'(bracket-face ((((class color)) (:foreground "DeepSkyBlue3"))))
'(buffer-menu-buffer ((t (:inherit font-lock-function-name-face))))
'(button ((t (:inherit bold))))
'(comint-highlight-input ((t (:inherit bold))))
'(compilation-info ((((class color) (min-colors 88) (background dark)) (:foreground "palegreen"))))
'(compilation-warning ((((class color) (min-colors 16)) (:inherit bold :foreground "Orange"))))
'(cperl-array ((((class color) (background dark)) (:foreground "yellow2"))))
'(cperl-hash ((((class color) (background dark)) (:foreground "gold"))))
'(cperl-nonoverridable ((((class color) (background dark)) (:foreground "plum"))))
'(cursor ((t (:background "palegreen"))))
'(custom-link ((((min-colors 88) (class color) (background dark)) (:underline t :weight bold))))
'(dh-gnus-face-1 ((((type x)) (:foreground "tan2")) (((type tty)) (:foreground "red" :weight bold))) t)
'(dh-gnus-face-2 ((t nil)) t)
'(dh-gnus-face-3 ((((type x)) (:foreground "tan1"))) t)
'(ecb-default-highlight-face ((((class color) (background dark)) (:background "darkslateblue"))))
'(emms-pbi-current-face ((((class color) (background dark)) (:foreground "palegreen"))))
'(emms-pbi-song-face ((((class color) (background dark)) nil)))
'(escape-glyph ((((background dark)) (:foreground "lightsteelblue3"))))
'(eshell-ls-archive ((((class color) (background dark)) (:foreground "salmon"))))
'(eshell-ls-directory ((((class color) (background dark)) (:foreground "Skyblue"))))
'(eshell-ls-executable ((((class color) (background dark)) (:foreground "palegreen"))))
'(eshell-ls-missing ((((class color) (background dark)) (:foreground "tomato"))))
'(eshell-ls-symlink ((((class color) (background dark)) (:foreground "Cyan"))))
'(eshell-prompt ((t (:foreground "aquamarine2"))))
'(fg:erc-color-face1 ((t (:foreground "grey30"))))
'(font-lock-builtin-face ((((class grayscale) (background light)) (:foreground "LightGray" :weight bold)) (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold)) (((class color) (min-colors 88) (background light)) (:foreground "Orchid")) (((class color) (min-colors 88) (background dark)) (:foreground "LightSteelBlue")) (((class color) (min-colors 16) (background light)) (:foreground "Orchid")) (((class color) (min-colors 16) (background dark)) (:foreground "LightSteelBlue")) (((class color) (min-colors 8)) (:foreground "cyan" :weight bold)) (t (:weight bold))))
'(font-lock-comment-delimiter-face ((default (:foreground "tan2")) (((class color) (min-colors 16)) nil)))
'(font-lock-constant-face ((((type x) (class color) (min-colors 88) (background dark)) (:foreground "Aquamarine3"))))
'(font-lock-keyword-face ((((type x) (class color) (min-colors 88) (background dark)) (:foreground "turquoise3"))))
'(font-lock-regexp-grouping-backslash ((t (:foreground "burlywood1"))))
'(font-lock-string-face ((((type x) (class color) (min-colors 88) (background dark)) (:foreground "burlywood3")) (((type tty)) (:foreground "palegreen"))))
'(font-lock-type-face ((((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen3"))))
'(font-lock-variable-name-face ((((type x) (min-colors 88) (background dark)) (:foreground "LightGoldenrod3"))))
'(font-lock-warning-face ((((type x) (class color) (min-colors 88) (background dark)) (:background "firebrick4" :foreground "white")) (((type tty)) (:background "red" :foreground "white" :weight bold))))
'(fringe ((((class color) (background dark)) (:background "grey20"))))
'(gnus-button ((t (:inherit bold))))
'(gnus-cite-1 ((((class color) (background dark)) (:foreground "burlywood2"))))
'(gnus-cite-10 ((((class color) (background dark)) (:foreground "tan4"))))
'(gnus-cite-11 ((((class color) (background dark)) (:foreground "sienna4"))))
'(gnus-cite-2 ((((class color) (background dark)) (:foreground "lightsalmon2"))))
'(gnus-cite-3 ((((class color) (background dark)) (:foreground "salmon2"))))
'(gnus-cite-4 ((((class color) (background dark)) (:foreground "tan2"))))
'(gnus-cite-5 ((((class color) (background dark)) (:foreground "sienna2"))))
'(gnus-cite-6 ((((class color) (background dark)) (:foreground "chocolate2"))))
'(gnus-cite-7 ((((class color) (background dark)) (:foreground "burlywood4"))))
'(gnus-cite-8 ((((class color) (background dark)) (:foreground "lightsalmon4"))))
'(gnus-cite-9 ((((class color) (background dark)) (:foreground "salmon4"))))
'(gnus-cite-attribution ((t (:inherit italic))))
'(gnus-emphasis-bold ((t (:inherit bold))))
'(gnus-group-mail-1 ((t (:foreground "aquamarine1"))))
'(gnus-group-mail-1-empty ((((class color) (background dark)) (:foreground "aquamarine4"))))
'(gnus-group-mail-3 ((t (:foreground "aquamarine3"))))
'(gnus-group-mail-3-empty ((((class color) (background dark)) (:foreground "aquamarine4"))))
'(gnus-group-mail-low ((((type tty)) (:foreground "black" :weight bold)) (((type x)) (:foreground "grey50"))))
'(gnus-group-mail-low-empty ((((type x) (class color) (background dark)) (:foreground "grey40")) (((type tty)) (:foreground "black" :weight bold))))
'(gnus-group-news-3 ((((type x)) (:foreground "lightgoldenrod3"))))
'(gnus-group-news-3-empty ((((class color) (background dark)) (:foreground "lightgoldenrod4"))))
'(gnus-group-news-4 ((((type x)) (:foreground "lightskyblue3"))))
'(gnus-group-news-4-empty ((((type tty) (class color) (background dark)) (:foreground "blue" :weight bold)) (((type x)) (:foreground "skyblue4"))))
'(gnus-group-news-6 ((t (:foreground "grey60"))))
'(gnus-group-news-6-empty ((((type x) (class color) (background dark)) (:foreground "grey50")) (((type tty)) (:foreground "black" :weight bold))))
'(gnus-header-content ((((type x)) (:foreground "skyblue")) (((type tty)) (:foreground "cyan" :weight bold))))
'(gnus-header-from ((((class color) (background dark)) (:foreground "darkseagreen1"))))
'(gnus-header-name ((((class color) (background dark)) (:foreground "turquoise2"))))
'(gnus-header-newsgroups ((t (:foreground "palegreen3" :slant italic))))
'(gnus-header-subject ((((type x) (class color) (background dark)) (:foreground "lightskyblue1")) (((type tty)) (:foreground "green" :weight bold))))
'(gnus-signature ((t (:foreground "lightsalmon"))))
'(gnus-summary-cancelled ((((class color)) (:foreground "grey50"))))
'(gnus-summary-high-ancient ((t (:foreground "tan1"))))
'(gnus-summary-high-read ((t (:foreground "tan1"))))
'(gnus-summary-high-ticked ((t (:foreground "yellow2"))))
'(gnus-summary-high-unread ((t (:foreground "springgreen"))))
'(gnus-summary-low-ancient ((t (:foreground "grey70"))))
'(gnus-summary-low-read ((t (:foreground "grey70"))))
'(gnus-summary-normal-ancient ((((class color) (background dark)) (:foreground "burlywood"))))
'(gnus-summary-normal-read ((((class color) (background dark)) (:foreground "tan"))))
'(gnus-summary-normal-ticked ((((class color) (background dark)) (:foreground "goldenrod1"))))
'(gnus-summary-normal-unread ((t (:foreground "palegreen3"))))
'(gnus-summary-selected ((t (:slant italic))))
'(header-line ((t (:inherit variable-pitch :background "grey10" :foreground "aquamarine3" :box (:line-width 2 :color "aquamarine4")))))
'(help-argument-name ((((supports :slant italic)) (:inherit font-lock-variable-name-face))))
'(highlight ((((type x) (class color) (min-colors 88) (background dark)) (:background "grey20"))))
'(highlight-changes ((((min-colors 88) (class color)) (:background "grey20"))))
'(highline-face ((t (:background "grey20"))))
'(hl-line ((t (:background "#101040"))))
'(info-menu-star ((((class color)) (:foreground "lightgoldenrod"))))
'(info-node ((((class color) (background dark)) (:inherit bold :foreground "white" :slant italic))))
'(info-xref ((((min-colors 88) (class color) (background dark)) (:foreground "lightgoldenrod2"))))
'(info-xref-visited ((default (:foreground "lightgoldenrod3")) (((class color) (background dark)) nil)))
'(italic ((((supports :underline t)) (:slant italic))))
'(match ((((class color) (min-colors 88) (background dark)) (:background "royalblue"))))
'(menu ((t (:background "grey30" :foreground "gold"))))
'(message-cited-text ((((class color) (background dark)) (:foreground "burlywood"))))
'(message-header-cc ((t (:inherit gnus-header-newsgroups))))
'(message-header-name ((((class color) (background dark)) (:inherit gnus-header-name))))
'(message-header-newsgroups ((t (:foreground "aquamarine"))))
'(message-header-other ((((class color) (background dark)) (:inherit gnus-header-content))))
'(message-header-subject ((((class color) (background dark)) (:inherit gnus-header-subject))))
'(message-header-to ((t (:inherit gnus-header-from :weight bold))))
'(message-separator ((((class color) (background dark)) (:foreground "seagreen"))))
'(minibuffer-prompt ((((background dark)) (:foreground "aquamarine2"))))
'(mm-uu-extract ((((class color) (background dark)) (:background "grey20"))))
'(mode-line ((((class color) (min-colors 88)) (:inherit variable-pitch :background "black" :foreground "palegreen3" :box (:line-width 2 :color "palegreen4")))))
'(mode-line-buffer-id ((t (:inherit bold))))
'(mode-line-inactive ((((type x)) (:inherit variable-pitch :background "grey20" :foreground "palegreen4" :box (:line-width 2 :color "grey40")))))
'(nxml-attribute-local-name-face ((t (:inherit font-lock-variable-name-face))))
'(nxml-attribute-value-delimiter-face ((t (:inherit font-lock-string-face))))
'(nxml-attribute-value-face ((t (:inherit font-lock-string-face))))
'(nxml-comment-content-face ((t (:inherit font-lock-comment-face))))
'(nxml-comment-delimiter-face ((t (:inherit font-lock-comment-delimiter-face))))
'(nxml-element-local-name-face ((t (:inherit font-lock-function-name-face))))
'(nxml-markup-declaration-delimiter-face ((t (:inherit font-lock-constant-face))))
'(nxml-tag-delimiter-face ((t (:inherit font-lock-constant-face))))
'(nxml-tag-slash-face ((t (:inherit font-lock-keyword-face))))
'(oddmuse-code ((((type tty)) (:inherit default)) (((background dark)) (:background "grey20")) (((background light)) (:background "grey80"))))
'(paren-face ((((class color)) (:foreground "darkseagreen"))))
'(paren-face-match ((((class color)) (:background "green"))))
'(paren-face-mismatch ((((class color)) (:foreground "white" :background "red"))))
'(paren-match ((t (:background "green"))))
'(paren-mismatch ((t (:background "red"))))
'(progmode-special-chars-face ((((class color)) (:foreground "grey90"))))
'(region ((((class color) (min-colors 88) (background dark)) (:background "darkslateblue"))))
'(scroll-bar ((t (:inherit Header\ Line :stipple nil :background "black" :foreground "lightgreen" :inverse-video nil :slant italic :weight ultra-bold :height 1 :width condensed))))
'(semicolon-face ((((class color)) (:foreground "white"))))
'(sh-escaped-newline ((t (:foreground "tomato"))))
'(sh-heredoc ((((min-colors 88) (class color) (background dark)) (:inherit font-lock-string-face :background "grey20"))))
'(sh-quoted-exec ((((class color) (background dark)) (:foreground "salmon1"))))
'(shadow ((((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey50"))))
'(show-paren-match ((((class color) (background dark)) (:background "deepskyblue1"))))
'(show-paren-mismatch ((((class color)) (:background "firebrick3"))))
'(slime-repl-inputed-output-face ((((class color) (background dark)) (:foreground "lightsalmon"))))
'(tooltip ((((class color)) (:inherit variable-pitch :background "gray30" :foreground "white"))))
'(trailing-whitespace ((((class color) (background dark)) (:background "grey30"))))
'(tuareg-font-lock-governing-face ((t (:foreground "orange"))))
'(ude-error-face ((t (:background "firebrick4" :foreground "white" :weight normal))))
'(ude-font-lock-face-1 ((t (:foreground "Plum2"))))
'(variable-pitch ((t (:height 0.8 :family "arial"))))
'(vertical-border ((nil (:foreground "grey20"))))
'(w3m-anchor-face ((((class color) (background dark)) (:foreground "Lightskyblue1"))))
'(w3m-arrived-anchor-face ((((class color) (background dark)) (:foreground "skyblue2"))))
'(w3m-bold-face ((t (:foreground "white"))))
'(w3m-current-anchor-face ((t (:inherit bold :underline t))))
'(w3m-form-button-face ((((type x w32 mac) (class color)) (:foreground "lightgoldenrod"))))
'(w3m-form-face ((((class color) (background dark)) (:foreground "lightgoldenrod" :underline t))))
'(w3m-tab-background-face ((((type x w32 mac) (class color)) (:background "grey20" :foreground "grey80"))))
'(w3m-tab-selected-background-face ((((type x w32 mac) (class color)) (:background "grey20" :foreground "grey80"))))
'(which-func ((((class color) (min-colors 88) (background dark)) (:foreground "aquamarine"))))
'(woman-bold ((((background dark)) (:foreground "palegreen"))))
'(woman-italic ((((background dark)) (:foreground "lightgoldenrod"))))
'(woman-italic-no-ul ((t (:foreground "lightgoldenrod"))) t))
(setq debug-on-error nil);was set t at top of buffer
;;end .emacs