caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Wishes for an easy install of Ocaml
@ 2004-12-24  8:58 Philippe Lelédy
  2004-12-24 11:04 ` [Caml-list] " Stefano Zacchiroli
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Philippe Lelédy @ 2004-12-24  8:58 UTC (permalink / raw)
  To: Caml-list

I introduce me a little:

I am a French teacher who give to my students their first  course in 
Computer Science, which include learning Caml (as the first language).

I give them strong advice to install an  Unix-like OS on their own 
computer, with some success (Linux, MacOS X).
But because they have absolutly no Unix experience,  I'd like to say 
them  that  installing  Ocaml is  as  simple as

apt-get install ocaml (for instance)

but it is not. Another step is mandatory

apt-get install tuareg

but it is not enough, adding some obscure lines to .emacs is necessary 
b/c the old Caml mode is effective by default but Tuareg is not. Time 
spent to explain that is very counter-productive to Unix new-bies. 
Debian tuareg-mode does half the job by adding tuareg-mode directory to 
emacs load-path, but manual addition of (load "append-tuareg") is still 
necessary.

I've discovered another issue: if your emacs defaults to utf-8 encoding 
you need some extra lines in your .emacs, that I had to struggle a long 
time to find out:

(modify-coding-system-alist 'file "\\.ml\\'" 'iso-latin-9)
(modify-coding-system-alist 'file "\\.mli\\'" 'iso-latin-9)

(modify-coding-system-alist 'process "ocaml" 'iso-latin-9)

That's a bare minimum to have Ocaml working on a student own computer.

Other steps are usefull for a more comfortable  experience, for instance 
(on Debian):

(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.
[...]
 '(tuareg-library-path "/usr/lib/ocaml/3.08")
 )

That last line is not release independant.

And here is what I add to .emacs for an easy access to  Ocaml  manual:
 
  (setq tuareg-manual-url 
"file:///usr/share/doc/ocaml/docs/ocaml.html/index.html")
  (setq tuareg-browser 'phl-browser-new-tab)
  (setq tuareg-library-path "/usr/lib/ocaml/3.08/")

Here is my browser function:

(defun phl-browser-new-tab (url)
   (start-process-shell-command
     "firefox" nil
      (concat "firefox -remote 'openURL (" url  ", new-tab)' || firefox 
" url)
))
it opens a new tab if firefox has yet been started, and starts a new 
firefox if not.

Also more lines in .emacs are necessary to make Emacs behave more like a 
non Unix geek would expect.

And mozcaml Sidebar for Firefox can be said a must have.

You can't expect a new bie to do all that.

My  provisionnal answer is  making a Linux live CD for my students with 
all that; much work, only x86 and not a way to  really install the OS.

Better ideas ? Making a ocaml-goodies-for-newbies package which  would 
include all this customizations ?

Ph. L.

  

 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2004-12-24  8:58 Wishes for an easy install of Ocaml Philippe Lelédy
@ 2004-12-24 11:04 ` Stefano Zacchiroli
  2004-12-24 11:36   ` skaller
  2004-12-27 15:18   ` Ralf Treinen
  2004-12-24 11:22 ` [Caml-list] Wishes for an easy install of Ocaml Christophe TROESTLER
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 17+ messages in thread
From: Stefano Zacchiroli @ 2004-12-24 11:04 UTC (permalink / raw)
  To: caml-list; +Cc: Debian Ocaml Maint ML

On Fri, Dec 24, 2004 at 09:58:58AM +0100, Philippe Lelédy wrote:
> But because they have absolutly no Unix experience,  I'd like to say 
> them  that  installing  Ocaml is  as  simple as

Your problem seems to be specific to the Debian GNU/Linux distribution
whereas this mailing list is for discussion about the OCaml language. A
more suited mailing list is debian-ocaml-maint@lists.debian.org (Cc-ed),
please follow-up to that mailing list.

Anyway ...

> apt-get install ocaml (for instance)

This line _is_ enough, tuareg mode is not strictly necessary to use
ocaml.  Still, you can avoid the second step by simply telling your
students to execude "apt-get install ocaml tuareg".

> but it is not enough, adding some obscure lines to .emacs is necessary 
> b/c the old Caml mode is effective by default but Tuareg is not. Time 
> spent to explain that is very counter-productive to Unix new-bies. 
> Debian tuareg-mode does half the job by adding tuareg-mode directory to 
> emacs load-path, but manual addition of (load "append-tuareg") is still 
> necessary.

I'm not an expert Emacs user, but this issue is definitely related to
the tuareg-mode debian package.  You can get in touch with that package
maintainer and/or file a whishlist bug report against it in order to
automate the emacs configuration.

Ralf (or someone else of the debian ocaml maintainer with Emacs skill),
could you please comment on this and other emacs related needs which
could possibly by automated on tuareg-mode installation?

Cheers.

-- 
Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. -!-


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2004-12-24  8:58 Wishes for an easy install of Ocaml Philippe Lelédy
  2004-12-24 11:04 ` [Caml-list] " Stefano Zacchiroli
