<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>emacs/caml-font-old.el</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -63,6 +63,14 @@ For other bindings, see C-h b.
 
 Changes log:
 -----------
+Version 3.10.1:
+---------------
+* use caml-font.el from Olivier Andrieu
+  old version is left as caml-font-old.el for compatibility
+
+Version 3.07:
+-------------
+* support for showing type information &lt;Damien Doligez&gt;
 
 Version 3.05:
 -------------
@@ -195,4 +203,4 @@ in other cases may confuse the phrase selection function.
 
 Comments and bug reports to
 
-    Jacques Garrigue &lt;garrigue@kurims.kyoto-u.ac.jp&gt;
+    Jacques Garrigue &lt;garrigue@math.nagoya-u.ac.jp&gt;</diff>
      <filename>emacs/README</filename>
    </modified>
    <modified>
      <diff>@@ -1,141 +1,113 @@
-;(***********************************************************************)
-;(*                                                                     *)
-;(*                           Objective Caml                            *)
-;(*                                                                     *)
-;(*                Jacques Garrigue and Ian T Zimmerman                 *)
-;(*                                                                     *)
-;(*  Copyright 1997 Institut National de Recherche en Informatique et   *)
-;(*  en Automatique.  All rights reserved.  This file is distributed    *)
-;(*  under the terms of the GNU General Public License.                 *)
-;(*                                                                     *)
-;(***********************************************************************)
+;; caml-font: font-lock support for OCaml files
+;;
+;; rewrite and clean-up. 
+;; Changes:
+;; - fontify strings and comments using syntactic font lock
+;; - define a `font-lock-syntactic-face-function' to fontify ocamldoc comments
+;; - fontify infix operators like mod, land, lsl, etc.
+;; - fontify line number directives
+;; - fontify &quot;failwith&quot; and &quot;invalid_arg&quot; like &quot;raise&quot;
+;; - fontify '\x..' character constants
+;; - use the regexp-opt function to build regexps (more readable)
+;; - use backquote and comma in sexp (more readable)
+;; - drop the `caml-quote-char' variable (I don't use caml-light :))
+;; - stop doing weird things with faces
 
-;(* $Id$ *)
 
