;;; Customised for Emacs 19.30 - CG 31/03/2005 ;;; pour avoir la date et l'heure sur la modeline (setq display-time-24hr-format t) (setq display-time-day-and-date t) (setq display-time-interval 60) (setq display-time-mail-file t) (display-time) ;;; highlighter les recherches (setq query-replace-highlight t) (setq search-highlight t) ;;; y a aucune erreur, donc pas besoin de debugger (setq debug-on-error nil) (if (string-lessp emacs-version "19") (set-input-mode t t) (standard-display-european 1) (transient-mark-mode 1) (autoload 'accents-mode "accents.el" "met les accents" t nil) (load-library "paren") (global-set-key "%" 'match-paren) (defun match-paren (arg) "Go to the matching parenthesis if on parenthesis otherwise insert %." (interactive "p") (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) ((looking-at "\\s\)") (forward-char 1) (backward-list 1)) ((looking-at "\\s\{") (forward-char 1) (backward-list 1)) ((looking-at "\\s\}") (forward-char 1) (backward-list 1)) (t (self-insert-command (or arg 1)))))) ;;; general background color (set-background-color "Papayawhip") ;;; default font color ;;; pour que les defauts se propagent a toutes les frames (setq default-frame-alist '( (background-color . "Papayawhip"))) (set-face-foreground 'default "black") (set-face-foreground 'bold "black") (set-face-foreground 'bold-italic "black") (set-face-foreground 'highlight "firebrick") ;;; syntax highlighting by the font-lock package ;;; mieux que par hilit parce que c'est en temps reel ;;; decoration en temps reel (add-hook 'findProgramming-file-hooks 'turn-on-font-lock) ;;; le plus de decoration possible (setq font-lock-maximum-decoration t) ;;; reconnait le type de l'ecran et du background (require 'font-lock) (custom-set-variables '(Info-title-face-alist (quote ((42 bold underline) (61 bold-italic underline) (45 italic underline)))) '(show-paren-mode t nil (paren)) '(special-display-frame-alist (quote ((height . 14) (width . 90) (unsplittable . t)))) '(scroll-bar-mode (quote right))) (custom-set-faces '(font-lock-comment-face ((((class color) (background light)) (:foreground "springgreen4")))) '(font-lock-reference-face ((((class color) (background light)) (:foreground "firebrick")))) '(font-lock-string-face ((((class color) (background light)) (:foreground "DarkGoldenrod")))) '(info-xref ((t (:bold t :background "green")))) '(calendar-today-face ((t (:background "green3")))) '(font-lock-keyword-face ((((class color) (background light)) (:foreground "RoyalBlue")))) '(info-menu-5 ((t (:underline t :foreground "red3")))) '(font-lock-type-face ((((class color) (background light)) (:foreground "Purple")))) '(info-node ((t (:bold t :italic t :underline t :foreground "Blue")))) '(show-paren-match-face ((t (:background "red")))) '(font-lock-variable-name-face ((((class color) (background light)) (:foreground "deepskyblue2")))) '(font-lock-function-name-face ((((class color) (background light)) (:foreground "red3")))) '(bold ((t (:bold t :underline t :foreground "red"))))) (setq global-font-lock-mode t) ;;; Le mode par defaut est le mode fundamental (setq default-major-mode 'text-mode) (setq text-mode-hook 'turn-on-auto-fill) (setq-default fill-column 75) (setq case-fold-search t) (setq line-number-mode t) (setq accents-mode t) (display-time) ; ;;;; relative to tuareg (require 'tuareg) (autoload 'camldebug "camldebug" "Run the Caml debugger" t) (add-hook 'tuareg-mode-hook '(lambda () (setq tuareg-font-lock-documentation '("goldenrod" "goldenrod" t t t t)) (setq tuareg-font-lock-comment '("springgreen4" "springgreen4" t t t t)) (setq tuareg-font-lock-string '("DarkGoldenrod" "DarkGoldenrod" t t t t)) (setq tuareg-font-lock-module '("Purple" "lightblue" t t t t)) (setq tuareg-font-lock-governing '("Purple" "orange" t t t t)) (setq tuareg-font-lock-exception '("Purple" "red" t t t t)) (setq tuareg-font-lock-preprocessor '("RoyalBlue" "yellow" t t t t)) (setq tuareg-font-lock-keyword '("RoyalBlue" "skyblue" t t t t)) (setq tuareg-font-lock-function '("deepskyblue2" "cyan" t t t t)) (setq tuareg-font-lock-operator '("black" "lightgray" t t t t)) (setq tuareg-font-lock-reference '("firebrick" "plum1" t t t t)) (setq tuareg-font-lock-function-name '("red3" "cyan" t t t t)) (setq tuareg-font-lock-exception-name '("red" "red" t t t t)))) (setq ispell-dictionary-alist '((nil "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil) ("english" "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil) ("francais" "[A-Za-z]" "[^A-Za-z]" "[`'^-]" t nil nil) ("francais8" "[A-Za-zÀÂÆÇÈÉÊËÎÏÔÙÛÜàâæçèéêëîïôùûü]" "[^A-Za-zÀÂÄÆÇÈÉÊËÎÏÔÖÙÛÜàâäæçèéêëîïôöùûü]" "[---']" t ("-dfrancais") "~list"))) ;;; Determine mode according to filename (defvar auto-mode-alist nil "\ Alist of filename patterns vs corresponding major mode functions. Each element looks like (REGEXP . FUNCTION). Visiting a file whose name matches REGEXP causes FUNCTION to be called.") (setq auto-mode-alist (mapcar 'purecopy '(("\\.text$" . text-mode) ("\\.c$" . c-mode) ("\\.h$" . c-mode) ("\\.cc$" . c++-mode) ("\\.hh$" . c++-mode) ("\\.tex$" . LaTeX-mode) ("\\.el$" . emacs-lisp-mode) ("\\.scm$" . scheme-mode) ("\\.l$" . lisp-mode) ("\\.lisp$" . lisp-mode) ("\\.f$" . fortran-mode) ("\\.mss$" . scribe-mode) ("\\.ml$" . tuareg-mode) ("\\.mli$" . tuareg-mode) ("\\.pro$" . prolog-mode) ("\\.pl$" . perl-mode) ("\\.perl$" . perl-mode) ("\\.tcl$" . tcl-mode) ("\\.tk$" . tcl-mode) ("\\.y$" . bison-mode) ("\\.p$" . pas-mode) ("\\.pas$" . pas-mode) ("\\.tar$" . tar-mode) ;;; Less common extensions come here ;;; so more common ones above are found faster. ("\\.TeX$" . TeX-mode) ("\\.sty$" . LaTeX-mode) ("\\.html$" . html-mode) ("\\.bbl$" . LaTeX-mode) ("\\.bib$" . bibtex-mode) ("\\.article$" . text-mode) ("\\.letter$" . text-mode) ("\\.texinfo$" . texinfo-mode) ("\\.lsp$" . lisp-mode) ("\\.prolog$" . prolog-mode) ;; Mailer puts message to be edited in /tmp/Re.... or Message ("^/tmp/Re" . text-mode) ;; some news reader is reported to use this ("^/tmp/fol/" . text-mode) ("/Message[0-9]*$" . text-mode) ("\\.cc$" . c-mode) ("\\.scm.[0-9]*$" . scheme-mode) ;; in genelex project ("\\.H$" . c++-mode) ("\\.C$" . c++-mode) ;; .emacs following a directory delimiter ;; in either Unix or VMS syntax. ("[]>:/]\\..*emacs" . emacs-lisp-mode) ("RMAIL" . rmail-mode) ("[Mm]akefile" . makefile-mode) ("\\.ml$" . tuareg-mode)))) (put 'eval-expression 'disabled nil) ;;; affectation des touches fonctions (global-set-key [f1] 'comment-region) ; F1 (global-set-key [f2] 'metamail-interpret-body) ; F2 (global-set-key [f3] 'rmail-input); (global-set-key [f4] 'font-lock-fontify-buffer) ; F4 (global-set-key [f5] 'fill-region) ; F5 (global-set-key [f6] 'calendar) ; F6 (global-set-key [f7] 'ispell-region) ; F7 (global-set-key [f8] 'ispell-buffer) ; F8 (global-set-key [f9] 'goto-line) ; F9 (global-set-key [f10] 'rmail) ; F10 (global-set-key [f35] 'compile) ; F11 (global-set-key [f11] 'compile) ; F11 (global-set-key [f12] 'rmail) ; F12 ;;; redef de touches sympas (global-set-key [delete] 'delete-char) (global-set-key [home] 'beginning-of-line) (global-set-key [end] 'end-of-line) (global-set-key [pageup] 'scroll-down) (global-set-key [pagedown] 'scroll-up) (global-set-key [C-backspace] 'undo) (global-set-key "\eg" 'goto-line) (global-set-key "\C-m" 'newline-and-indent) (global-set-key "\C-j" 'newline) (global-set-key "\er" 'replace-string) ;;; Parameters for indented-c++ (setq c-indent-level 3) (setq c-continued-statement-offset 3) ;;; Automatic creation of a new frame for this buffer types (setq special-display-buffer-names '("*compilation*" "*grep*")) (setq case-replace nil) ;;; correction for english-dired to match french date (set-variable 'dired-move-to-filename-regexp "\\(Jan\\|Fev\\|Mar\\|Avr\\|Mai\\|Jun\\|Jul\\|Ao.\\|Sep\\|Oct\\|Nov\\|Dec\\)[ ]+[0-9]+ [ 0-9][0-9][:0-9][0-9][ 0-9] ") (put 'upcase-region 'disabled nil) (setq tuareg-interactive-program "c:/Infos/li260-2005fev/g7/bin/mytop.exe") (defun tuareg-run-caml () "Run a Caml toplevel process. I/O via buffer `*caml-toplevel*'." (interactive) (tuareg-run-process-if-needed "c:/Infos/li260-2005fev/g7/bin/mytop.exe") (when tuareg-display-buffer-on-eval (display-buffer tuareg-interactive-buffer-name))) (setq tuareg-manual-url "file:///c:/Infos/li260-2005fev/g7/htmlman/index.html") (defun tuareg-explorer-manual (url) "*Browse Caml reference manual." (start-process-shell-command "iexplore.exe" nil (concat "iexplore.exe -remote 'openURL (" url ", newwindow)' || iexplore.exe " url))) (setq tuareg-browser 'tuareg-explorer-manual) (setq tuareg-library-path "c:/Ocaml/lib")