(load "C:/ESS/ess-5.3.6/lisp/ess-site") ;;(setq inferior-R-program-name "C:/R251/bin/Rterm.exe") (setq inferior-R-program-name "C:/R270/bin/Rterm.exe") (custom-set-variables ;; custom-set-variables was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. '(transient-mark-mode t) '(column-number-mode t) '(global-font-lock-mode t) '(show-paren-mode 1) ;; from https://stat.ethz.ch/pipermail/ess-help/2005-September/002902.html '(c-basic-offset 4) '(c-default-style "bsd") ) (custom-set-faces ;; custom-set-faces was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Set up colors ; (defun good-colors () (progn (set-background-color "DimGray") (set-foreground-color "LightGray") (set-cursor-color "DarkSlateBlue") (set-border-color "DimGray") (set-mouse-color "DarkSlateBlue") (set-face-background 'default "DimGray") (set-face-background 'region "DarkSlateGray") (set-face-background 'highlight "DarkSlateBlue") (set-face-background 'modeline "DarkSlateBlue") ;;; CornflowerBlue") (set-face-foreground 'default "LightGray") (set-face-foreground 'region "Ivory") (set-face-foreground 'highlight "LightGray") ;;; DimGray") (set-face-foreground 'modeline "LightGray") )) (good-colors) ;; calls the previously-defined function ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; from https://stat.ethz.ch/pipermail/ess-help/2005-September/002902.html ;; (add-hook 'ess-mode-hook ;; '(lambda() ;; (ess-set-style 'C++ 'quiet) ;; (add-hook 'local-write-file-hooks ;; '(lambda() ;; (delete-trailing-whitespace))))) ;;for Matlab., from: ;;http://www.cs.ait.ac.th/~mdailey/matlab/ ;; copy and paste from matlab.el, do not copy what's on the webpage (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) ;;User Level customizations (You need not use them all): (setq matlab-indent-function t) ; if you want function bodies indented (setq matlab-verify-on-save-flag nil) ; turn off auto-verify on save (defun my-matlab-mode-hook () (setq fill-column 76)) ; where auto-fill should wrap (add-hook 'matlab-mode-hook 'my-matlab-mode-hook) (defun my-matlab-shell-mode-hook () '()) (add-hook 'matlab-shell-mode-hook 'my-matlab-shell-mode-hook) ;; ESS (add-hook 'ess-mode-hook (lambda () (ess-set-style 'BSD) (setq tab-width 8) (setq indent-tabs-mode t))) ;; use ISPELL on PC 3.1.20...see bookmarked webpage ;; http://www.ssc.wisc.edu/~dvanness/ispell.htm (autoload 'ispell-word "ispell" "Check the spelling of word in buffer." t) (global-set-key "\e$" 'ispell-word) (autoload 'ispell-region "ispell" "Check the spelling of region." t) (autoload 'ispell-buffer "ispell" "Check the spelling of buffer." t) (autoload 'ispell-complete-word "ispell" "Look up current word in dictionary and try to complete it." t) (autoload 'ispell-change-dictionary "ispell" "Change ispell dictionary." t) (autoload 'ispell-message "ispell" "Check spelling of mail message or news post.") ;still necessary (setenv "TEMP" "c:/windows/temp") (setenv "TMP" "c:/windows/temp") ; helpful (setq text-mode-hook '(lambda () (local-set-key "\M-\t" 'ispell-complete-word))) (setq tex-mode-hook '(lambda () (local-set-key "\M-\t" 'ispell-complete-word))) (setq latex-mode-hook '(lambda () (local-set-key "\M-\t" 'ispell-complete-word))) ; enable tex parser, also very helpful (setq ispell-enable-tex-parser t) ;;from caffo...but I'm using Ispell b/c it had easier win implementation ;; auto spell correction ;;(setq-default ispell-program-name "aspell") ;;(add-hook 'LaTeX-mode-hook 'flyspell-mode) ;; from http://www.linuxquestions.org/questions/linux-software-2/emacs-changing-default-font-size-and-font-type-489000/ (set-default-font "-adobe-courier-medium-r-normal--18-180-75-75-m-110-iso8859-1") ;; (set-default-font "-Adobe-Courier-Bold-R-Normal--34-*-100-100-M-*-ISO8859-1") ;;begin from http://ola-bini.blogspot.com/2006/11/emacs-diversion-font-sizes.html (defun inc-font-size () (interactive) (let* ((current-font (cdr (assoc 'font (frame-parameters)))) (splitted (split-string current-font "-")) (new-size (+ (string-to-number (nth 7 splitted)) 1)) (new-font (concat (nth 0 splitted) "-" (nth 1 splitted) "-" (nth 2 splitted) "-" (nth 3 splitted) "-" (nth 4 splitted) "-" (nth 5 splitted) "-" (nth 6 splitted) "-" (number-to-string new-size) "-*-" (nth 9 splitted) "-" (nth 10 splitted) "-" (nth 11 splitted) "-*-" (nth 13 splitted)))) (if (> (length splitted) 14) (dotimes (n (- (length splitted) 14)) (setq new-font (concat new-font "-" (nth (+ n 14) splitted))))) (set-default-font new-font t) (set-frame-font new-font t))) (defun dec-font-size () (interactive) (let* ((current-font (cdr (assoc 'font (frame-parameters)))) (splitted (split-string current-font "-")) (new-size (- (string-to-number (nth 7 splitted)) 1)) (new-font (concat (nth 0 splitted) "-" (nth 1 splitted) "-" (nth 2 splitted) "-" (nth 3 splitted) "-" (nth 4 splitted) "-" (nth 5 splitted) "-" (nth 6 splitted) "-" (number-to-string new-size) "-*-" (nth 9 splitted) "-" (nth 10 splitted) "-" (nth 11 splitted) "-*-" (nth 13 splitted)))) (if (> (length splitted) 14) (dotimes (n (- (length splitted) 14)) (setq new-font (concat new-font "-" (nth (+ n 14) splitted))))) (set-default-font new-font t) (set-frame-font new-font t))) (defvar *current-font-index* 0) (defconst *font-ring* '( "-urw-nimbus mono l-regular-r-normal--15-*-88-88-p-*-iso8859-1" "-urw-nimbus mono l-regular-r-normal--17-*-88-88-p-*-iso8859-1" "-Adobe-Courier-Medium-R-Normal--14-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Medium-R-Normal--16-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Medium-R-Normal--18-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Medium-R-Normal--20-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Medium-R-Normal--22-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Medium-R-Normal--24-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Medium-R-Normal--26-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Medium-R-Normal--28-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Medium-R-Normal--30-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Medium-R-Normal--32-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Medium-R-Normal--34-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Bold-R-Normal--14-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Bold-R-Normal--16-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Bold-R-Normal--18-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Bold-R-Normal--20-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Bold-R-Normal--22-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Bold-R-Normal--24-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Bold-R-Normal--26-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Bold-R-Normal--28-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Bold-R-Normal--30-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Bold-R-Normal--32-*-100-100-M-*-ISO8859-1" "-Adobe-Courier-Bold-R-Normal--34-*-100-100-M-*-ISO8859-1" "-Misc-Fixed-Medium-R-SemiCondensed--10-*-75-75-C-*-ISO8859-1" "-Misc-Fixed-Medium-R-SemiCondensed--12-*-75-75-C-*-ISO8859-1" "-Misc-Fixed-Medium-R-SemiCondensed--13-*-75-75-C-*-ISO8859-1" "-Misc-Fixed-Medium-R-Normal--13-*-75-75-C-*-ISO8859-1" "-Misc-Fixed-Medium-R-Normal--14-*-75-75-C-*-ISO8859-1" "-Misc-Fixed-Medium-R-Normal--15-*-75-75-C-*-ISO8859-1" "-Misc-Fixed-Medium-R-Normal--16-*-75-75-C-*-ISO8859-1" "-Misc-Fixed-Medium-R-Normal--17-*-75-75-C-*-ISO8859-1" "-Misc-Fixed-Medium-R-Normal--18-*-75-75-C-*-ISO8859-1" "-Misc-Fixed-Medium-R-Normal--19-*-75-75-C-*-ISO8859-1" "-Misc-Fixed-Medium-R-Normal--20-*-75-75-C-*-ISO8859-1" "-Schumacher-Clean-Medium-R-Normal--12-*-75-75-C-*-ISO8859-1" "-Schumacher-Clean-Medium-R-Normal--13-*-75-75-C-*-ISO8859-1" "-Schumacher-Clean-Medium-R-Normal--14-*-75-75-C-*-ISO8859-1" "-Schumacher-Clean-Medium-R-Normal--15-*-75-75-C-*-ISO8859-1" "-Schumacher-Clean-Medium-R-Normal--16-*-75-75-C-*-ISO8859-1" "-Schumacher-Clean-Medium-R-Normal--17-*-75-75-C-*-ISO8859-1" "-Schumacher-Clean-Medium-R-Normal--18-*-75-75-C-*-ISO8859-1" "-Sony-Fixed-Medium-R-Normal--14-*-100-100-C-*-ISO8859-1" "-Sony-Fixed-Medium-R-Normal--16-*-100-100-C-*-ISO8859-1" "-Sony-Fixed-Medium-R-Normal--18-*-100-100-C-*-ISO8859-1" "-Sony-Fixed-Medium-R-Normal--20-*-100-100-C-*-ISO8859-1" "-B&H-LucidaTypewriter-Medium-R-Normal-Sans-14-*-100-100-M-*-ISO8859-1" "-B&H-LucidaTypewriter-Medium-R-Normal-Sans-16-*-100-100-M-*-ISO8859-1" "-B&H-LucidaTypewriter-Medium-R-Normal-Sans-18-*-100-100-M-*-ISO8859-1" "-B&H-LucidaTypewriter-Bold-R-Normal-Sans-20-*-100-100-M-*-ISO8859-1" "-B&H-LucidaTypewriter-Bold-R-Normal-Sans-24-*-100-100-M-*-ISO8859-1" "-B&H-LucidaTypewriter-Bold-R-Normal-Sans-30-*-100-100-M-*-ISO8859-1" "-B&H-LucidaTypewriter-Bold-R-Normal-Sans-34-*-100-100-M-*-ISO8859-1" )) (defun font-next () (interactive) (let ((len (length *font-ring*)) (next-index (+ *current-font-index* 1))) (if (= next-index len) (setq next-index 0)) (setq *current-font-index* next-index) (message (concat "setting " (nth *current-font-index* *font-ring*))) (set-default-font (nth *current-font-index* *font-ring*) t) (set-frame-font (nth *current-font-index* *font-ring*) t))) (defun font-prev () (interactive) (let ((len (length *font-ring*)) (next-index (- *current-font-index* 1))) (if (= next-index 0) (setq next-index (- len 1))) (setq *current-font-index* next-index) (set-default-font (nth *current-font-index* *font-ring*) t) (set-frame-font (nth *current-font-index* *font-ring*) t))) (defun font-current () (interactive) (cdr (assoc 'font (frame-parameters)))) (defun font-set (ix) (setq *current-font-index* ix) (set-default-font (nth *current-font-index* *font-ring*) t) (set-frame-font (nth *current-font-index* *font-ring*) t)) (provide 'fontize) ;;I also bound these methods to keys, like this: (global-set-key [?\C-+] 'inc-font-size) (global-set-key [?\C--] 'dec-font-size) (global-set-key [?\M-+] 'font-next) (global-set-key [?\M--] 'font-prev) ;;end from http://ola-bini.blogspot.com/2006/11/emacs-diversion-font-sizes.html