;;;;.emacs.el --- my own .emacs ;;;;Copyright (C) 2006 by maru dubshinki ;;;; ;;;;Author: maru dubshinki ;;;;License: BSD license, minus advertising clause. ;;;;Where: http://en.wikipedia.org/wiki/User:Marudubshinki/.emacs ;;;;Keywords: local,customization ;;;; 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 the customize settings. ;;;;That's the smallest section, since I did most of this by hand. ;;;;;;;;;;;;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. ;;;;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 startup message, somewhat reminiscent of "The Matrix: Reloaded" (defun emacs-reloaded () (animate-string (concat ";; Initialization successful. Welcome to " (substring (emacs-version) 0 16) ".") 0 1) (newline-and-indent) (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) ;;;;Ditto. (setq hostname (getenv "HOSTNAME")) ;;;;Do without those obnoxious startup messages- the whole GNU Emacs logo ;;;;thing, that is. (setq inhibit-splash-screen t) ;;;;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, but the buttons are ;;;;redundant with the menu options, and I know most of the keybindings ;;;;for the buttons, anyway. (tool-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. (setq message-log-max nil) (kill-buffer "*Messages*") ;;;;Let's not have too-tiny windows. (setq window-min-height 3) ;;;;Provide a useful error trace if loading this .emacs fails. (setq debug-on-error t) ;;;;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 50000000) ;;;;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)))))) ;;;;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" 'kill-this-buffer) ;;;;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) ;;;;Disable over-write mode! Never good! Pain in the posterior! (put 'overwrite-mode 'disabled t) ;;;;Using cursor color to indicate some modes. If you sometimes ;;;;find yourself inadvertently overwriting some text because you ;;;;are in overwrite mode but you didn't expect so, this might prove ;;;;as useful to you as it is for me. It changes cursor color to ;;;;indicate read-only, insert and overwrite modes: (setq hcz-set-cursor-color-color "") (setq hcz-set-cursor-color-buffer "") (defun hcz-set-cursor-color-according-to-mode () "change cursor color according to some minor modes." ;;set-cursor-color is somewhat costly, so we only call it when ;;needed: (let ((color (if buffer-read-only "black" (if overwrite-mode "red" "blue")))) (unless (and (string= color hcz-set-cursor-color-color) (string= (buffer-name) hcz-set-cursor-color-buffer)) (set-cursor-color (setq hcz-set-cursor-color-color color)) (setq hcz-set-cursor-color-buffer (buffer-name))))) (add-hook 'post-command-hook 'hcz-set-cursor-color-according-to-mode) ;;;;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) ;;;;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 1800) ;;;;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 ;;;;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) ;;;;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 (menu-bar-mode (if window-system 1 -1)) ;;;;W3m browser- doesn't work with my Emacs CVS. ;(require 'w3m-load) ;;;;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) ;;;;Supposedly, this turns on flyspell mode for text editing. (dolist (hook '(text-mode-hook)) (add-hook hook (lambda () (flyspell-mode 1)))) (dolist (hook '(change-log-mode-hook log-edit-mode-hook)) (add-hook hook (lambda () (flyspell-mode -1)))) ;;;;Set text-mode to automatically use long-lines mode. (add-hook 'text-mode-hook 'longlines-mode) ;;;;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) ;;;;Set so when moving by page, last visible line is highlighted. (load "highlight-context-line.el") ;;;;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) ;;;;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 4) (recenter) ) )) (global-set-key [M-up] '(lambda () (interactive) (progn (forward-line -4) (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 ratpoison-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))) '(("" . iswitchb-next-match) ("" . iswitchb-prev-match) ("" . ignore ) ("" . 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" )) ;;;;We can also get completion in the mini-buffer as well. (icomplete-mode t) ;;;;;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) ;;;;"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." (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) ;;;;"Redefine the Home/End keys to (nearly) the same as visual studio ;;;;behavior... special home and end by Shan-leung Maverick WOO ;;;;" ;;;;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 '("\\.text$" . text-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.txt$" . text-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.txt$" . text-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.doc$" . text-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.doc$" . text-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.awk$" . awk-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.perl$" . perl-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.plx$" . perl-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.pl$" . perl-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.C$" . c++-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.cc$" . c++-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.c$" . c++-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.h$" . c++-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.cpp$" . c++-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.cxx$" . c++-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.tcl$" . tcl-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.sh$" . shell-script-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.zsh$" . shell-script-mode) auto-mode-alist)) (set-default 'auto-mode-alist (append '(("\\.lisp$" . lisp-mode)) auto-mode-alist)) (set-default 'auto-mode-alist (append '(("TODO" . text-mode)) auto-mode-alist)) (set-default 'auto-mode-alist (append '(("README" . text-mode)) auto-mode-alist)) (setq completion-ignored-extensions;; Filename completion ignores ;;these. (append completion-ignored-extensions '(".CKP" ".u" ".press" ".imp" ".BAK"))) (put 'eval-expression 'disabled nil) ;;;;Make sure that .emacs file is edited in lisp mode: (setq auto-mode-alist (cons '("\.emacs" . lisp-mode) auto-mode-alist)) ;;;;These lines tell emacs to automagically 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))) ;;;;ERC customizations (setq erc-echo-notices-in-minibuffer-flag t) ;;;;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") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;MODES;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;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. ;;;;http://www.todesschaf.org/projects/bkr.html (autoload 'browse-kill-ring "~/.emacs.d/browse-kill-ring.el" "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) ;;;;Make sure eterm is a possibility. Opens up a terminal in a new ;;;;frame. Better than M-x shell, usually. (require 'eterm) ;;;;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.el" "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.el" "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://groups.google.com/group/gnu.emacs.sources/msg/b50d53424e7ca0cd?output=gplain (require 'highlight-tail) (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 "auto-capitalize" "Toggle `auto-capitalize' minor mode in this buffer." t) (autoload 'turn-on-auto-capitalize-mode "auto-capitalize" "Turn on `auto-capitalize' minor mode in this buffer." t) (autoload 'enable-auto-capitalize-mode "auto-capitalize" "Enable `auto-capitalize' minor mode in this buffer." t) ;;;;Sessions mode ;;;;http://emacs-session.sourceforge.net/ (require 'session) (add-hook 'after-init-hook 'session-initialize) (autoload 'session "~/.emacs.d/session.el" "This saves certain variables like input histories." t) ;;;;"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. ;;;;http://www.emacswiki.org/cgi-bin/wiki/ColorTheme (autoload 'color-theme "~/.emacs.d/color-theme.el" "Mode which changes the graphical theme." t) ;;;;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+.el" "Minor mode for numbering lines for text." t) ;(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.el" "A command which finds duplicate words in a buffer." t) ;;;;Add in pabbrev. Acts like openoffice's typeahead thingie, but ;;;;is buffer-specific, not working off of a generic dictionary like ;;;;OO. ;;;;http://homepages.cs.ncl.ac.uk/phillip.lord/download/emacs/pabbrev.el (autoload 'pabbrev "~/.emacs.d/pabbrev.el" "A mode which offers autocompletion for words, based on the buffer." t) (require 'pabbrev) (add-hook 'text-mode-hook 'pabbrev-mode) (add-hook 'wikipedia-mode-hook 'pabbrev-mode) ;;;;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.el" "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 '("index.\\.*" . wikipedia-mode)) ;;;;add auto-capitalize in addition to wikipedia-mode. (add-to-list 'auto-mode-alist '("index.\\.*" . auto-capitalize)) ;;;;Add check for duplicate words to wikipedia-mode. (add-to-list 'auto-mode-alist '("index.\\.*" . dw-check-to-end)) ;;;;Pabbrev mode too. Very useful. (add-to-list 'auto-mode-alist '("index.\\.*" . 'pabbrev-scavenge-buffer)) (add-to-list 'auto-mode-alist '("index.\\.*" . 'pabbrev-mode)) ;;;;Flyspell mode is good as well. (add-to-list 'auto-mode-alist '("index.\\.*" . 'flyspell-mode)) (add-to-list 'auto-mode-alist '("index.\\.*" . 'flyspell-buffer)) ;;;;Darcs mode. not yet sure how to use it. ;;;;http://www.emacswiki.org/cgi-bin/wiki/vc-darcs.el (autoload 'darcs-mode "~/.emacs.d/darcsum.el" "Minor mode for dealing with the darcs repository." t) ;;;;Crontab mode ;;;;http://www.mahalito.net/~harley/elisp/crontab-mode.el (autoload 'crontab-mode "~/.emacs.d/crontab-mode.el" "Major mode for editing the crontab" t) (add-to-list 'auto-mode-alist '("\\.cron\\(tab\\)?\\'" . crontab-mode)) ;;;;.ratpoisonrc mode (autoload 'ratpoisonrc-mode "~/.emacs.d/ratpoison.el" "Major mode for editting ratpoison rc file." t) (add-to-list 'auto-mode-alist '("\\.ratpoison\\(rc\\)?\\'" . ratpoisonrc-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.el" "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. ;;;;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.el" "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 editted, ;;;;they will be auto-sorted for ease of editting. ;;;;http://www.eskimo.com/~seldon/abbrev-sort.el (autoload 'abbrev-sort-mode "~/.emacs.d/abbrev-sort.el" "sorting abbrevs to make things easier." t) (abbrev-sort-mode 1) ;;;;;;;;;;;;;;;;;;;;;;;;;;MISC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;this goes into .Xmodmap; should kill caps lock dead: ;;; ! ;;; ! Swap Caps_Lock and Control_L ;;; ! ;;; remove Lock = Caps_Lock ;;; remove Control = Control_L ;;; ! Don't swap, forget it. ;;; !keysym Control_L = Caps_Lock ;;; keysym Caps_Lock = Control_L ;;; !add Lock = Caps_Lock ;;; add Control = Control_L ;;;;;;;;;;;CUSTOM;;;;;;;;;;;;;;;;;;;; (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. '(enable-recursive-minibuffers t) '(erc-autojoin-channels-alist (quote (("irc.freenode.net" "#Emacs" "#Wikipedia")))) '(erc-away-nickname "MaruTheSandman") '(erc-fill-column 82) '(erc-join-buffer (quote bury)) '(erc-manual-set-nick-on-bad-nick-p t) '(erc-modules (quote (autojoin button fill irccontrols match netsplit noncommands pcomplete ring scrolltobottom services sound stamp track))) '(erc-nick "Marudubshinki") '(erc-prompt-for-password nil) '(erc-reuse-buffers nil) '(erc-server "irc.freenode.net") '(erc-user-full-name "maru dubshinki") '(erc-whowas-on-nosuchnick t) '(icomplete-compute-delay 0.2) '(iswitchb-case t) '(iswitchb-max-to-show 10) '(iswitchb-mode t) '(iswitchb-prompt-newbuffer nil) '(iswitchb-regexp t) '(iswitchb-use-frame-buffer-list t) '(iswitchb-use-virtual-buffers t nil (recentf)) '(kill-ring-max 120) '(kill-whole-line t) '(type-break-good-break-interval 60) '(type-break-good-rest-interval 200) '(type-break-mode t nil (type-break))) (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. ) (setq debug-on-error nil);was set t at top of buffer