
(put 'eval-expression 'disabled nil)

(setq line-number-mode t)
(setq track-eol 1)
(require 'paren)

(global-set-key [delete] 'delete-char)
(global-set-key [backspace] 'backward-delete-char-untabify)
(global-set-key [C-home] 'beginning-of-buffer)
(global-set-key [C-end] 'end-of-buffer)
(global-set-key [C-prior] 'backward-sexp)
(global-set-key [C-next] 'forward-sexp)
(global-set-key [f3] 'kill-region)
(global-set-key [f4] 'yank)
(global-set-key [f5] 'start-kbd-macro)
(global-set-key [f6] 'call-last-kbd-macro)
(global-set-key [f7] 'end-kbd-macro)
(global-set-key [f8] 'goto-line)
(global-set-key [f9] 'global-set-key)
(global-set-key [SunF37] 'goto-line)
;;(global-set-key [C-left] 'backward-word)
;;(global-set-key [C-right] 'forward-word)
;;(global-set-key [C-up] '(forward-line -1))
;;(global-set-key [C-down] 'forward-line)
(global-set-key [S-F30] 'backward-char)
(global-set-key [S-F32] 'forward-char)
(global-set-key [S-F28] 'previous-line)
(global-set-key [S-F34] 'next-line)


;; The following line of code allows the BACKSPACE key to be used
;; as the DELETE key.
(define-key global-map "\C-h" 'delete-backward-char)
;; The following line defines C-c C-h to get help.  Normally 
;; the BACKSPACE key is used for help.
(define-key global-map "\C-c\C-h" 'help-for-help)


(defun pc-keys-home ()
  "Go to beginning of line/window/buffer.
First hitting key goes to beginning of line, second in a row goes to
beginning of window, third in a row goes to beginning of buffer."
  (interactive)
  (let* ((keys (recent-keys))
         (len (length keys))
         (key1 (if (> len 0) (elt keys (- len 1)) nil))
         (key2 (if (> len 1) (elt keys (- len 2)) nil))
         (key3 (if (> len 2) (elt keys (- len 3)) nil))
         (key-equal-1 (eq key1 key2))
         (key-equal-2 (and key-equal-1 (eq key2 key3))))
    (cond (key-equal-2 (if mark-active
                           (goto-char (point-min))
                         (beginning-of-buffer)))
          (key-equal-1 (if mark-active () (push-mark))
                       (move-to-window-line 0))
          (t (beginning-of-line)))))

(defun pc-keys-end ()
  "Go to end of line/window/buffer.
First hitting key goes to end of line, second in a row goes to end
of window, third in a row goes to end of buffer."
  (interactive)
  (let* ((keys (recent-keys))
         (len (length keys))
         (key1 (if (> len 0) (elt keys (- len 1)) nil))
         (key2 (if (> len 1) (elt keys (- len 2)) nil))
         (key3 (if (> len 2) (elt keys (- len 3)) nil))
         (key-equal-1 (eq key1 key2))
         (key-equal-2 (and key-equal-1 (eq key2 key3))))
    (cond (key-equal-2 (if mark-active
                           (goto-char (point-max))
                         (end-of-buffer)))
          (key-equal-1 (if mark-active () (push-mark))
                       (move-to-window-line -1)
                       (end-of-line))
          (t (end-of-line)))))

(global-set-key [home] 'pc-keys-home)
(global-set-key [end] 'pc-keys-end)

; create a new face
(make-face 'my-comment-face)
; set its foreground and background color
(set-face-foreground 'my-comment-face "DarkBlue")
(set-face-background 'my-comment-face "white")
(make-face-italic 'my-comment-face)
; let the new face be the font-lock-comment-face
(setq font-lock-comment-face 'my-comment-face)

(make-face 'my-string-face)
(set-face-foreground 'my-string-face "red")
(set-face-background 'my-string-face "white")
;(set-face-underline-p 'my-string-face t)
(make-face-italic 'my-string-face)
(setq font-lock-string-face 'my-string-face)

(make-face 'my-keyword-face)
(set-face-foreground 'my-keyword-face "blue")
(set-face-background 'my-keyword-face "white")

(make-face 'my-func-face)
(set-face-foreground 'my-func-face "Darkgreen")
(set-face-background 'my-func-face "white")

(setq font-lock-keyword-face 'my-keyword-face)
(setq font-lock-function-name-face 'my-func-face)

(add-hook 'find-file-hooks
  '(lambda () (font-lock-mode 1)))

(set-variable 'c-argdecl-indent 2)