@ 2004-12-24 11:22 ` Christophe TROESTLER
  2004-12-24 17:24 ` Sylvain LE GALL
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: Christophe TROESTLER @ 2004-12-24 11:22 UTC (permalink / raw)
  To: phl; +Cc: Caml-list

On Fri, 24 Dec 2004, Philippe Lelédy <phl@leledy.org> wrote:
> 
> I am a French teacher who give to my students their first  course in 
> Computer Science, which include learning Caml (as the first language).
> I give them strong advice to install an  Unix-like OS on their own 
> computer, with some success (Linux, MacOS X).

Sounds great!

>  '(tuareg-library-path "/usr/lib/ocaml/3.08")
> 
> That last line is not release independant.

I am no expert in elisp, but this works:

     (with-temp-buffer
	(progn
	  (call-process "ocamlc" nil t nil "-where")
	  (let ((path (buffer-string)))
	    ;; get rid of the final '\n'
	    (setq tuareg-library-path (substring path 0 -1))
	    )))

>   (setq tuareg-manual-url 

The manual is available in info form (C-h i  d  m ocaml  RETURN).
This is in the ocaml-doc package under Debian.

> Also more lines in .emacs are necessary to make Emacs behave more
> like a non Unix geek would expect.

In my view, this is optional -- we point our students to e.g.
http://www.cua.dk/cua.html but do not provide it ourselves.

> Making a ocaml-goodies-for-newbies package which would include all
> this customizations ?

Yes.  Your package could depend on ocaml and tuareg-mode for easy
install.

my 0.2€,
ChriS


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2004-12-24 11:04 ` [Caml-list] " Stefano Zacchiroli
@ 2004-12-24 11:36   ` skaller
  2004-12-27 15:18   ` Ralf Treinen
  1 sibling, 0 replies; 17+ messages in thread
From: skaller @ 2004-12-24 11:36 UTC (permalink / raw)
  To: Debian Ocaml Maint ML; +Cc: caml-list

On Fri, 2004-12-24 at 22:04, Stefano Zacchiroli wrote:

> This line _is_ enough, tuareg mode is not strictly necessary to use
> ocaml.  Still, you can avoid the second step by simply telling your
> students to execude "apt-get install ocaml tuareg".

This is a *first programming course*.

Tell your students to use gedit.

Emacs that's a two year post-grad course .. :)

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2004-12-24  8:58 Wishes for an easy install of Ocaml Philippe Lelédy
  2004-12-24 11:04 ` [Caml-list] " Stefano Zacchiroli
  2004-12-24 11:22 ` [Caml-list] Wishes for an easy install of Ocaml Christophe TROESTLER
@ 2004-12-24 17:24 ` Sylvain LE GALL
  2004-12-24 18:21 ` Matthew O'Connor
  2004-12-27 16:35 ` Didier Remy
  4 siblings, 0 replies; 17+ messages in thread
From: Sylvain LE GALL @ 2004-12-24 17:24 UTC (permalink / raw)
  To: caml-list

Hello,

On Fri, Dec 24, 2004 at 09:58:58AM +0100, Philippe Lelédy wrote:
> I introduce me a little:
> 
> I am a French teacher who give to my students their first  course in 
> Computer Science, which include learning Caml (as the first language).
> 
> I give them strong advice to install an  Unix-like OS on their own 
> computer, with some success (Linux, MacOS X).
> But because they have absolutly no Unix experience,  I'd like to say 
> them  that  installing  Ocaml is  as  simple as
> 
> apt-get install ocaml (for instance)
> 
> but it is not. Another step is mandatory
> 
> apt-get install tuareg
> 

What version of Debian do they use ?

If it is woody, the ocaml packages are pretty old and maybe have some
bugs, concerning sarge of sid, i don't think they suffer from the same
problem.

Kind regard
Sylvain Le Gall


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2004-12-24  8:58 Wishes for an easy install of Ocaml Philippe Lelédy
                   ` (2 preceding siblings ...)
  2004-12-24 17:24 ` Sylvain LE GALL
@ 2004-12-24 18:21 ` Matthew O'Connor
  2004-12-27 16:35 ` Didier Remy
  4 siblings, 0 replies; 17+ messages in thread
From: Matthew O'Connor @ 2004-12-24 18:21 UTC (permalink / raw)
  To: Philippe Lelédy; +Cc: Caml-list

Philippe Lelédy wrote:
> but it is not enough, adding some obscure lines to .emacs is necessary 
> b/c the old Caml mode is effective by default but Tuareg is not. Time 
> spent to explain that is very counter-productive to Unix new-bies. 
> Debian tuareg-mode does half the job by adding tuareg-mode directory to 
> emacs load-path, but manual addition of (load "append-tuareg") is still 
> necessary.
> 

As this is their first programming class, you could just provide a fixed 
.emacs and tell them to copy it into their home directory (as they won't 
have their own .emacs with customization yet).

Then it's an apt-get and a copy, which shouldn't be too hard. :-)


