;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                                                                         ;;;
;;;                            felipeal's .emacs                            ;;;
;;;                            -----------------                            ;;;
;;;                                                                         ;;;
;;;                   by Felipe Leme - <felipeal@iname.com>                 ;;;
;;;                                                                         ;;;
;;; File: $Id: .emacs,v 1.12 2001/06/19 15:37:41 felipeal Exp $	            ;;;
;;; Desc: main .emacs file                                                  ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(load "~/lib/emacs/custom.elc")		;;; call the compiled settings
(load "~/lib/emacs/requires.el")	;;; call the setting that can't be compiled
(load "~/.$OSNAME/.emacs" t)		;;; call system-specific settings

;;; custom settings: these settings eventually will be moved to settings.el
(custom-set-variables
 '(jde-run-option-properties nil)
 '(jde-compile-option-command-line-args "-g -deprecation +P")
 '(tab-width 4)
 '(pc-select-meta-moves-sexps t)
 '(php-file-patterns (quote ("\\.php[34]?\\'" "\\.phtml\\'")))
 '(jde-compile-option-classpath (quote ("$JIKESPATH" "$HOME/work/CVS/src/TSPRws/src")))
 '(jde-db-source-directories (quote ("~/src/java/")))
 '(jde-run-option-vm-args (quote ("-Djava.compiler=NONE")))
 '(jde-compiler "jikes")
 '(jde-run-option-classpath (quote ("~/src/java" ".")))
 '(pc-select-selection-keys-only t)
 '(jde-run-java-vm "/usr/local/java/bin/java")
 '(pc-selection-mode t t)
 '(make-backup-files nil))
(custom-set-faces)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                                                                         ;;;
;;;                          felipeal's custom.el                           ;;;
;;;                          --------------------                           ;;;
;;;                                                                         ;;;
;;;                   by Felipe Leme - <felipeal@iname.com>                 ;;;
;;;                                                                         ;;;
;;; File: $Id: COPYRIGHT.el,v 1.5 2001/06/19 15:37:32 felipeal Exp $	    ;;;
;;; Desc: This file is made of many sub-files, each with some spefic task.  ;;;
;;;       Once startup.el is created, it is compiled to startup.elc and     ;;;
;;;       then called from .emacs. It's kind of complex, but it optimizes   ;;;
;;;       the loading time.                                                 ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; File: $Id: hilit.el,v 1.3 2001/06/19 15:30:05 felipeal Exp $	        ;;;
;;; Desc: hilit settings                                                    ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(cond (window-system
       (setq hilit-mode-enable-list  '(not text-mode)
             hilit-background-mode   'dark
             hilit-inhibit-hooks     nil
             hilit-inhibit-rebinding nil)
       
       (require 'hilit19)
       )
      )
(setq
 x-fixed-font-alist
 '("Font Menu"
   ("Misc"
    ("6x12" "-misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-*-1")
    ("6x13" "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-*-1")
    ("lucida 13"
     "-b&h-lucidatypewriter-medium-r-normal-sans-0-0-0-0-m-0-*-1")
    ("7x13" "-misc-fixed-medium-r-normal--13-120-75-75-c-70-*-1")
    ("7x14" "-misc-fixed-medium-r-normal--14-130-75-75-c-70-*-1")
    ("9x15" "-misc-fixed-medium-r-normal--15-140-*-*-c-*-*-1")
    ("")
    ("clean 8x8" "-schumacher-clean-medium-r-normal--*-80-*-*-c-*-*-1")
    ("clean 8x14" "-schumacher-clean-medium-r-normal--*-140-*-*-c-*-*-1")
    ("clean 8x10" "-schumacher-clean-medium-r-normal--*-100-*-*-c-*-*-1")
    ("clean 8x16" "-schumacher-clean-medium-r-normal--*-160-*-*-c-*-*-1")
    ("")
    ("sony 8x16" "-sony-fixed-medium-r-normal--16-120-100-100-c-80-*-1")
    ("")
    ("-- Courier --")
    ("Courier 10" "-adobe-courier-medium-r-normal--*-100-*-*-m-*-*-1")
    ("Courier 12" "-adobe-courier-medium-r-normal--*-120-*-*-m-*-*-1")
    ("Courier 14" "-adobe-courier-medium-r-normal--*-140-*-*-m-*-*-1")
    ("Courier 18" "-adobe-courier-medium-r-normal--*-180-*-*-m-*-*-1")
    ("Courier 18-b" "-adobe-courier-bold-r-normal--*-180-*-*-m-*-*-1")
    )
   )
 )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; File: $Id: keyboard.el,v 1.3 2001/06/19 15:30:05 felipeal Exp $	        ;;;
;;; Desc: keyboard settings                                                 ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(global-set-key [insertchar] 'overwrite-mode)
(global-set-key "\C-cg" 'goto-line)
(global-set-key "\C-cr" 'revert-buffer)
(substitute-key-definition
 'newline 'newline-and-indent (current-global-map))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; File: $Id: loading.el,v 1.2 2001/06/19 15:24:14 felipeal Exp $	    ;;;
;;; Desc: settings regarding loading modules                                ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path (expand-file-name "~/lib/emacs/packages/generic"))
(add-to-list 'load-path (expand-file-name "~/lib/emacs/packages/jde/lisp"))
(add-to-list 'load-path (expand-file-name "~/lib/emacs/packages/semantic"))
(add-to-list 'load-path (expand-file-name "~/lib/emacs/packages/speedbar"))
(add-to-list 'load-path (expand-file-name "~/lib/emacs/packages/elib"))
(add-to-list 'load-path (expand-file-name "~/lib/emacs/packages/pcl-cvs"))
(add-to-list 'load-path (expand-file-name "~/lib/emacs/packages/mmm-mode"))
(autoload 'sh-mode "sh-script" "sh mode" t)
(autoload 'tar-mode "tar-mode" "tar mode" t)
(autoload 'uncompress-while-visiting "uncompress" "load uncompress" t)
(autoload 'javascript-mode
     "javascript-cust"
     "javascript mode" t nil)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; File: $Id: mouse.el,v 1.3 2001/06/19 15:24:14 felipeal Exp $		    ;;;
;;; Desc: settings for a scrolling wheel mouse                              ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun up-slightly () (interactive) (scroll-up 5))
(defun down-slightly () (interactive) (scroll-down 5))
(global-set-key [mouse-4] 'down-slightly)
(global-set-key [mouse-5] 'up-slightly)

(defun up-one () (interactive) (scroll-up 1))
(defun down-one () (interactive) (scroll-down 1))
(global-set-key [S-mouse-4] 'down-one)
(global-set-key [S-mouse-5] 'up-one)


(defun up-a-lot () (interactive) (scroll-up))
(defun down-a-lot () (interactive) (scroll-down))
(global-set-key [C-mouse-4] 'down-a-lot)
(global-set-key [C-mouse-5] 'up-a-lot)

;If you want to scroll by half a page instead of only 5 lines as above

(defun scroll-up-half ()
  "Scroll up half a page."
  (interactive)
  (scroll-up (/ (window-height) 2))
)

(defun scroll-down-half ()
  "Scroll down half a page."
  (interactive)
  (scroll-down (/ (window-height) 2))
)
;(global-set-key [(mouse-5)] 'scroll-up-half)
;(global-set-key [(mouse-4)] 'scroll-down-half)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; File: $Id: settings.el,v 1.4 2001/06/19 15:30:05 felipeal Exp $	        ;;;
;;; Desc: general customization                                             ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(setq line-number-mode t)		;; show line number
(setq column-number-mode t)		;; show column number
(display-time)					;; show time
(setq transient-mark-mode t)	;; highlight the region
(setq-default fill-column 79)	;; column limit for auto-fill mode
(setq-default tab-width 4)		;; tab width in characters
(setq make-backup-files nil)	;; don't create the ~ files
(setq backup-by-copying t)		;; useful when backing up links

;; not used settings
;;(standard-display-european t)	
;;(custom-set-faces)
;;(setq font-lock-maximum-decoration t)

;; file types to buffer modes list
(setq auto-mode-alist (append '(
				("\\.pl$"    . perl-mode)
				("\\.sh$"    . sh-mode)
				("\\.cgi$"   . perl-mode)
				( "\\.Z$" . uncompress-while-visiting)
				( "\\.z$" . uncompress-while-visiting)
				( "\\.gz$" . uncompress-while-visiting)
				( "\\.tar$" . tar-mode)
				( "\\.mocha$" . java-mode)
				( "\\.jsp$" . html-mode)
				( "\\.inc$" . html-mode)
				( "\\.jad$" . java-mode)
				( "\\.js$" . javascript-mode)
				) auto-mode-alist))

;; files to be ignored on completion
(setq completion-ignored-extensions (append completion-ignored-extensions (list ".gif" ".class" ".$ja" )))

;; start emacs-server
;; check the OS: if it is Winblow, it will start gnu-serv on ~/.winblows/.emacs
(if (not (equal (getenv "OSNAME") "winblows") )
  (server-start)
  )



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; File: $Id: requires.el,v 1.3 2001/06/19 15:31:54 felipeal Exp $	        ;;;
;;; Desc:setttings that cannot be compiled                                  ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'power-macros)			;;; power-macros package
(require 'pcl-cvs)				;;; cvs mode
(require 'jde)					;;; java ide 
(require 'php-mode)				;;; php-mode
(require 'mmm-auto)				;;; multi-major-mode (useful for jsp)

;;; mmm-mode settings
(setq mmm-global-mode 'maybe)
(add-to-list 'mmm-mode-ext-classes-alist
             '(nil "\\.jsp\\'" jsp))
(add-to-list 'mmm-mode-ext-classes-alist
             '(nil "\\.inc\\'" jsp))
(set-face-background 'mmm-default-submode-face nil)
(set-face-background 'mmm-default-submode-face "navy")
(set-face-background 'mmm-default-submode-face "#454545")

;;; not used
;;(require 'mwheel)
;(require 'mmm-mode)

