
; ---- file: .emacs
; ----       put to ~/.emacs (gnu/linux) resp. c:/.emacs (ms/windows)

;;(standard-display-european 1)
(set-input-mode (car (current-input-mode))
		(nth 1 (current-input-mode)) 0)
;;(load-library "iso-syntax")

;; ---- tkScript source/examples emacs settings ----
;; ---- tabwidth: 3

(setq line-number-mode t)
(setq scroll-step 1)
(setq next-line-add-newlines nil)
(setq c-font-lock-mode t)
(setq column-number-mode t)

(autoload 'c++-mode  "cc-mode" "C++ Editing Mode" t)
(autoload 'c-mode    "cc-mode" "C Editing Mode" t)
(autoload 'objc-mode "cc-mode" "Objective-C Editing Mode" t)
(setq auto-mode-alist
  (append '(("\\.C$"  . c++-mode)
            ("\\.cc$" . c++-mode)
            ("\\.cpp$" . c++-mode)
            ("\\.tks$" . java-mode)
            ("\\.xfm$" . sgml-mode)
            ("\\.tkp$" . sh-mode)
            ("\\.c$"  . c-mode)
            ("\\.h$"  . c-mode)
            ("\\.m$"  . objc-mode)
           ) auto-mode-alist))

;; 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

;(put 'eval-expression 'disabled nil)

;(setq minibuffer-max-depth nil)

; My key bindings

(global-set-key "\C-j" 'goto-line)
(global-set-key "\C-g" 'buffer-menu)
;(global-set-key "\C-c v" 'uncomment-region)
(global-set-key "\C-f" 'isearch-forward-regexp)
(global-set-key (kbd "C-#") 'quick-calc)
(global-set-key (kbd "C-.") 'hippie-expand)


;;(load-library "delbackspace")
;;(load-library "gtags")
;;(autoload 'gtags-mode "gtags" "" t)

;;(load-library "etags")
;;(global-set-key "\C-t" 'tags-search)
;;(global-set-key "\C-a" 'tags-apropos)
;;(global-set-key "\C-l" 'tags-loop-continue)

;(set-default-font "-adobe-courier-*-r-*-*-18-*-*-*-*-*-*")
(setq-default font-lock-auto-fontify t)
(setq-default font-lock-use-fonts '(or (mono) (grayscale)))
(setq-default font-lock-use-colors nil)
(setq-default font-lock-maximum-decoration t)
(setq-default font-lock-maximum-size 256000)
(setq-default font-lock-mode-enable-list t)
(setq-default font-lock-mode-disable-list nil)
(require 'font-lock)
(global-font-lock-mode)

;(remove-hook 'font-lock-mode-hook 'turn-on-fast-lock)
;(remove-hook 'font-lock-mode-hook 'turn-on-lazy-lock)
(setq transient-mark-mode t)
;(load "/usr/local/xref/emacs19/emacs.in")

(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.
 '(case-fold-search t)
 '(column-number-mode t)
 '(current-language-environment "German")
 '(default-input-method "german-postfix")
 '(display-time-mode t)
 '(global-font-lock-mode t nil (font-lock))
 '(org-agenda-files (quote ("~/tks-projects/syntracker/doc/todo.txt" "~/tks-projects/syntracker/doc/test.org")))
 '(query-user-mail-address nil)
 '(user-mail-address "a@b.de"))
(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.
 )


;(put 'auto-save-mode 'disabled t)

;(put 'recover-file 'disabled t)

;(put 'dired-backup-diff 'disabled t)

;(put 'diff-backup 'disabled t)

;(put 'auto-revert-mode 'disabled t)

;(put 'upcase-region 'disabled nil)

;(put 'downcase-region 'disabled nil)

;(setq tab-stop-list '(4 8 12 16))
;(setq tab-stop-list '4)
; 20 24 28 32 36 40 44 48 52 56 60 64 68

(setq c-basic-offset 3)
(setq indent-tabs-mode nil)

; from http://cc-mode.sourceforge.net/html-manual/Sample-.emacs-File.html#Sample%20.emacs%20File
(defconst my-c-style
  '((c-tab-always-indent        . t)
    (c-comment-only-line-offset . 0)
    (c-basic-offset             . 3)
    (c-brace-offset             . 0)
    (c-indent-level             . 0)
;;    (c-brace-imaginary-offset   . 0)
;;    (c-continued-statement-offset . 0)
    (c-hanging-braces-alist     . ((substatement-open after)
                                   (brace-list-open)))
    (c-hanging-colons-alist     . ((member-init-intro before)
                                   (inher-intro)
                                   (case-label after)
                                   (label after)
                                   (access-label after)))
    (c-cleanup-list             . (scope-operator
                                   empty-defun-braces
                                   defun-close-semi))
    (c-offsets-alist            . ((arglist-close . c-lineup-arglist)
                                   (substatement-open . 0)
                                   (case-label        . 3)
                                   (block-open        . 0)
				   (knr-argdecl-intro . -)
				   ))
    (c-echo-syntactic-information-p . t))
  "My C Programming Style")


 ;; offset customizations not in my-c-style
;; (setq c-offsets-alist '((member-init-intro . ++)))

;; Customizations for all modes in CC Mode.
(defun my-c-mode-common-hook ()
  ;; add my personal style and set it for the current buffer
  (c-add-style "tkScript" my-c-style t)
  ;; other customizations
  (setq tab-width 3
        ;; this will make sure spaces are used instead of tabs
        indent-tabs-mode nil)
  ;; we like auto-newline and hungry-delete
;  (c-toggle-auto-hungry-state 1)
  ;; key bindings for all supported languages.  We can put these in
  ;; c-mode-base-map because c-mode-map, c++-mode-map, objc-mode-map,
  ;; java-mode-map, idl-mode-map, and pike-mode-map inherit from it.
;  (define-key c-mode-base-map "\C-m" 'c-context-line-break)
)
     
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

;;;(setq c-default-style '((java-mode . "tkScript") (awk-mode . "awk") (other . "gnu")) )



(setq display-time-24hr-format t)
(display-time)
(pc-selection-mode)

(global-set-key (kbd "C-x C-b") 'ibuffer)
(autoload 'ibuffer "ibuffer" "List buffers." t)

;; for emacs-23.1:
(tool-bar-mode -1)
(setq inhibit-splash-screen t)

(setq initial-frame-alist (append '((width . 152) (height . 70) (top . 0) (left . 650) ) initial-frame-alist))

;;;;;;;;;;;;;;;;(setq org-todo-keywords '((type "IDEA" "TODO" "WIP" "REJECTED" | "DONE")))

(setq org-todo-keyword-faces
           '(("IDEA" . (:foreground "yellow2"))
	     ("DONE" . (:foreground "sea green" :weight bold))
	     ("TODO" . org-warning) 
	     ("ACTV" . (:foreground "white" :background "dark orange"))
             ("TEST" . (:foreground "green" :background "dark green"))
             ("DONT" . (:foreground "purple" ))
             ("IGNR" . (:foreground "thistle"))
	     ))