Matt


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2004-12-24 11:04 ` [Caml-list] " Stefano Zacchiroli
  2004-12-24 11:36   ` skaller
@ 2004-12-27 15:18   ` Ralf Treinen
  2004-12-27 16:54     ` Sven Luther
  1 sibling, 1 reply; 17+ messages in thread
From: Ralf Treinen @ 2004-12-27 15:18 UTC (permalink / raw)
  To: caml-list, Debian Ocaml Maint ML

On Fri, Dec 24, 2004 at 12:04:33PM +0100, Stefano Zacchiroli wrote:
> On Fri, Dec 24, 2004 at 09:58:58AM +0100, Philippe Lelédy wrote:

> > but it is not enough, adding some obscure lines to .emacs is necessary 
> > b/c the old Caml mode is effective by default but Tuareg is not. Time 
> > spent to explain that is very counter-productive to Unix new-bies. 
> > Debian tuareg-mode does half the job by adding tuareg-mode directory to 
> > emacs load-path, but manual addition of (load "append-tuareg") is still 
> > necessary.
> 
> I'm not an expert Emacs user, but this issue is definitely related to
> the tuareg-mode debian package.  You can get in touch with that package
> maintainer and/or file a whishlist bug report against it in order to
> automate the emacs configuration.
> 
> Ralf (or someone else of the debian ocaml maintainer with Emacs skill),
> could you please comment on this and other emacs related needs which
> could possibly by automated on tuareg-mode installation?

We had this dicussion already earlier on this list. At that time we
agreed *not* to activate automaticallt tuareg-mode for *.ml* files
since the ocaml package provids another emacs mode for editing
.ml files. Hence, the decision at that time was that the user shoulde
decide for himself which emacs mode he wans to use. 

-Ralf.
-- 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2004-12-24  8:58 Wishes for an easy install of Ocaml Philippe Lelédy
                   ` (3 preceding siblings ...)
  2004-12-24 18:21 ` Matthew O'Connor
