(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.
 '(blink-cursor-mode nil)
 '(column-number-mode t)
 '(delete-selection-mode t)
 '(display-battery-mode nil)
 '(display-time-mode t)
 '(ecb-layout-window-sizes nil)
 '(ecb-options-version "2.32")
 '(ecb-source-path (quote (("c:" "c:") "e:")))
 '(ecb-wget-setup (quote cons))
 '(global-font-lock-mode t)
 '(indicate-buffer-boundaries (quote right))
 '(indicate-empty-lines t)
 '(inhibit-startup-message t)
 '(mouse-wheel-scroll-amount (quote (1 ((shift) . 1) ((control)))))
 '(scalable-fonts-allowed t)
 '(scroll-conservatively 50)
 '(scroll-margin 0)
 '(show-paren-mode t)
 '(tab-width 4)
 '(transient-mark-mode t)
 '(visible-bell nil))
;;; #####################################################################

;; *** Dired (directory navigation in the editor)
;; Make it so dired lets you explore directories in a single window (pane) without
;; constantly opening subdirectories and files in new panes. This is the way dired
;; works in XEmacs
(defun dired-mouse-find-file(event)
  "switch to the clicked file or directory in the same window"
  (interactive "e")
  (mouse-set-point event)
  (dired-find-file))

(add-hook 'dired-load-hook
		  (lambda ()
			(load "dired-x")
			;; Set dired-x global variables here.  For example:
			;; (setq dired-guess-shell-gnutar "gtar")
			;; (setq dired-x-hands-off-my-keys nil)
			))
(add-hook 'dired-mode-hook
          '(lambda ()
             (define-key dired-mode-map [(mouse-2)] 'dired-mouse-find-file)
             ))

(add-hook 'dired-mode-hook
		  (lambda ()
			;; Set dired-x buffer-local variables here.  For example:
			;; (dired-omit-mode 1)
			))

;; say no yank by mouse-2
(global-unset-key [(mouse-2)])
(global-unset-key [(M-mouse-2)])



;; CEDET
;;(load-file "c:/Dev/emacs/site-lisp/cedet-1.0pre3/common/cedet.el")
 (load "cedet")
;; ECB
 (require 'ecb)
;; Enabling various SEMANTIC minor modes.  See semantic/INSTALL for more ideas.
;; Select one of the following
;; (semantic-load-enable-code-helpers)
 (semantic-load-enable-guady-code-helpers)
;; (semantic-load-enable-excessive-code-helpers)

;; Enable this if you develop in semantic, or develop grammars
;; (semantic-load-enable-semantic-debugging-helpers)
 

;; MISC DEFUNS
(defun my-kill-buffer ()
  "Just kill the current buffer without asking, unless of course it's a
modified file"
  (interactive)
  (kill-buffer (current-buffer)))
(defun my-switch-to-previous-buffer ()
  "Switch to the most recently visited buffer without asking"
  (interactive)
  (switch-to-buffer nil))

(defun my-info-other-frame ()
  (interactive)
  (select-frame (make-frame))
  (info))
(defun my-matching-paren (arg)
  (interactive "P")
  (if arg
      () ;;(insert "%")  ; insert the character we're bound to
    (cond ((looking-at "[[({<]")
           (forward-sexp 1)
           (forward-char -1))
          ((looking-at "[]})>]")
           (forward-char 1)
           (forward-sexp -1))
          (t
           ;; (insert "%")  ; insert the character we're bound to
      ))))
;; 
(defun my-other-window-backward (&optional n)
  "Select the previous window. Copied from \"Writing Gnu Emacs Extensions\"."
  (interactive "P")
  (other-window (- (or n 1))))

;; my-insert-squire-parentheses:

(defun my-insert-curly-braces (&optional arg)
  (interactive "P")
  (insert-pair arg ?\{ ?\}))

;; MISC BINDINGS 
(global-set-key [(control tab)] 'other-window) ; C-TAB
(global-set-key [(control shift tab)] 'my-other-window-backward) ; C-SHIFT-TAB

(global-set-key "\C-x\C-k" 'my-kill-buffer)
(global-set-key [( control ?\( )] 'my-matching-paren)

;; FONTS
(if window-system 
    (progn 
	  (set-default-font "-outline-Bitstream Vera Sans Mono-normal-r-normal-normal-11-82-96-96-c-*-iso8859-1")
	  (set-background-color "#FFFCF2")
      (custom-set-faces '(show-paren-match ((((class color) (background light)) (:background "#D9FFEC")))))
	  (setq show-paren-style (quote expression))))

;; No menu-bar at terminal window
(menu-bar-mode (if window-system t nil))

;; SOME CUSTOMIZATION:

;; Map ESC-g for goto-line (like with XEmacs)
(global-set-key "\M-g" 'goto-line)
;; Use the "electric-buffer-list" instead of "buffer-list"
;; so that the cursor automatically switches to the other window
(global-set-key "\C-x\C-b" 'electric-buffer-list)
(fset `yes-or-no-p `y-or-n-p)		; y or n answers
(setq delete-auto-save-files t)		; delete ~ files


;; Set the name of the host and current path/file in title bar:
(setq frame-title-format
      (list (format "%s %%S: %%j " (system-name))
	    '(buffer-file-name "%f" (dired-directory dired-directory "%b"))))



