;; why would you ever want to exit GNU Emacs?
(global-set-key [?\C-x ?\C-c] '(lambda () 
				 (interactive) 
				 (when (y-or-n-p "Really exit Emacs? ")
				   (save-buffers-kill-emacs))))
(when (and (null window-system) 
	   (eq menu-bar-mode t))
  (menu-bar-mode nil))

;;(add-to-list 'load-path "~/elisp")
(add-to-list 'load-path "~/public_html/emacs/el")
(add-to-list 'load-path "~/elisp/gyach")

;;(protect-buffer-from-kill-mode nil (get-buffer "*scratch*"))

;; (defun ebuild-mode ()
;;   (shell-script-mode)
;;   (sh-set-shell "bash")
;;   (make-local-variable 'tab-width)
;;   (setq tab-width 4))


;;(add-hook 'message-setup-hook 'flyspell-mode)


;; (add-to-list 'auto-mode-alist '("\\.elisp\\'" . emacs-lisp-mode))
;; (add-to-list 'auto-mode-alist '("\\.eclass\\'" . ebuild-mode))
;; (add-to-list 'auto-mode-alist '("\\.ebuild\\'" . ebuild-mode))

(add-hook 'comint-output-filter-functions
          'comint-truncate-buffer)
(add-hook 'comint-output-filter-functions
          'comint-watch-for-password-prompt)
(add-hook 'shell-mode-hook 
	  'ansi-color-for-comint-mode-on)
(add-hook 'eshell-preoutput-filter-functions
	  'ansi-color-apply)
(add-hook 'emacs-lisp-mode-hook
	  'turn-on-eldoc-mode)
(add-hook 'text-mode-hook
	  'turn-on-auto-fill)
(add-hook 'find-file-hooks 
	  'auto-insert)
(add-hook 'write-file-hooks 
	  'time-stamp)

;;(add-hook 'message-setup-hook 'flyspell-mode)
(add-hook 'message-mode-hook 'footnote-mode)
(add-hook 'mail-mode-hook 'footnote-mode)
;;(add-hook 'gnus-summary-mode-hook 'highline-on)
(add-hook 'shell-script-mode '(lambda 
				(setq tab-width 4)
				(set-shell "bash")))

(setq auto-insert-directory "~/.autoinsert/")

;; ILISP

(setq ilisp-*use-frame-for-output* nil)

;; ERC
(load-library "erc-fill")
(load-library "erc-button")
(load-library "erc-match")
(load-library "erc-menu")
(load-library "erc-imenu")
 
(eval-after-load "erc"
  '(progn
     (custom-set-variables
      '(erc-auto-query t)
      '(erc-button-mode t nil (erc-button))
      '(erc-fill-mode t nil (erc-fill))
      '(erc-fill-prefix "    + ")
      '(erc-match-mode t nil (erc-match))
      '(erc-nick "lcandell")
      '(erc-server "irc.freenode.net"))
      (load-library "erc-ring")))
(add-hook 'erc-mode-hook
          '(lambda ()
             (require 'erc-pcomplete)
             (pcomplete-erc-setup)
             (erc-completion-mode 1)))

(when (fboundp 'auto-image-file-mode)
  (auto-image-file-mode 1))

(setq erc-user-full-name "Louis C. Candell")
(setq erc-email-userid "lcandell@ossh.c0m")

;; (require 'session)
;; (add-hook 'after-init-hook 'session-initialize)

(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-compression-mode t nil (jka-compr))
 '(blink-cursor nil)
 '(browse-url-browser-function (quote w3m-browse-url))
 '(canlock-password "0e85ad7fa3f13d04bb829cf70fbbaaf204eb5a45")
 '(case-fold-search t)
 '(chess-default-engine (quote (chess-gnuchess chess-crafty chess-phalanx)))
 '(comint-buffer-maximum-size 2048)
 '(compilation-window-height 15)
 '(current-language-environment "Latin-1")
 '(default-input-method "latin-1-prefix")
 '(dired-recursive-copies (quote always))
 '(dired-recursive-deletes (quote always))
 '(display-time-mode t nil (time))
 '(erc-auto-query t)
 '(erc-button-mode t nil (erc-button))
 '(erc-fill-mode t nil (erc-fill))
 '(erc-fill-prefix "    + ")
 '(erc-match-mode t nil (erc-match))
 '(erc-nick "lcandell")
 '(erc-server "irc.freenode.net")
 '(eshell-buffer-maximum-lines 4096)
 '(eshell-output-filter-functions (quote (eshell-handle-control-codes eshell-watch-for-password-prompt eshell-truncate-buffer)))
 '(global-font-lock-mode t nil (font-lock))
 '(ilisp-*use-fsf-compliant-keybindings* t)
 '(inhibit-startup-message t)
 '(iswitchb-mode t nil (iswitchb))
 '(load-home-init-file t t)
 '(ls-lisp-dirs-first t)
 '(mail-user-agent (quote gnus-user-agent))
 '(menu-bar-mode t nil (menu-bar))
 '(minibuffer-electric-default-mode t nil (minibuf-eldef))
 '(mm-discouraged-alternatives (quote ("text/html")))
 '(mm-inline-large-images t)
 '(mouse-avoidance-mode nil nil (avoid))
 '(ps-print-color-p nil)
 '(quack-default-program "scsh")
 '(quack-fontify-style (quote emacs))
 '(quack-pretty-lambda-p t)
 '(save-place t nil (saveplace))
 '(scheme-program-name "guile")
 '(scroll-bar-mode nil)
 '(show-paren-mode t nil (paren))
 '(smtp-default-server "mail.earthlink.net")
 '(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify)))
 '(tooltip-mode nil nil (tooltip))
 '(transient-mark-mode t)
 '(uniquify-buffer-name-style (quote forward) nil (uniquify))
 '(use-dialog-box nil)
 '(visible-bell t)
 '(woman-fill-frame 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.
 '(default ((t (:height 72 :width normal :family "b&h-lucidatypewriter"))))
 '(gnus-group-mail-3-empty-face ((((class color) (background light)) (:foreground "blue"))))
 '(gnus-group-mail-3-face ((((class color) (background light)) (:foreground "blue" :weight bold))))
 '(gnus-group-news-3-empty-face ((((class color) (background light)) (:foreground "darkgreen"))))
 '(gnus-group-news-3-face ((((class color) (background light)) (:foreground "darkgreen" :weight bold)))))

(put 'dired-find-alternate-file 'disabled nil)
(put 'narrow-to-region 'disabled nil)
;;(setq initial-major-mode 'inferior-emacs-lisp-mode)



(if (eq window-system nil)
	(global-set-key "\C-d" 'delete-backward-char))
