;; Are we running XEmacs or Emacs? (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)) ;; 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) ;; Load Emacs speaks statistics (load "C:/ess-5.3.1/lisp/ess-site") ;; C code (setq c-basic-offset 4) (setq c-default-style "bsd") ;; ESS (add-hook 'ess-mode-hook (lambda () (ess-set-style 'C++) (add-hook 'local-write-file-hooks (lambda () (nuke-trailing-whitespace))))) ;; Sweave stuff (defun Rnw-mode () (require 'ess-noweb) (noweb-mode) (if (fboundp 'R-mode) (setq noweb-default-code-mode 'R-mode))) (add-to-list 'auto-mode-alist '("\\.Rnw\\'" . Rnw-mode)) (add-to-list 'auto-mode-alist '("\\.Snw\\'" . Rnw-mode)) (setq reftex-file-extensions '(("Snw" "Rnw" "nw" "tex" ".tex" ".ltx") ("bib" ".bib"))) (setq TeX-file-extensions '("Snw" "Rnw" "nw" "tex" "sty" "cls" "ltx" "texi" "texinfo"))