caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: Louis Gesbert <gesbert@antislash.info>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] ocp-indent beta release
Date: Fri, 15 Feb 2013 01:00:35 +0100	[thread overview]
Message-ID: <E4F3394A0E014423B01A92D1C5530DA1@erratique.ch> (raw)
In-Reply-To: <1F8AABE110B94A03A92DDB149BE31A46@erratique.ch>

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

Le jeudi, 14 février 2013 à 17:18, Daniel Bünzli a écrit :
> By the way there's one big issue for me, in my whole code base I strictly stick to 80 columns and use the other acceptable convention mentioned here [1]. This means that I do not indent the top most cases so that you don't run into the 80 character limit too quickly.
>  
> Here's what I mean:
>  
> let f = function
> | A -> ...
> | B -> ...
>  
> let f x = match x with
> | A -> ...
> | B -> ...

In fact it's not only the top most cases. These ones:

let f =  
  let g = function  
  | A -> "A"
  | B -> "B"


  in
  g

also seem to be annoyingly indented to  

let f =  
  let g = function  
    | A -> "A"
    | B -> "B"
  in
  g



this really wastes too much space and is unusable for me, especially if you have local, nested function definitions.  

I have attached a file with the examples (email rendering is not very reliable). For me there should be a setting that lets that file unchanged.  

In typerex I could get this behaviour by having at least (don't remember exactly which conjunction does the thing):

(setq typerex-let-always-indent nil)
(setq typerex-with-indent 0)
(setq typerex-function-indent 0)
(setq typerex-fun-indent 0)
(setq typerex-type-indent 0)
(setq typerex-if-then-else-indent 0)



Best,

Daniel






[-- Attachment #2: fundefbycase.ml --]
[-- Type: application/octet-stream, Size: 383 bytes --]

let f x = match x with
| `A -> "A"
| `B -> "B"
    
let f = function
| `A -> "A"
| `B -> "B"
    
let f = fun x -> match x with
| `A -> "A"
| `B -> "B"
    
let f = 
  let g x = match x with
  | `A -> "A"
  | `B -> "B"
  in
  g
    
let f = 
  let g = function 
  | `A -> "A"
  | `B -> "B"
  in
  g
    
let f = 
  let g = fun x -> match x with
  | `A -> "A"
  | `B -> "B"
  in
  g


  reply	other threads:[~2013-02-15  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08 15:25 Louis Gesbert
2013-02-08 15:55 ` Gabriel Kerneis
2013-02-08 16:09   ` Louis Gesbert
2013-02-08 16:02 ` Daniel Bünzli
2013-02-08 16:22   ` Louis Gesbert
2013-02-08 17:50 ` Romain Bardou
2013-02-12 11:33   ` Louis Gesbert
2013-02-08 18:10 ` Ashish Agarwal
2013-02-08 18:19   ` Ashish Agarwal
2013-02-12 10:42 ` Didier Remy
2013-02-12 11:20   ` Louis Gesbert
2013-02-14 16:18     ` Daniel Bünzli
2013-02-15  0:00       ` Daniel Bünzli [this message]
2013-02-15 11:01         ` Louis Gesbert
2013-02-15 11:30           ` Daniel Bünzli
2013-02-13  3:48 ` Ivan Gotovchits
2013-02-13  9:00   ` Louis Gesbert
2013-02-15 13:57 ` [Caml-list] ocp-indent 1.0.0 release Louis Gesbert
2013-02-16 20:34   ` Niki Yoshiuchi
2013-02-17 18:05     ` Raphael Proust
2013-02-17 18:30       ` Török Edwin
2013-02-18  9:50         ` Louis Gesbert
2013-02-17 18:37       ` David Powers
2013-02-17 23:51       ` Niki Yoshiuchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E4F3394A0E014423B01A92D1C5530DA1@erratique.ch \
    --to=daniel.buenzli@erratique.ch \
    --cc=caml-list@inria.fr \
    --cc=gesbert@antislash.info \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).