@ 2004-12-27 16:35 ` Didier Remy
  4 siblings, 0 replies; 17+ messages in thread
From: Didier Remy @ 2004-12-27 16:35 UTC (permalink / raw)
  To: Philippe Lelédy; +Cc: caml-list

Regarding the emacs-mode installation, why don't you write your own
customization, provide your students with two files: 

        ocaml-customize.el
        ocaml-init.el

(The former file includes all customized commands.  The latter is only a few
lines long to load the former.) and tell them where to save
ocaml-customize.el and to append the content of ocaml-init.el at the end of
their ~/.emacs.el file. They need not know anything at all about emacs.

    Didier


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2004-12-27 15:18   ` Ralf Treinen
@ 2004-12-27 16:54     ` Sven Luther
  2004-12-31 16:20       ` Richard Jones
  0 siblings, 1 reply; 17+ messages in thread
From: Sven Luther @ 2004-12-27 16:54 UTC (permalink / raw)
  To: caml-list, Debian Ocaml Maint ML

On Mon, Dec 27, 2004 at 04:18:07PM +0100, Ralf Treinen wrote:
> On Fri, Dec 24, 2004 at 12:04:33PM +0100, Stefano Zacchiroli wrote:
> > On Fri, Dec 24, 2004 at 09:58:58AM +0100, Philippe Lelédy wrote:
> 
> > > but it is not enough, adding some obscure lines to .emacs is necessary 
> > > b/c the old Caml mode is effective by default but Tuareg is not. Time 
> > > spent to explain that is very counter-productive to Unix new-bies. 
> > > Debian tuareg-mode does half the job by adding tuareg-mode directory to 
> > > emacs load-path, but manual addition of (load "append-tuareg") is still 
> > > necessary.
> > 
> > I'm not an expert Emacs user, but this issue is definitely related to
> > the tuareg-mode debian package.  You can get in touch with that package
> > maintainer and/or file a whishlist bug report against it in order to
> > automate the emacs configuration.
> > 
> > Ralf (or someone else of the debian ocaml maintainer with Emacs skill),
> > could you please comment on this and other emacs related needs which
> > could possibly by automated on tuareg-mode installation?
> 
> We had this dicussion already earlier on this list. At that time we
> agreed *not* to activate automaticallt tuareg-mode for *.ml* files
> since the ocaml package provids another emacs mode for editing
> .ml files. Hence, the decision at that time was that the user shoulde
> decide for himself which emacs mode he wans to use. 

What about installing tuareg by default in the ocaml-core or whatever
meta-package, and have it ask a debconf question at priority medium about
which of the two emacs bindings should be used ? 

Friendly,

Sven Luther


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2004-12-27 16:54     ` Sven Luther
@ 2004-12-31 16:20       ` Richard Jones
  2004-12-31 22:31         ` Sven Luther
  2005-01-02  1:21         ` Jacques Garrigue
  0 siblings, 2 replies; 17+ messages in thread
From: Richard Jones @ 2004-12-31 16:20 UTC (permalink / raw)
  To: caml-list, Debian Ocaml Maint ML

On Mon, Dec 27, 2004 at 05:54:11PM +0100, Sven Luther wrote:
> What about installing tuareg by default in the ocaml-core or whatever
> meta-package, and have it ask a debconf question at priority medium about
> which of the two emacs bindings should be used ? 

What about ditching the core emacs support and just including tuareg
mode instead, since (no offence to whoever wrote the core support)
tuareg's much better.

Rich.

-- 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2004-12-31 16:20       ` Richard Jones
@ 2004-12-31 22:31         ` Sven Luther
  2005-01-15 12:29           ` Lionel Elie Mamane
  2005-01-02  1:21         ` Jacques Garrigue
  1 sibling, 1 reply; 17+ messages in thread
From: Sven Luther @ 2004-12-31 22:31 UTC (permalink / raw)
  To: Richard Jones; +Cc: caml-list, Debian Ocaml Maint ML

On Fri, Dec 31, 2004 at 04:20:37PM +0000, Richard Jones wrote:
> On Mon, Dec 27, 2004 at 05:54:11PM +0100, Sven Luther wrote:
> > What about installing tuareg by default in the ocaml-core or whatever
> > meta-package, and have it ask a debconf question at priority medium about
> > which of the two emacs bindings should be used ? 
> 
> What about ditching the core emacs support and just including tuareg
> mode instead, since (no offence to whoever wrote the core support)
> tuareg's much better.

