;;; Copyright (c) 2004-2007 bivio Software, Inc. All rights reserved.
;;;
;;; Visit http://www.bivio.biz for more info.
;;;
;;; This library is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU Lesser General Public License as
;;; published by the Free Software Foundation; either version 2.1 of the
;;; License, or (at your option) any later version.
;;;
;;; This library is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;;; Lesser General Public License for more details.
;;;
;;; You should have received a copy of the GNU Lesser General Public
;;; License along with this library; If not, you may get a copy from:
;;; http://www.opensource.org/licenses/lgpl-license.html
;;;
;;; $Id: b-site-start.el,v 1.42 2011/09/22 16:07:50 nagler Exp $
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; You will need to define a few variables after this file is
;;; loaded. Search for the word "YOUR" in all upper-case.
;;;
(provide 'b-site-start)
(load-library "b-perl")
(load-library "b-hours")
(require 'sgml-mode)
(require 'compile)
(require 'cc-mode)
(require 'comint)
(global-font-lock-mode t)
(setq
next-line-add-newlines nil
case-replace t
case-fold-search t
visible-bell t
highlight-nonselected-windows nil
term-term-name "eterm"
ring-bell-function 'ignore
truncate-partial-width-windows nil
completion-ignore-case t
read-file-name-completion-ignore-case t
read-buffer-completion-ignore-case t
large-file-warning-threshold 100000000)
(unless window-system
(progn
(if (string-match "^21" emacs-version)
(set-keyboard-coding-system nil))
(setq visible-bell nil)))
;;; This show you what you've selected with the mouse
(transient-mark-mode t)
;; accelerate scrolling when the mouse gets dragged beyond the edge of a window
(if (string-equal system-type "darwin")
(progn
(setq mouse-scroll-delay 0.1)
(if (functionp 'server-force-delete)
(server-force-delete))
(server-start)
(global-set-key [?\A-S] 'write-file)
(global-set-key [?\A-a] 'mark-whole-buffer)
(global-set-key [?\A-c] 'clipboard-kill-ring-save)
(global-set-key [?\A-f] 'isearch-forward)
(global-set-key [?\A-l] 'goto-line)
(global-set-key [?\A-n] 'new-frame)
(global-set-key [?\A-o] 'find-file)
(global-set-key [?\A-q] 'save-buffers-kill-emacs)
(global-set-key [?\A-s] 'save-buffer)
(global-set-key [?\A-v] 'clipboard-yank)
(global-set-key [?\A-x] 'clipboard-kill-region)
(global-set-key [?\A-z] 'undo))
(if (string-equal system-type "windows-nt")
(progn
(setq x-select-enable-clipboard t)
(if (load "gnuserv" 'noerror 'nomessage)
(progn
(gnuserv-start)
(setq gnuserv-frame (selected-frame)))
))
(progn
(server-start)
;; Setting this to true does not allow pasting between emacs and
;; normal windows.
(setq x-select-enable-clipboard nil))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; abbrevs.el (load if exists)
;;;
(condition-case nil
(quietly-read-abbrev-file)
(error nil))
; Bind some keys so people know they are there...
(define-key ctl-x-map "ae" 'edit-abbrevs)
; We want to actually write the file each time. It is a cleaner model
; for the user.
(define-key edit-abbrevs-map "\C-c\C-c" 'save-abbrevs-redefine)
(define-key edit-abbrevs-map "\C-x\C-s" 'save-abbrevs-redefine)
(defun save-abbrevs-redefine ()
"Redefine abbrevs according to current buffer contents and save."
(interactive)
(edit-abbrevs-redefine)
(write-abbrev-file abbrev-file-name)
(setq abbrevs-changed nil))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; compile.el fixes
;;;
(eval-after-load
"compile"
'(setq compilation-error-regexp-alist
(append
'((".*at \\([^ ]+\\) line \\([0-9]+\\)\\.?\n" 1 2)) ; Support perl
compilation-error-regexp-alist)))
(add-hook 'mail-setup-hook 'mail-abbrevs-setup)
(setq mail-self-blind t)
(put 'eval-expression 'disabled nil)
(put 'narrow-to-region 'disabled nil)
(setq visible-bell t)
(setq indent-line-function 'indent-relative-maybe)
;; some file name extensions
(load "sgml-mode")
;; Delete unwanted auto-modes
(setq interpreter-mode-alist nil)
(mapcar '(lambda (mode)
(let ((x))
; Delete all occurances
(while (setq x (rassoc mode auto-mode-alist))
(setq auto-mode-alist (delq x auto-mode-alist)))))
'(tcl-mode
sh-mode
nroff-mode))
(add-hook 'text-mode-hook
'(lambda ()
(abbrev-mode t)
(define-key text-mode-map "\C-c|"
(lambda () "insert change bar at end of line"
(interactive)
(end-of-line)
(if (< (current-column) fill-column)
(move-to-column fill-column t)
(insert " "))
(insert "|")
(forward-line)))
(turn-on-auto-fill)))
(setq dabbrev-case-fold-search t)
(setq dabbrev-case-replace nil)
(setq dabbrev-abbrev-char-regexp "\\sw\\|\\s_")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; C
;;;;
(add-hook 'java-mode-hook
'(lambda ()
(c-set-style "RGI")
(make-local-variable 'compile-command)
(setq compile-command
(concat (if (getenv "JAVAC") (getenv "JAVAC") "javac")
" "
(if (getenv "JAVAC_FLAGS")
(getenv "JAVAC_FLAGS") "-g")
" "
(file-name-nondirectory buffer-file-name)))
(cond (window-system
(require 'andersl-java-font-lock)
(turn-on-font-lock)))))
(setq font-lock-maximum-decoration t)
(add-hook 'c-mode-common-hook
'(lambda ()
(setq fill-column 79)
(setq c-tab-always-indent nil)
(setq c-echo-syntactic-information-p t)
(modify-syntax-entry ?_ "w" c-mode-syntax-table)
(c-toggle-auto-state +1)
(c-toggle-hungry-state -1)
(auto-fill-mode +1)
(abbrev-mode t)
))
(modify-syntax-entry ?_ "w" c-mode-syntax-table)
(modify-syntax-entry ?$ "w" java-mode-syntax-table)
(define-key c-mode-map "\C-c\C-c" 'next-error)
(define-key c-mode-map "\C-c\C-m" 'compile)
(define-key c-mode-map "\C-c\C-f" 'auto-fill-mode)
(define-key c-mode-map "\C-m" 'newline-and-indent)
(define-key c-mode-base-map "\C-c;" 'c-right-justify-comment)
(define-key c-mode-base-map "\C-c," 'c-align-decls)
(define-key c-mode-base-map "\C-c\C-m" 'compile)
(define-key c-mode-base-map "\C-c\C-m" 'compile)
(define-key c-mode-base-map "\C-c\C-e" 'next-error)
(define-key java-mode-map "\C-c<"
(lambda () "insert <" (interactive) (insert "<")))
(define-key java-mode-map "\C-c>"
(lambda () "insert >" (interactive) (insert ">")))
(define-key java-mode-map "\C-c "
(lambda () "insert " (interactive) (insert " ")))
(define-key java-mode-map "\C-c\n"
(lambda () "insert " (interactive)
(insert " ") (newline-and-indent)))
(define-key java-mode-map "\C-ct"
(lambda () "insert " (interactive) (sgml-tag "tt")))
(define-key java-mode-map "\C-cp"
(lambda () "insert