-;; useful colors
+(require 'font-lock)
 
-(cond
- ((x-display-color-p)
-  (require 'font-lock)
-  (cond
-   ((not (boundp 'font-lock-type-face))
-    ; make the necessary faces
-    (make-face 'Firebrick)
-    (set-face-foreground 'Firebrick &quot;Firebrick&quot;)
-    (make-face 'RosyBrown)
-    (set-face-foreground 'RosyBrown &quot;RosyBrown&quot;)
-    (make-face 'Purple)
-    (set-face-foreground 'Purple &quot;Purple&quot;)
-    (make-face 'MidnightBlue)
-    (set-face-foreground 'MidnightBlue &quot;MidnightBlue&quot;)
-    (make-face 'DarkGoldenRod)
-    (set-face-foreground 'DarkGoldenRod &quot;DarkGoldenRod&quot;)
-    (make-face 'DarkOliveGreen)
-    (set-face-foreground 'DarkOliveGreen &quot;DarkOliveGreen4&quot;)
-    (make-face 'CadetBlue)
-    (set-face-foreground 'CadetBlue &quot;CadetBlue&quot;)
-    ; assign them as standard faces
-    (setq font-lock-comment-face 'Firebrick)
-    (setq font-lock-string-face 'RosyBrown)
-    (setq font-lock-keyword-face 'Purple)
-    (setq font-lock-function-name-face 'MidnightBlue)
-    (setq font-lock-variable-name-face 'DarkGoldenRod)
-    (setq font-lock-type-face 'DarkOliveGreen)
-    (setq font-lock-reference-face 'CadetBlue)))
-  ; extra faces for documention
-  (make-face 'Stop)
-  (set-face-foreground 'Stop &quot;White&quot;)
-  (set-face-background 'Stop &quot;Red&quot;)
-  (make-face 'Doc)
-  (set-face-foreground 'Doc &quot;Red&quot;)
-  (setq font-lock-stop-face 'Stop)
-  (setq font-lock-doccomment-face 'Doc)
-))
+(defvar caml-font-stop-face
+  (progn
+    (make-face 'caml-font-stop-face)
+    (set-face-foreground 'caml-font-stop-face &quot;White&quot;)
+    (set-face-background 'caml-font-stop-face &quot;Red&quot;)
+    'caml-font-stop-face))
 
-; The same definition is in caml.el:
-; we don't know in which order they will be loaded.
-(defvar caml-quote-char &quot;'&quot;
-  &quot;*Quote for character constants. \&quot;'\&quot; for Objective Caml, \&quot;`\&quot; for Caml-Light.&quot;)
+(defvar caml-font-doccomment-face
+  (progn
+    (make-face 'caml-font-doccomment-face)
+    (set-face-foreground 'caml-font-doccomment-face &quot;Red&quot;)
+    'caml-font-doccomment-face))
+
+(unless (facep 'font-lock-preprocessor-face)
+  (defvar font-lock-preprocessor-face
+    (copy-face 'font-lock-builtin-face 
+               'font-lock-preprocessor-face)))
 
 (defconst caml-font-lock-keywords
-  (list
-;stop special comments
-   '(&quot;\\(^\\|[^\&quot;]\\)\\((\\*\\*/\\*\\*)\\)&quot;
-     2 font-lock-stop-face)
-;doccomments
-   '(&quot;\\(^\\|[^\&quot;]\\)\\((\\*\\*[^*]*\\([^)*][^*]*\\*+\\)*)\\)&quot;
-     2 font-lock-doccomment-face)
-;comments
-   '(&quot;\\(^\\|[^\&quot;]\\)\\((\\*[^*]*\\*+\\([^)*][^*]*\\*+\\)*)\\)&quot;
-     2 font-lock-comment-face)
+  `(
 ;character literals
-   (cons (concat caml-quote-char &quot;\\(\\\\\\([ntbr&quot; caml-quote-char &quot;\\]\\|&quot;
-                 &quot;[0-9][0-9][0-9]\\)\\|.\\)&quot; caml-quote-char
-                 &quot;\\|\&quot;[^\&quot;\\]*\\(\\\\\\(.\\|\n\\)[^\&quot;\\]*\\)*\&quot;&quot;)
-         'font-lock-string-face)
+    (&quot;'\\(.\\|\\\\\\([ntbr\&quot;'\\\\]\\|[0-9]\\{3\\}\\|x[0-9A-Fa-f]\\{2\\}\\)\\)'&quot;
+     . font-lock-string-face)
 ;modules and constructors
-   '(&quot;`?\\&lt;[A-Z][A-Za-z0-9_']*\\&gt;&quot; . font-lock-function-name-face)
+   (&quot;`?\\&lt;[A-Z][A-Za-z0-9_']*\\&gt;&quot; . font-lock-function-name-face)
 ;definition
-   (cons (concat
-          &quot;\\&lt;\\(a\\(nd\\|s\\)\\|c\\(onstraint\\|lass\\)&quot;
-          &quot;\\|ex\\(ception\\|ternal\\)\\|fun\\(ct\\(ion\\|or\\)\\)?&quot;
-          &quot;\\|in\\(herit\\|itializer\\)?\\|let&quot;
-          &quot;\\|m\\(ethod\\|utable\\|odule\\)&quot;
-          &quot;\\|of\\|p\\(arser\\|rivate\\)\\|rec\\|type&quot;
-          &quot;\\|v\\(al\\|irtual\\)\\)\\&gt;&quot;)
-         'font-lock-type-face)
+   (,(regexp-opt '(&quot;and&quot; &quot;as&quot; &quot;constraint&quot; &quot;class&quot;
+                   &quot;exception&quot; &quot;external&quot; &quot;fun&quot; &quot;function&quot; &quot;functor&quot;
+                   &quot;in&quot; &quot;inherit&quot; &quot;initializer&quot; &quot;let&quot;
+                   &quot;method&quot; &quot;mutable&quot; &quot;module&quot; &quot;of&quot; &quot;private&quot; &quot;rec&quot;
+                   &quot;type&quot; &quot;val&quot; &quot;virtual&quot;)
+                 'words)
+    . font-lock-type-face)
 ;blocking
-   '(&quot;\\&lt;\\(begin\\|end\\|object\\|s\\(ig\\|truct\\)\\)\\&gt;&quot;
-     . font-lock-keyword-face)
+   (,(regexp-opt '(&quot;begin&quot; &quot;end&quot; &quot;object&quot; &quot;sig&quot; &quot;struct&quot;) 'words)
+    . font-lock-keyword-face)
+;linenums
+   (&quot;# *[0-9]+&quot; . font-lock-preprocessor-face)
+;infix operators
+   (,(regexp-opt '(&quot;asr&quot; &quot;land&quot; &quot;lor&quot; &quot;lsl&quot; &quot;lsr&quot; &quot;lxor&quot; &quot;mod&quot;) 'words)
+    . font-lock-builtin-face)
 ;control
-   (cons (concat
-          &quot;\\&lt;\\(do\\(ne\\|wnto\\)?\\|else\\|for\\|i\\(f\\|gnore\\)&quot;
-          &quot;\\|lazy\\|match\\|new\\|or\\|t\\(hen\\|o\\|ry\\)&quot;
-          &quot;\\|w\\(h\\(en\\|ile\\)\\|ith\\)\\)\\&gt;&quot;
-          &quot;\\|\|\\|-&gt;\\|&amp;\\|#&quot;)
-         'font-lock-reference-face)
-   '(&quot;\\&lt;raise\\&gt;&quot; . font-lock-comment-face)
+   (,(concat &quot;[|#&amp;]\\|-&gt;\\|&quot;
+             (regexp-opt '(&quot;do&quot; &quot;done&quot; &quot;dowto&quot; &quot;else&quot; &quot;for&quot; &quot;if&quot; &quot;ignore&quot;
+                           &quot;lazy&quot; &quot;match&quot; &quot;new&quot; &quot;or&quot; &quot;then&quot; &quot;to&quot; &quot;try&quot;
+                           &quot;when&quot; &quot;while&quot; &quot;with&quot;)
+                         'words))
+    . font-lock-constant-face)
+   (&quot;\\&lt;raise\\|failwith\\|invalid_arg\\&gt;&quot;
+    . font-lock-comment-face)
 ;labels (and open)
-   '(&quot;\\(\\([~?]\\|\\&lt;\\)[a-z][a-zA-Z0-9_']*:\\)[^:=]&quot; 1
-     font-lock-variable-name-face)
-   '(&quot;\\&lt;\\(assert\\|open\\|include\\)\\&gt;\\|[~?][ (]*[a-z][a-zA-Z0-9_']*&quot;
-     . font-lock-variable-name-face)))
+   (&quot;\\(\\([~?]\\|\\&lt;\\)[a-z][a-zA-Z0-9_']*:\\)[^:=]&quot;
+    1 font-lock-variable-name-face)
+   (&quot;\\&lt;\\(assert\\|open\\|include\\)\\&gt;\\|[~?][ (]*[a-z][a-zA-Z0-9_']*&quot;
+    . font-lock-variable-name-face)))
+
+
+(defun caml-font-syntactic-face (s)
+  (let ((in-string  (nth 3 s))
+        (in-comment (nth 4 s))
+        (start      (nth 8 s)))
+    (cond
+     (in-string 'font-lock-string-face)
+     (in-comment
+      (goto-char start)
+      (cond
+       ((looking-at &quot;(\\*\\*/\\*\\*)&quot;) 'caml-font-stop-face)
+       ((looking-at &quot;(\\*\\*[^*]&quot;)     'caml-font-doccomment-face)
+       (t                              'font-lock-comment-face))))))
 
-(defconst inferior-caml-font-lock-keywords
-  (append
-   (list
-;inferior
-    '(&quot;^[#-]&quot; . font-lock-comment-face))
-   caml-font-lock-keywords))
 
 ;; font-lock commands are similar for caml-mode and inferior-caml-mode
-(defun caml-mode-font-hook ()
-  (cond
-   ((fboundp 'global-font-lock-mode)
-    (make-local-variable 'font-lock-defaults)
-    (setq font-lock-defaults
-	  '(caml-font-lock-keywords nil nil ((?' . &quot;w&quot;) (?_ . &quot;w&quot;)))))
-   (t
-    (setq font-lock-keywords caml-font-lock-keywords)))
-  (make-local-variable 'font-lock-keywords-only)
-  (setq font-lock-keywords-only t)
+(defun caml-font-set-font-lock ()
+  (setq font-lock-defaults
+        '(caml-font-lock-keywords
+          nil nil nil nil 
+          (font-lock-syntactic-face-function . caml-font-syntactic-face)))
   (font-lock-mode 1))
+(add-hook 'caml-mode-hook 'caml-font-set-font-lock)
 
-(add-hook 'caml-mode-hook 'caml-mode-font-hook)
 
-(defun inferior-caml-mode-font-hook ()
-  (cond
-   ((fboundp 'global-font-lock-mode)
-    (make-local-variable 'font-lock-defaults)
-    (setq font-lock-defaults
-          '(inferior-caml-font-lock-keywords
-            nil nil ((?' . &quot;w&quot;) (?_ . &quot;w&quot;)))))
-   (t
-    (setq font-lock-keywords inferior-caml-font-lock-keywords)))
-  (make-local-variable 'font-lock-keywords-only)
-  (setq font-lock-keywords-only t)
-  (font-lock-mode 1))
 
-(add-hook 'inferior-caml-mode-hooks 'inferior-caml-mode-font-hook)
+(defconst inferior-caml-font-lock-keywords
+  `((&quot;^[#-]&quot; . font-lock-comment-face)
+    ,@caml-font-lock-keywords))
+
+(defun inferior-caml-set-font-lock ()
+  (setq font-lock-defaults
+        '(inferior-caml-font-lock-keywords
+          nil nil nil nil 
+          (font-lock-syntactic-face-function . caml-font-syntactic-face)))
+  (font-lock-mode 1))
+(add-hook 'inferior-caml-mode-hooks 'inferior-caml-set-font-lock)
 
 (provide 'caml-font)</diff>
      <filename>emacs/caml-font.el</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>106cd302b410298b2ae55c834d94fafffb8a9c33</id>
    </parent>
  </parents>
  <author>
    <name>garrigue</name>
    <email>garrigue</email>
  </author>
  <url>http://github.com/thelema/ocaml-community/commit/fe19532e34e7b7c2bd67528737097e460ebb630b</url>
  <id>fe19532e34e7b7c2bd67528737097e460ebb630b</id>
  <committed-date>2007-10-29T00:16:43-07:00</committed-date>
  <authored-date>2007-10-29T00:16:43-07:00</authored-date>
  <message>new caml-font.el</message>
  <tree>ebcdd0d3945d20ee5271bca31130f8a56ce51fca</tree>
  <committer>
    <name>garrigue</name>
    <email>garrigue</email>
  </committer>
</commit>
