caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Tuareg mode: Indentation of application arguments
@ 2012-09-12 14:58 Romain Bardou
       [not found] ` <20120917.222210.832076572642519350.Christophe.Troestler@umons.ac.be>
  0 siblings, 1 reply; 10+ messages in thread
From: Romain Bardou @ 2012-09-12 14:58 UTC (permalink / raw)
  To: caml-list

Hello Caml-list,

I have finally took the time to configure tuareg to correctly indent 
after a "| ... ->" clause. After several years of doing it by hand, this 
feels soooo much better :) To do this I had to add "(setq 
tuareg-use-smie t)" to my .emacs (which I found a little confusing, by 
the way).

However, now it's indentation of application arguments which is messed 
up (to my tastes). Let's say I am writing:

a_very_long_function_name argument_1 argument_2 argument_3 argument_4

Now I want to put argument_4 on a new line. Before, I would obtain:

a_very_long_function_name argument_1 argument_2 argument_3
   argument_4

which I liked. Now, I obtain:

a_very_long_function_name argument_1 argument_2 argument_3
                           argument_4

Note that if I put all arguments on their own lines, indentation does 
not depend on the function name:

a_very_long_function_name
   argument_1
   argument_2
   argument_3
   argument_4

I did not find any variable controlling this behavior in the tuareg 
group. Do you know how I can obtain my beloved behavior back? Or is it a 
bug, in which case I should submit a bug report?

The reason I don't like this behavior is that it causes several issues:
- changing one function name would imply that one would have to reindent 
everything (non-local indentation: bad!);
- the indentation is not simply "indentation of previous line + N" where 
N is the same everywhere (complex indentation rule: bad!);
- the indentation size may be very long (sudden-death indentation: bad!).

My version of tuareg is 2.0.6.

Cheers,

-- 
Romain Bardou

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

end of thread, other threads:[~2012-10-08 15:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-12 14:58 [Caml-list] Tuareg mode: Indentation of application arguments Romain Bardou
     [not found] ` <20120917.222210.832076572642519350.Christophe.Troestler@umons.ac.be>
2012-09-18  3:08   ` [Caml-list] " Stefan Monnier
2012-09-21 13:42   ` [Caml-list] " Romain Bardou
2012-09-21 20:11     ` Kristopher Micinski
2012-09-22 13:22       ` Romain Bardou
2012-09-22 13:53         ` Dmitry Grebeniuk
2012-09-22 18:13         ` Kristopher Micinski
2012-09-23  0:27           ` Edgar Friendly
2012-09-23  1:18             ` Kristopher Micinski
2012-10-08 15:17         ` [Caml-list] " Stefan Monnier

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