0
votes

Since I installed the last tuareg package (2.0.10), some things really annoy me and I can't find how to change them back to their previous setup :

let print_enum = 
  let c = ref 0 in
  fun f ->
  List.iter (fun e a
                 b c ->
    ) l

Here I'd like to have :

let print_enum = 
  let c = ref 0 in
  fun f ->
    List.iter (fun e a
      b c ->
    ) l

I couldn't find the indentation for fun f -> nor for

fun_app a b
  c d

in the customization menu.

1
How about diffing the old one from the new one and see what changed, or just use the older version that contains the behavior you prefer?lawlist
Because the mode completely changed between my previous version and the new one and I like to keep my packages updated. And mostly because I don't understand why these features disappeared (I mean, having the arguments of an application being aligned with the first argument gives you a code with a huuuuge blank when you go to a newline).Lhooq
The file CHANGES describes what is new and the first line looks very interesting: github.com/ocaml/tuareg/blob/master/CHANGES Perhaps you could type M-x describe-variable RET tuareg-indent-align-with-first-arg RET and see if that is what is causing you the behavior you wish to avoid. Since it is a variable, you can probably customize it to your liking. The CHANGES file only deals with versions 2.0.9 and 2.0.10. If you were running version 2.0.9 before updating your package, then the list of items to check is relatively short.lawlist
Oh, ok. I will look at that. I had a version older than the 2.0.9, sadly.Lhooq
Well, it doesn't work for my specific case, it works for printf "%s %s" s1 s2 if s2 is on another line it will get aligned according to printf and not s1 anymore. But for fun e a b c -> nothing changed. And I still can't find why fun f -> and List.iter are aligned.Lhooq

1 Answers

1
votes

I suggest to use ocp-indent instead of the built-in indentation of tuareg:

Indentation customization can be very intuitively. You can check out the sample configuration file for ocp-indent: https://github.com/OCamlPro/ocp-indent/blob/master/.ocp-indent