;;
;; Configuring some major mode fortran-mode octave-mode (user input)
;;
(add-to-list 'load-path (expand-file-name "~/elisp/"))
(add-to-list 'load-path (expand-file-name "/usr/local/share/emacs/site-lisp/"))
;; 
;; Loading forward search in kdvi
;;
(require 'dsvn)
(require 'kdvi-search)
(add-hook 'LaTeX-mode-hook (lambda () (local-set-key "\C-x\C-j" 'kdvi-jump-to-line)))
(add-hook 'tex-mode-hook (lambda () (local-set-key "\C-x\C-j" 'kdvi-jump-to-line)))
(require 'html-helper-mode)
(autoload 'smb-mode "smb-mode" "SMB Major Mode" t)
;; 
;; Loading imaxima mode
;;
(require 'maxima)
(autoload 'maxima "maxima" "maxima Major mode" t)
(require 'maxima-font-lock)
(autoload 'maxima-font-lock  "maxima-font-lock" "maxima font-lock mode" t)

(autoload  'maxima "maxima" "Maxima interaction" t)
;;(require 'imaxima)
;;(autoload 'imaxima "imaxima" "Image support for Maxima." t)
;;
;;(setq-default inhibit-eol-conversion nil)
(global-font-lock-mode t)
(column-number-mode    t)
(show-paren-mode   t)
(setq display-time-24hr-format 't)
(display-time-mode t)
(setq default-major-mode 'text-mode)
(defun RET-behaves-as-LFD ()
  (let ((x (key-binding "\C-j")))
       (local-set-key "\C-m" x)))
(add-hook 'fortran-mode-hook 
	  '( lambda () 
	     (fortran-auto-fill-mode 1) ) )
(add-hook 'octave-mode-hook '(lambda () (modify-syntax-entry ?\% "<")))
;;(add-hook 'fortran-mode-hook 'RET-behaves-as-LFD)
(defalias 'perl-mode 'cperl-mode)
(setq cperl-highlight-variables-indiscriminately t)
;; Modifying coding system
;;(modify-coding-system-alist 'file "\\.for\\'" 'undecided-dos)
;;
;; Modifying alist
;;
(add-to-list 'auto-mode-alist '("\\.m$" . octave-mode))
(add-to-list 'auto-mode-alist '("\\.fi$" . fortran-mode))
(add-to-list 'auto-mode-alist '("\\.comm$" . python-mode))
(add-to-list 'auto-mode-alist '("\\dbg$" . makefile-mode))
(add-to-list 'auto-mode-alist '(".gnu-emacs-custom$" . lisp-mode))
(add-to-list 'auto-mode-alist '(".geo$" . c++-mode))
;; Configuring html-helper-mode
(setq html-helper-do-write-file-hooks t)
(setq html-helper-build-new-buffer t)
(setq auto-mode-alist 
      (cons '("\\.php$" . html-helper-mode) auto-mode-alist))
(setq auto-mode-alist 
      (cons '("\\.phps$" . html-helper-mode) auto-mode-alist))
(setq auto-mode-alist 
      (cons '("\\.inc$" . html-helper-mode) auto-mode-alist))
(setq auto-mode-alist 
      (cons '("\\.html$" . html-helper-mode) auto-mode-alist))
;; Configuring Octave Mode
(add-hook 'octave-mode-hook
          '( lambda () 
	     (abbrev-mode 1)
	     (auto-fill-mode 1)
	     (font-lock-mode 1)))
(add-hook 'octave-mode-hook 'RET-behaves-as-LFD)
(add-hook 'inferior-octave-mode-hook
 	  '(lambda ()
 	     (define-key inferior-octave-mode-map [up]
 	       'comint-previous-input)
 	     (define-key inferior-octave-mode-map [down]
 	       'comint-next-input) ) )
;; Configuring GDB Mode
(add-hook 'gud-mode-hook
 	  '(lambda ()
	     (turn-on-font-lock)
 	     (local-set-key [up]
 	       'comint-previous-input)
 	     (local-set-key [down]
 	       'comint-next-input) ) )
;; Configuring smb-mode
;; (setq smb-comment-str "#")
 (setq smb-use-outline-mode t)
;;
;;
(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.
 '(abbrev-mode t t)
 '(comment-line-start "*")
 '(delete-selection-mode nil nil (delsel))
 '(fill-column 71)
 '(fortran-blink-matching-if t)
 '(fortran-comment-line-start "*")
 '(fortran-continuation-string "+")
 '(gdb-many-windows t)
 '(gdb-same-frame nil)
 '(grep-command "grep -d recurse -nH -e " nil nil "Added -d recurse for recursive search on directory")
 '(grep-template "grep <C> -d recurse -nH -e <R> <F>")
 '(inhibit-startup-screen t)
 '(jde-compiler (quote ("javac server")))
 '(mark-even-if-inactive t)
 '(octave-auto-indent t)
 '(octave-auto-newline t)
 '(octave-continuation-offset 4)
 '(octave-continuation-string "...")
 '(scroll-bar-mode (quote right))
 '(speedbar-directory-unshown-regexp "^\\(CVS\\|cvs\\|RCS\\|SCCS\\|\\..*\\)\\'")
 '(speedbar-supported-extension-expressions (quote (".[ch]\\(\\+\\+\\|pp\\|c\\|h\\|xx\\)?" ".tex\\(i\\(nfo\\)?\\)?" ".el" ".emacs" ".l" ".lsp" ".p" ".java" ".f\\(90\\|77\\|or\\|i\\)?" ".ada" ".p[lm]" ".tcl" ".m" ".scm" ".pm" ".py" ".g" ".s?html" "[Mm]ake\\(\\file\\|_dbg\\|file.in\\)?" ".ph\\(p\\|p3\\|ps\\)?" ".inc" ".in" ".y" ".mc" ".max" ".mac" ".css" ".perf" ".comm" ".mail" ".para" ".resu" ".geo" ".msh")))
 '(transient-mark-mode 1)
 '(vc-default-back-end nil)
 '(w3-default-homepage "")
 '(w3-do-incremental-display nil)
 '(w3-honor-stylesheets t)
 '(w3-user-colors-take-precedence t)
 '(w3-user-fonts-take-precedence nil))
(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.
 )
;; Load SpeedBar
(add-to-list 'load-path "~/.emacs.d/jdee-2.4.1/lisp")
(load "jde")
(speedbar)
