;;
;; $Id: CS_KOELN 3027 2005-11-10 22:37:16Z lange $
;;
; Pfade zum laden
(setq load-path (append '("~") load-path))

; Tastendefinitionen
(global-set-key "\C-x?"    'help-command)
(global-set-key "\C-h"     'backward-delete-char-untabify)
(global-set-key "\C-xc"    'copy-region-as-kill)
(global-set-key "\C-b"     'kill-word)

(global-set-key [S-f2]     'switch-to-buffer)
(global-set-key [f2]       'save-buffer)
(global-set-key [S-f3]     'find-file-other-window)
(global-set-key [f3]       'find-file)
(global-set-key [S-f4]     'server-edit)
(global-set-key [f4]       'kill-this-buffer)
(global-set-key [S-f5]     'other-window)
(global-set-key [f5]       'delete-other-windows)
(global-set-key [S-f6]     'auto-fill-mode)
(global-set-key [S-f7]     'ispgerman)
(global-set-key [f7]       'ispenglish)
(global-set-key [f8]       'vm)
(global-set-key [S-f9]     'cvs-update)
(global-set-key [f9]       'compile)
(global-set-key [S-f10]    'tags-search)
(global-set-key [f10]      'first-error)
(global-set-key [SunF36]   'previous-error)
(global-set-key [S-SunF37] 'comment-region)
(global-set-key [SunF37]   'next-error)
(global-set-key [f11]      'previous-error)
(global-set-key [S-f12]    'comment-region)
(global-set-key [f12]      'next-error)

(add-hook 'plain-TeX-mode-hook
          '(lambda () (define-key plain-TeX-mode-map [SunF37] 'TeX-next-error) ))
(add-hook 'LaTeX-mode-hook
          '(lambda () (define-key LaTeX-mode-map [SunF37] 'TeX-next-error) ))

(define-key global-map [M-S-down-mouse-3] 'imenu)

; Keyboard Makros

;; 'scroll-down-other-buffer'. This macro changes into the other
;; buffer (via C-x o), jumps to the end of that buffer and returns
;; into the first buffer again (via C-x o).  This macro can be used to
;; follow the output of a compilation in the other buffer. Because
;; after the execution of this macro the other buffer will always be
;; scrolled after new lines are inserted into this *compilation*
;; buffer by the compiler.
(fset 'scroll-down-other-buffer
   [?\C-x ?o escape ?> ?\C-x ?o])
(global-set-key    [f22]  'scroll-down-other-buffer)

; Allgemeines
(setq mail-host-address "informatik.uni-koeln.de"
      next-line-add-newlines nil
      kill-whole-line t
      backup-by-copying-when-linked t
      text-mode-hook 'turn-on-auto-fill
      make-backup-files t
      auto-save-default nil
      display-time t
      ctl-arrow t
      indent-tabs-mode t
      default-major-mode 'indented-text-mode 
      compile-command "gmake -k"
      dabbrev-case-fold-search nil
)

(transient-mark-mode t) ; marked region grau einfaerben 
(standard-display-european t)
(server-start)
(display-time)

(defun ispgerman ()
  "ispell deutsch"
  (interactive)
  (ispell-change-dictionary "deutsch")
  (ispell-buffer)
)

(defun ispenglish ()
  "ispell english"
  (interactive)
  (ispell-change-dictionary "default")
  (ispell-buffer)
)

(load "paren") ;  hebt Klammern hervor
(load "complete")
;(require 'iso-syntax)
(require 'iso-acc)
(require 'disp-table)

; highlighting: entweder fon-lock oder hl319
(global-font-lock-mode t)

;(cond (window-system
;       (require 'hl319)
;       (require 'hilit-LaTeX)
;       (setq hilit-mode-enable-list  '(not text-mode)
;	     hilit-background-mode   'light
;	     hilit-inhibit-hooks     t
;	     hilit-inhibit-rebinding nil
;	     hilit-auto-highlight-maxout 200000
;	     hilit-auto-highlight t
;	     hilit-auto-rehighlight t
;	     hilit-AmSLaTeX-commands t
;	     hilit-LaTeX-commands t
;	     hilit-multilingual-strings t
;       )
;))

;;
;; Mode spezifisches
;;

; dired mode
; kein -a bei dired mode
(setq dired-listing-switches "-l")

;;  Alles fuer den reftex - Mode
(autoload 'reftex-mode    "reftex" "RefTeX Minor Mode" t)
(autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
(add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode

; auctex
(defvar TeX-save-query nil)
(defvar TeX-quote-after-quote t)
;(setq-default TeX-master nil) ; Query for master file

;; C++ - Einstellungen
(setq c-auto-newline nil)
(setq c-brace-offset -2)

;; gnus
(defvar gnus-show-threads nil)
; klappt noch nicht (setq gnus-summary-mode-hook 'gnus-summary-sort-by-subject)

;;  CVS Mode
;(load "pcl-cvs-startup")

;; c-no-web-Mode
;(load "c-no-web")

;; cperl-mode
(load "cperl-mode")
(setq cperl-hairy t)
(setq auto-mode-alist
      (append '(("\\.\\([pP][Llm]\\|al\\)$" . perl-mode))  auto-mode-alist ))
(setq interpreter-mode-alist (append interpreter-mode-alist
      '(("miniperl" . perl-mode))))

(add-hook 'cperl-mode-hook
          '(lambda () (define-key cperl-mode-map "\e\r" 'cperl-linefeed) ))

; ---------------------------
;; persoenliche definitionen
; ---------------------------

;; 1 auf Ziffernblock
;(global-set-key    [f33]  'backward-word)
;;; 3 auf Ziffernblock
;(global-set-key    [f35]  'forward-word)
;;; 9 auf Ziffernblock
;(global-set-key    [f29]  'scroll-up)
;;; 7 auf Ziffernblock
;(global-set-key    [f27]  'scroll-down)

;(setq TeX-default-mode 'plain-tex-mode)
(setq tex-dvi-view-command "xdvi")

(require 'tex-site)
