;; Jim Susinno 2004 - .emacs file for trunks running Win2k ;; GNU Emacs 21.2.1 (i386-msvc-nt5.0.2195) of 2002-03-19 on buffy ;; current as of October 13, 2004 ;; ;; originally modded from Red Hat Linux default .emacs initialization file ;; modded by jimbo for c, c++, matlab modes ;; tab indentation please, and mousewheel ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Are we running XEmacs or Emacs? (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)) ;; Set up the keyboard so the delete key on both the regular keyboard ;; and the keypad delete the character under the cursor and to the right ;; under X, instead of the default, backspace behavior. (global-set-key [delete] 'delete-char) (global-set-key [kp-delete] 'delete-char) ;; Turn on font-lock mode for Emacs (cond ((not running-xemacs) (global-font-lock-mode t) )) ;; Always end a file with a newline (setq require-final-newline t) ;; Stop at the end of the file, not just add lines (setq next-line-add-newlines nil) ;; Enable wheelmouse support by default (require 'mwheel) ;; old c mode settings ;(add-hook 'c-mode-hook (function (lambda () ; (c-set-style "k&r") ; (setq c-basic-offset 8) ; (setq c++-basic-offset 4) ; (setq indent-tabs-mode nil)))) ;; thank you Dan Potter/kos (defun linux-c-mode () "C mode with adjusted defaults for use with the Linux kernel." (interactive) (c-mode) (c-set-style "K&R") (setq c-basic-offset 8) (setq c++-basic-offset 8)) ;; thank you Dan Potter/kos ;; jimbo mod for c++ (defun linux-c++-mode () "C++ mode with adjusted defaults." (interactive) (c++-mode) (setq c-basic-offset 8) (setq c++-basic-offset 8)) (defconst c++-indent-level 8 "*Indentation of C statements with respect to containing block.") ;; Load matlab-mode ;(require 'matlab) ;;ftp://ftp.mathworks.com/pub/contrib/emacs_add_ons/matlab.el (autoload 'matlab-mode "matlab" "Enter Matlab mode." t) (setq auto-mode-alist (cons '("\\.m\\'" . matlab-mode) auto-mode-alist)) (autoload 'matlab-shell "matlab" "Interactive Matlab mode." t) ;; thank you http://www.dotemacs.de/dotfiles/JavierOviedo.emacs.html ;;; ;(defun my-matlab-mode () ; "My own matlab-mode stuff" ; (local-set-key (kbd "TAB") 'indent-or-expand) ; (setq matlab-indent-function t) ; (setq matlab-verify-on-save-flag nil) ; (setq fill-column 70) ; (local-set-key "\C-cc" 'matlab-comment-region) ; (local-set-key "\C-cq" 'matlab-uncomment-region)) ;;; ;(add-hook 'matlab-mode-hook 'my-matlab-mode) ;;;