-;;****************************************************************************
-;;FILE:               lse-mode.el
-;;LANGUAGE:           emacs lisp
-;;SYSTEM:             POSIX
-;;USER-INTERFACE:     NONE
-;;DESCRIPTION
-;;    
-;;    L.S.E. editing support package
-;;    
-;;    A major mode for editing L.S.E. code.  It provides convenient
-;;    abbrevs for L.S.E. keywords, knows about the standard layout
-;;    rules, and supports a native compile command.
-;;
-;;    http://www.emacswiki.org/cgi-bin/wiki.pl?SampleMode
-;;
-;;AUTHORS
-;;    <PJB> Pascal Bourguignon <pjb@informatimago.com>
-;;          Michael Schmidt <michael@pbinfo.UUCP>
-;;          Tom Perrine <Perrin@LOGICON.ARPA>
-;;          Mick Jordan
-;;          Peter Robinson
-;;MODIFICATIONS
-;;    2003-01-31 <PJB> Created, from the modula-2 mode.
-;;    2005-08-21 <PJB> Added header & license.
-;;BUGS
-;;LEGAL
-;;    GPL
-;;    
-;;    Copyright Pascal Bourguignon 2005 - 2005
-;;    
-;;    This program is free software; you can redistribute it and/or
-;;    modify it under the terms of the GNU General Public License
-;;    as published by the Free Software Foundation; either version
-;;    2 of the License, or (at your option) any later version.
-;;    
-;;    This program is distributed in the hope that it will be
-;;    useful, but WITHOUT ANY WARRANTY; without even the implied
-;;    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-;;    PURPOSE.  See the GNU General Public License for more details.
-;;    
-;;    You should have received a copy of the GNU General Public
-;;    License along with this program; if not, write to the Free
-;;    Software Foundation, Inc., 59 Temple Place, Suite 330,
-;;    Boston, MA 02111-1307 USA
-;;****************************************************************************
+;;;; -*- mode:emacs-lisp;coding:utf-8 -*-
+;;;;****************************************************************************
+;;;;FILE:               lse-mode.el
+;;;;LANGUAGE:           emacs lisp
+;;;;SYSTEM:             POSIX
+;;;;USER-INTERFACE:     NONE
+;;;;DESCRIPTION
+;;;;    
+;;;;    L.S.E. editing support package
+;;;;    
+;;;;    A major mode for editing L.S.E. code.  It provides convenient
+;;;;    abbrevs for L.S.E. keywords, knows about the standard layout
+;;;;    rules, and supports a native compile command.
+;;;;
+;;;;    http://www.emacswiki.org/cgi-bin/wiki.pl?SampleMode
+;;;;
+;;;;AUTHORS
+;;;;    <PJB> Pascal Bourguignon <pjb@informatimago.com>
+;;;;          Michael Schmidt <michael@pbinfo.UUCP>
+;;;;          Tom Perrine <Perrin@LOGICON.ARPA>
+;;;;          Mick Jordan
+;;;;          Peter Robinson
+;;;;MODIFICATIONS
+;;;;    2003-01-31 <PJB> Created, from the modula-2 mode.
+;;;;    2005-08-21 <PJB> Added header & license.
+;;;;BUGS
+;;;;LEGAL
+;;;;    GPL
+;;;;    
+;;;;    Copyright Pascal Bourguignon 2005 - 2005
+;;;;    
+;;;;    This program is free software; you can redistribute it and/or
+;;;;    modify it under the terms of the GNU General Public License
+;;;;    as published by the Free Software Foundation; either version
+;;;;    2 of the License, or (at your option) any later version.
+;;;;    
+;;;;    This program is distributed in the hope that it will be
+;;;;    useful, but WITHOUT ANY WARRANTY; without even the implied
+;;;;    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+;;;;    PURPOSE.  See the GNU General Public License for more details.
+;;;;    
+;;;;    You should have received a copy of the GNU General Public
+;;;;    License along with this program; if not, write to the Free
+;;;;    Software Foundation, Inc., 59 Temple Place, Suite 330,
+;;;;    Boston, MA 02111-1307 USA
+;;;;****************************************************************************
 
 (require 'pjb-strings)
 (require 'cl)
-(provide 'lse-mode)
-;;(provide 'lse)
 
 
 (setq auto-mode-alist (append '(("\\.\\(lse\\|LSE\\)\\'" . lse-mode))


;;(define-key  lse-mode-map "_"  'self-insert-command)

(defconst LEFTWARD_ARROW 342896)

(setq lse-default-font-lock
      ;;"Font-lock for L.S.E. mode.")
      (append 
       '(
         ;; comments:
         ("\\(^[0-9]+\\|; *\\)\\(\\*.*\\)"
          (2 font-lock-comment-face))
         ;; strings
         ("\\('[^'\n]*'\\)"
          (1 font-lock-string-face))
         )
       (eval-when-compile
         (let ((lse-keywords
                '("AFFICHER" "ALLER" "ALORS" "CHAINE" "CHARGER" "DEBUT"
                  "EN" "ET" "EXECUTER" "FAIRE" "FIN" "GARER"
                  "JUSQUA" "LIBERER" "LIRE" "LOCAL" "NON" "OU" "PAS"
                  "PAUSE" "POUR" "PROCEDURE" "QUE" "RESULTAT" "RETOUR"  
                  "SI" "SINON" "SUPPRIMER" "TABLEAU" "TANT" "TERMINER" ))
               (lse-builtins
                '("ENT" "RAC" "ABS" "EXP" "LGN" "SIN" "COS" "ATG" "ALE"
                  "TEM" "ATT" "DIS" "ETL" "OUL" "OUX" "CCA" "CNB" "CNB"
                  "DAT" "EQC" "EQN" "EQN" "GRL" "GRL" "LGR" "POS" "PTR"
                  "PTR" "SCH" "SCH" "SKP" "SKP" ))
               (lse-types
                '("CHAINE" "TABLEAU" ))
               )
           (list
            ;;
            ;; Keywords except those fontified elsewhere.
            (concat "\\<\\(" (regexp-opt lse-keywords) "\\)\\>")
            ;;
            ;; Builtins.
            (cons (concat "\\<\\(" (regexp-opt lse-builtins) "\\)\\>")
                  'font-lock-builtin-face)
            ;;
            ;; Type names.
            (cons (concat "\\<\\(" (regexp-opt lse-types) "\\)\\>")
                  'font-lock-type-face)
            )))   
       '(
         ;; fonction
         ("\\(&[A-Z][A-Z0-9]\\{0,4\\}\\)\\>"

         ("\\([0-9]+E[-+]?[0-9]+\\)"             (1 font-lock-constant-face))
         ("\\([0-9]+\\.[0-9]*\\)"                (1 font-lock-constant-face))
         ("\\([0-9]+\\)"                         (1 font-lock-constant-face))
         ;; line numbers:
         ("^\\([0-9]+\\)"
          (1 font-lock-type-face)))))


(setq lse-font-lock lse-default-font-lock)