The core stuff is part of the ocaml package upstream, while tuareg is not. I
am no emacs user, but i somehow don't feel well for removing the core emacs
mode.

Friendly,

Sven Luther


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2004-12-31 16:20       ` Richard Jones
  2004-12-31 22:31         ` Sven Luther
@ 2005-01-02  1:21         ` Jacques Garrigue
  2005-01-02 10:50           ` Richard Jones
  2005-01-02 15:44           ` tuareg-mode v.s. caml-mode (was: Wishes for an easy install of Ocaml) Christophe TROESTLER
  1 sibling, 2 replies; 17+ messages in thread
From: Jacques Garrigue @ 2005-01-02  1:21 UTC (permalink / raw)
  To: rich; +Cc: caml-list

From: Richard Jones <rich@furbychan.annexia.org>
> On Mon, Dec 27, 2004 at 05:54:11PM +0100, Sven Luther wrote:
> > What about installing tuareg by default in the ocaml-core or whatever
> > meta-package, and have it ask a debconf question at priority medium about
> > which of the two emacs bindings should be used ? 
> 
> What about ditching the core emacs support and just including tuareg
> mode instead, since (no offence to whoever wrote the core support)
> tuareg's much better.

The core ocaml-mode has been written by so many people, that nobody
will take the blame (I hope so, or you could face a vendetta.)
The problem with it is that the code is such spagetthi that it gets
difficult to improve it (at least the indentation part.)

Having never tried Tuareg (mostly out of inertia, since I'm satisfied
with the core mode), could you be more precise about what is better in
Tuareg. Excluding indentation style of course, as this is a matter of
taste. (But note that in order to replace the core mode, you have to be
able to indent in exactly the same way.)

Just curious.

Ditching the core mode would indeed save time for some people.

Cheers for the new year.

       Jacques Garrigue


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2005-01-02  1:21         ` Jacques Garrigue
@ 2005-01-02 10:50           ` Richard Jones
  2005-01-02 11:13             ` Janne Hellsten
  2005-01-02 12:16             ` Jacques GARRIGUE
  2005-01-02 15:44           ` tuareg-mode v.s. caml-mode (was: Wishes for an easy install of Ocaml) Christophe TROESTLER
  1 sibling, 2 replies; 17+ messages in thread
From: Richard Jones @ 2005-01-02 10:50 UTC (permalink / raw)
  To: Jacques Garrigue; +Cc: caml-list

On Sun, Jan 02, 2005 at 10:21:49AM +0900, Jacques Garrigue wrote:
> The core ocaml-mode has been written by so many people, that nobody
> will take the blame (I hope so, or you could face a vendetta.)
> The problem with it is that the code is such spagetthi that it gets
> difficult to improve it (at least the indentation part.)
> 
> Having never tried Tuareg (mostly out of inertia, since I'm satisfied
> with the core mode), could you be more precise about what is better in
> Tuareg. Excluding indentation style of course, as this is a matter of
> taste. (But note that in order to replace the core mode, you have to be
> able to indent in exactly the same way.)

I don't know about the exact details, but I notice the difference when
I have to use a machine which doesn't have tuareg-mode installed.  So
much so that I just install tuareg before going any further.
Integration with font-lock-mode seems better.

I'm quite sure that tuareg-mode can be configured to indent
the same way as the core mode.

Since tuareg-mode is actually developed at INRIA, it would seem fairly
logical to integrate it into OCaml.

Rich.

-- 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2005-01-02 10:50           ` Richard Jones
@ 2005-01-02 11:13             ` Janne Hellsten
  2005-01-02 12:16             ` Jacques GARRIGUE
  1 sibling, 0 replies; 17+ messages in thread
From: Janne Hellsten @ 2005-01-02 11:13 UTC (permalink / raw)
  To: caml-list

> I'm quite sure that tuareg-mode can be configured to indent
> the same way as the core mode.

This comes close (IIRC, I haven't used the default ocaml mode for years):

(custom-set-variables
  ;; CAML Tuareg
  '(tuareg-default-indent 2)
  '(tuareg-in-indent 0)
  '(tuareg-match-indent 0)
  '(tuareg-with-indent 0)
  '(tuareg-sig-struct-align nil))

ciao,
janne


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2005-01-02 10:50           ` Richard Jones
  2005-01-02 11:13             ` Janne Hellsten
@ 2005-01-02 12:16             ` Jacques GARRIGUE
  1 sibling, 0 replies; 17+ messages in thread
