caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] emacs mode?
@ 2011-01-26 23:47 Raoul Duke
  2011-01-27 13:38 ` Daniel Bünzli
  2011-01-27 15:08 ` Ashish Agarwal
  0 siblings, 2 replies; 8+ messages in thread
From: Raoul Duke @ 2011-01-26 23:47 UTC (permalink / raw)
  To: OCaml

hi,

what is the best emacs mode for ocaml? i downloaded latest tuareg
today but it seems to have trouble indenting quite often. i don't
think i'm doing anything crazy since i'm just a learner at the moment.

thanks.

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

* Re: [Caml-list] emacs mode?
  2011-01-26 23:47 [Caml-list] emacs mode? Raoul Duke
@ 2011-01-27 13:38 ` Daniel Bünzli
  2011-01-27 15:08 ` Ashish Agarwal
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Bünzli @ 2011-01-27 13:38 UTC (permalink / raw)
  To: Raoul Duke; +Cc: OCaml

> what is the best emacs mode for ocaml?

I don't know which mode is the best mode. But contrary to what many
people seem to think the ocaml-mode from the distribution is fine and
still maintained. You may want to give it a try.

Best,

Daniel

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

* Re: [Caml-list] emacs mode?
  2011-01-26 23:47 [Caml-list] emacs mode? Raoul Duke
  2011-01-27 13:38 ` Daniel Bünzli
@ 2011-01-27 15:08 ` Ashish Agarwal
  2011-01-27 18:46   ` Raoul Duke
  2011-01-27 20:09   ` Lukasz Stafiniak
  1 sibling, 2 replies; 8+ messages in thread
From: Ashish Agarwal @ 2011-01-27 15:08 UTC (permalink / raw)
  To: Raoul Duke; +Cc: OCaml

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

Can you describe the problem you are having or give an example. Many people
use Tuareg mode, and it should work fine.

On Wed, Jan 26, 2011 at 6:47 PM, Raoul Duke <raould@gmail.com> wrote:

> hi,
>
> what is the best emacs mode for ocaml? i downloaded latest tuareg
> today but it seems to have trouble indenting quite often. i don't
> think i'm doing anything crazy since i'm just a learner at the moment.
>
> thanks.
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
>

[-- Attachment #2: Type: text/html, Size: 1196 bytes --]

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

* Re: [Caml-list] emacs mode?
  2011-01-27 15:08 ` Ashish Agarwal
@ 2011-01-27 18:46   ` Raoul Duke
  2011-01-27 20:27     ` Ashish Agarwal
  2011-01-27 20:09   ` Lukasz Stafiniak
  1 sibling, 1 reply; 8+ messages in thread
From: Raoul Duke @ 2011-01-27 18:46 UTC (permalink / raw)
  To: OCaml

On Thu, Jan 27, 2011 at 7:08 AM, Ashish Agarwal <agarwal1975@gmail.com> wrote:
> Can you describe the problem you are having or give an example. Many people
> use Tuareg mode, and it should work fine.

some things i've seen, maybe something about my local emacs setup sometimes?

1) if i try to indent-region i get things like Symbol's function
definition is void: tuareg-before-change-function.

2) sometimes just using tab to indent i get an error (that i can't
figure out how to reproduce right now so this is just my recollection
of the emacs error message) about how a regexp isn't matching, and the
regexp looks to me like it is looking for ocaml style comments, and no
indentation happens.

3) sometimes i don't get an error, but the indentation is just not
right to my eye, and sometimes i can fix it by e.g. selecting the
whole buffer and doing indent-region, but sometimes not. or by putting
in ";;" everywhere, like after "type x=int" lines as well as after
"let myfn x = x" definitions.

of course today vs. yesterday it is behaving better -- all in all it
feels very random to me when tuareg does/not work. maybe once a person
gets used to it all it works fine? but i think it feels kinda scary
weird slightly broken to a newbie.

sincerely,
A Newbie.

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

* Re: [Caml-list] emacs mode?
  2011-01-27 15:08 ` Ashish Agarwal
  2011-01-27 18:46   ` Raoul Duke
