; $RCSfile: .emacs,v $ $Revision: 1.12 $ $Date: 2001/12/30 18:21:28 $

;;; Define a variable to indicate whether we're running XEmacs/Lucid Emacs.
;;; (You do not have to defvar a global variable before using it --
;;; you can just call `setq' directly like we do for `emacs-major-version'
;;; below.  It's clearer this way, though.)

(defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))


;; Options Menu Settings
;; =====================
(cond
 ((and (string-match "XEmacs" emacs-version)
       (boundp 'emacs-major-version)
       (or (and
            (= emacs-major-version 19)
            (>= emacs-minor-version 14))
           (>= emacs-major-version 20))
       (fboundp 'load-options-file))
  (load-options-file "~/.xemacs-options")))
;; ============================
;; End of Options Menu Settings

;;; Einruecken fuer C-Quellen einstellen 
(defun my-c-mode-common-hook ()
  ;; use K&R style 
  (c-set-style "k&r")
  (c-set-offset 'case-label            '+) 
  (c-set-offset 'statement-case-intro 4) 
  (c-set-offset 'comment-intro        8)
  ; Leerzeichen fuer Einruecken werden automatisch eingefuegt
  (define-key c-mode-map "\C-m" 'newline-and-indent)
  ; Tabstops setzen
  (setq tab-stop-list '(5 16 24 29 74))
  )
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
(add-hook 'c-mode-hook (lambda () (setq c-basic-offset 2)))

;; Einruecken fuer Perl (nur vorlaeufig, noch verbesserungsbeduerftig!)
(setq cperl-extra-newline-before-brace t)
(setq cperl-brace-offset -2)

;; erweiterte Menueleiste laden
(load-library "big-menubar.elc")

; Variablen, die zum Teil ber das Options-Men im Xemacs gesetzt wurden: 
(custom-set-variables
 '(ispell-dictionary "/usr/lib/ispell/deutsch.hash")
 '(delete-key-deletes-forward t)
 '(column-number-mode t)
 '(c-tab-always-indent nil)
 '(c-indent-comments-syntactically-p t)
 '(line-number-mode t)
 '(frame-title-format (quote ("%S: " (buffer-file-name "%f" (dired-directory dired-directory "%b")))) t)
 '(vc-rcsdiff-knows-brief (quote no) t))
(custom-set-faces)

;; This adds additional extensions which indicate files normally
;; handled by cc-mode:
;;  .mt   Modultest
(setq auto-mode-alist
      (append '(("\\.mt"  . c-mode))
            auto-mode-alist))

;; Turn on Auto Fill mode automatically in Text mode and related modes.
(setq text-mode-hook
     '(lambda () (auto-fill-mode 1)))

;;; ********************
;;; func-menu is a package that scans your source file for function
;;; definitions and makes a menubar entry that lets you jump to any
;;; particular function definition by selecting it from the menu.  The
;;; following code turns this on for all of the recognized languages.
;;; Scanning the buffer takes some time, but not much.
;;;
;;; Send bug reports, enhancements etc to:
;;; David Hughes <ukchugd@ukpmr.cs.philips.nl>
;;;
(cond (running-xemacs
       (require 'func-menu)
       (define-key global-map 'f8 'function-menu)
       (add-hook 'find-file-hooks 'fume-add-menubar-entry)
       (define-key global-map "\C-cl" 'fume-list-functions)
       (define-key global-map "\C-cg" 'fume-prompt-function-goto)

       ;; The Hyperbole information manager package uses (shift button2) and
       ;; (shift button3) to provide context-sensitive mouse keys.  If you
       ;; use this next binding, it will conflict with Hyperbole's setup.
       ;; Choose another mouse key if you use Hyperbole.
       (define-key global-map '(shift button3) 'mouse-function-menu)

       ;; For descriptions of the following user-customizable variables,
       ;; type C-h v <variable>
       (setq fume-max-items 25
             fume-fn-window-position 3
             fume-auto-position-popup t
             fume-display-in-modeline-p t
             fume-menubar-menu-location "Apps"
             fume-buffer-name "*Function List*"
             fume-no-prompt-on-valid-default nil)
       ))

; Fuer GNATS:
; (autoload 'send-pr "send-pr" "Submit a Problem Report." t)

; fuer TeX
(require 'tex-site)