From: Jacques GARRIGUE @ 2005-01-02 12:16 UTC (permalink / raw)
  To: rich; +Cc: garrigue, caml-list

From: Richard Jones <rich@furbychan.annexia.org>

> > Having never tried Tuareg (mostly out of inertia, since I'm satisfied
> > with the core mode), could you be more precise about what is better in
> > Tuareg.

> I don't know about the exact details, but I notice the difference when
> I have to use a machine which doesn't have tuareg-mode installed.  So
> much so that I just install tuareg before going any further.
> Integration with font-lock-mode seems better.

This is a rather funny comment.
I just realized recently that the choice of colors with the core caml
mode is not optimal with Xemacs: for some reason most of the used
faces appear to be colorless. I didn't realize it before, because I'm
always using GNU emacs, for which colorization works perfectly.

But honestly, you're not going to say this is the main advantage.
Colors can be configured so freely that you could correct this
instantly: just replace the (not (boundp 'font-lock-type-face)) in
caml-font.el by t.

Or is there a more serious problem?

> Since tuareg-mode is actually developed at INRIA, it would seem fairly
> logical to integrate it into OCaml.

This is not the same team, so there is no direct relation.

Regards,

Jacques Garrigue


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: tuareg-mode v.s. caml-mode (was: Wishes for an easy install of Ocaml)
  2005-01-02  1:21         ` Jacques Garrigue
  2005-01-02 10:50           ` Richard Jones
@ 2005-01-02 15:44           ` Christophe TROESTLER
  1 sibling, 0 replies; 17+ messages in thread
From: Christophe TROESTLER @ 2005-01-02 15:44 UTC (permalink / raw)
  To: O'Caml Mailing List

On Sun, 02 Jan 2005, Jacques Garrigue <garrigue@math.nagoya-u.ac.jp> wrote:
> 
> Having never tried Tuareg (mostly out of inertia, since I'm
> satisfied with the core mode), could you be more precise about what
> is better in Tuareg.

For me essentially
- font-lock
- more customizable

Caml-mode font-lock is not bad but it has some shortcomings and is
difficult to tailor to one likes [1] -- as far as I know (please,
correct me if I am wrong), one cannot change the font-lock colors on a
per-mode basis.  Granted, this is a convenience issue but when you get
used to comfort...

On the other hand, the caml-mode has also strong points: it has the
ability to display the "definitions" in the speedbar -- at least if
you add

(speedbar-add-supported-extension '(".ml" ".mli" ".mll" ".mly"))

in ~/.emacs -- and tuareg currently does not. :(

> Ditching the core mode would indeed save time for some people.

Note that tuareg uses some files of the caml-mode.  What about some
collaboration to merge the better of the two modes into a unique one??

> (But note that in order to replace the core mode, you have to be
> able to indent in exactly the same way.)

I do not know all params of the core mode but here is my config and it
is pretty close:

          (setq tuareg-in-indent 0)
          (setq tuareg-let-always-indent t)
          (setq tuareg-let-indent 2)
          (setq tuareg-with-indent 0)
          (setq tuareg-function-indent 0)
          (setq tuareg-fun-indent 0)
          (setq tuareg-parser-indent 0)
          (setq tuareg-match-indent 0)
          (setq tuareg-begin-indent 2)
          (setq tuareg-parse-indent 2); .mll
          (setq tuareg-rule-indent 2)

Here is an example where it is not exactly the same but tuareg mode
behavior seems more reasonable to me:

caml-mode:

    Hashtbl.iter (fun id buf ->
      output_string fcgi_stdout fd id (Buffer.contents buf);
      Buffer.clear buf
		 ) outputs_stdout;

tuareg-mode:

    Hashtbl.iter (fun id buf ->
		    output_string fcgi_stdout fd id (Buffer.contents buf);
		    Buffer.clear buf
		 ) outputs_stdout;

Happy new year,
ChriS

---
[1] Some examples to give you an idea:

- [data: string] and [data : string] get highlighted differently
  (yes, there is only a non-significant space difference);

- "|" and "->" are set to font-lock-constant-face (too bright for me)
  but I cannot change their colors without affecting other symbols and
  other modes.  Moreover in "[|" both or none should be highlighted.

- Constructors get the font-lock-function-name-face (which I would do
  without personally) but the real functions [let f x =...] do not.
  Tuareg is much better at highlighting functions and variables.

- The main thing that bother me basically is that the faces are not
  set in a way that reflects their semantic : for example

  * [open] is colored with font-lock-variable-name-face (sic),
  * [raise] is with font-lock-comment-face,
  * [for] and [if] are keywords and should be treated as such!
  * font-lock-doccomment-face should be replaced with font-lock-doc-face

  and so caml-mode colors do not have the same meaning as in other
  buffers...

- Here is a doc comment not which is not highlighted:

  (** [decode_range s low up] decodes the substring [s.[low .. up-1]]
      i.e., in the returned string the '%XX' and '+' are converted
      into their chars.  The range [s.[low .. up-1]] is overwritten.
      It returns the decoded string.

      [decode_range_strip] does the same, except that the decoded
      strings are stripped of heading and trailing spaces.

      It is ASSUMED that the range is valid i.e., [0 <= low] and [up <=
      String.length s].  Invalid '%XX' are left unchanged. *)

- Here is a normal comment which is not highlighted:

(* File: cgi_common.ml

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library 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; it is available at
   <http://www.fsf.org/copyleft/gpl.html>, or by writing to the Free
   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
*)


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Caml-list] Wishes for an easy install of Ocaml
  2004-12-31 22:31         ` Sven Luther
@ 2005-01-15 12:29           ` Lionel Elie Mamane
  0 siblings, 0 replies; 17+ messages in thread
From: Lionel Elie Mamane @ 2005-01-15 12:29 UTC (permalink / raw)
  To: Richard Jones, caml-list, Debian Ocaml Maint ML

[-- Attachment #1: Type: text/plain, Size: 531 bytes --]

On Fri, Dec 31, 2004 at 11:31:36PM +0100, Sven Luther wrote:
> On Fri, Dec 31, 2004 at 04:20:37PM +0000, Richard Jones wrote:

>> What about ditching the core emacs support and just including
>> tuareg mode instead, since (no offence to whoever wrote the core
>> support) tuareg's much better.

> The core stuff is part of the ocaml package upstream, while tuareg
> is not.

Additionally, I think that tuareg needs the core emacs support
installed for some functionalities (like using type annotations).

-- 
Lionel

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2005-01-15 12:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-24  8:58 Wishes for an easy install of Ocaml Philippe Lelédy
2004-12-24 11:04 ` [Caml-list] " Stefano Zacchiroli
2004-12-24 11:36   ` skaller
2004-12-27 15:18   ` Ralf Treinen
2004-12-27 16:54     ` Sven Luther
2004-12-31 16:20       ` Richard Jones
2004-12-31 22:31         ` Sven Luther
2005-01-15 12:29           ` Lionel Elie Mamane
2005-01-02  1:21         ` Jacques Garrigue
2005-01-02 10:50           ` Richard Jones
2005-01-02 11:13             ` Janne Hellsten
2005-01-02 12:16             ` Jacques GARRIGUE
2005-01-02 15:44           ` tuareg-mode v.s. caml-mode (was: Wishes for an easy install of Ocaml) Christophe TROESTLER
2004-12-24 11:22 ` [Caml-list] Wishes for an easy install of Ocaml Christophe TROESTLER
2004-12-24 17:24 ` Sylvain LE GALL
2004-12-24 18:21 ` Matthew O'Connor
2004-12-27 16:35 ` Didier Remy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).