@ 2011-01-27 20:09   ` Lukasz Stafiniak
  1 sibling, 0 replies; 8+ messages in thread
From: Lukasz Stafiniak @ 2011-01-27 20:09 UTC (permalink / raw)
  To: Ashish Agarwal; +Cc: Raoul Duke, OCaml

On Thu, Jan 27, 2011 at 4:08 PM, Ashish Agarwal <agarwal1975@gmail.com> wrote:
> Can you describe the problem you are having or give an example. Many people
> use Tuareg mode, and it should work fine.

Does anyone have a patch to make it work with folding-mode? (When
folded.) I'd appreciate! (But I'm too lazy to work it out myself...)

(Also, error throwback is broken with folding-mode folded, but I guess
it's emacs fault.)

Regards.

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

* Re: [Caml-list] emacs mode?
  2011-01-27 18:46   ` Raoul Duke
@ 2011-01-27 20:27     ` Ashish Agarwal
  2011-01-27 20:29       ` Raoul Duke
  2011-01-28 14:26       ` Damien Doligez
  0 siblings, 2 replies; 8+ messages in thread
From: Ashish Agarwal @ 2011-01-27 20:27 UTC (permalink / raw)
  To: Raoul Duke; +Cc: OCaml

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

On Thu, Jan 27, 2011 at 1:46 PM, Raoul Duke <raould@gmail.com> wrote:

> 1) if i try to indent-region i get things like Symbol's function
> definition is void: tuareg-before-change-function.
>

This works for me without any errors.


2) sometimes just using tab to indent i get an error (that i can't
> figure out how to reproduce right now so this is just my recollection
> of the emacs error message) about how a regexp isn't matching, and the
> regexp looks to me like it is looking for ocaml style comments, and no
> indentation happens.
>

I've never seen this either.



> 3) sometimes i don't get an error, but the indentation is just not
> right to my eye, and sometimes i can fix it by e.g. selecting the
> whole buffer and doing indent-region, but sometimes not. or by putting
> in ";;" everywhere, like after "type x=int" lines as well as after
> "let myfn x = x" definitions.
>

The double semicolon is mostly used in the top-level. Although there is
sometimes good use of them in source files, it is bad style to include them
unnecessarily.

There are some customizations possible to make it more to your liking. See
the included custom-tuarag.el file for examples. However, I suspect you have
other issues since you should not be getting any of the errors you mention
above. Maybe try a fresh emacs install and/or a different system.

[-- Attachment #2: Type: text/html, Size: 2077 bytes --]

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

* Re: [Caml-list] emacs mode?
  2011-01-27 20:27     ` Ashish Agarwal
@ 2011-01-27 20:29       ` Raoul Duke
  2011-01-28 14:26       ` Damien Doligez
  1 sibling, 0 replies; 8+ messages in thread
From: Raoul Duke @ 2011-01-27 20:29 UTC (permalink / raw)
  To: OCaml

> However, I suspect you have
> other issues since you should not be getting any of the errors you mention
> above. Maybe try a fresh emacs install and/or a different system.

many thanks for the sanity check :)

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

* Re: [Caml-list] emacs mode?
  2011-01-27 20:27     ` Ashish Agarwal
  2011-01-27 20:29       ` Raoul Duke
@ 2011-01-28 14:26       ` Damien Doligez
  1 sibling, 0 replies; 8+ messages in thread
From: Damien Doligez @ 2011-01-28 14:26 UTC (permalink / raw)
  To: OCaml


On 2011-01-27, at 21:27, Ashish Agarwal wrote:

> The double semicolon is mostly used in the top-level. Although there is sometimes good use of them in source files, it is bad style to include them unnecessarily.

Style is subjective, but note that the double semicolons make it much
easier for random tools (including the compiler) to find out where your
phrases begin and end.

It also makes it easier to copy your code and paste it to the toplevel.

-- Damien



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

end of thread, other threads:[~2011-01-28 14:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-26 23:47 [Caml-list] emacs mode? Raoul Duke
2011-01-27 13:38 ` Daniel Bünzli
2011-01-27 15:08 ` Ashish Agarwal
2011-01-27 18:46   ` Raoul Duke
2011-01-27 20:27     ` Ashish Agarwal
2011-01-27 20:29       ` Raoul Duke
2011-01-28 14:26       ` Damien Doligez
2011-01-27 20:09   ` Lukasz Stafiniak

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).