caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: caml-list@inria.fr
Subject: Re: [Caml-list] What is the right way to configure Tuareg to get the same indentation as in Batteries Included?
Date: Tue, 21 Nov 2017 14:59:15 -0500	[thread overview]
Message-ID: <jwvk1yjpfo8.fsf-monnier+Inbox@gnu.org> (raw)
In-Reply-To: <6c2af6b6-2f9f-7f12-2bbf-22b1286d29d5@matej-kosik.net>

>   match BatEnum.peek enum with
>   | None -> {re; im = multiplier}
>   | Some (Kwd ".")
>   | Some (Kwd "*") ->
>     BatEnum.junk enum;
>     parse_im ~multiplier re
>   | Some _token ->
>     parse_im ~multiplier re
>
> However, Tuareg, in my currenct configuration does instead this:
>
>   match BatEnum.peek enum with
>   | None -> {re; im = multiplier}
>   | Some (Kwd ".")
>     | Some (Kwd "*") ->
>      BatEnum.junk enum;
>      parse_im ~multiplier re
>   | Some _token ->
>      parse_im ~multiplier re

Here's how you can do it:
- Go to the first line that Tuareg indents wrong (i.e. `| Some (Kwd "*") ->`)
- Change its indentation to match your expectation
- run `M-x smie-config-set-indent RET`
- this should suggest to set (:before "|-or") to 0, which you can accept.
- go to the next line (that Tuareg indents wrong)
- Change its indentation to match your expectation
- run `M-x smie-config-set-indent RET`
- this time it asks you which rule you want to change (because 2 rules
  are used to determine this indentation): either (after "->") or
  (before "->") depending on whether you want to also change

     | Some (Kwd "*")
       -> BatEnum.junk enum;

  or not.

- once that is done, you should be able to do `M-x smie-config-save
  RET`.  To save the result into your Customize settings.


        Stefan

  reply	other threads:[~2017-11-21 19:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30 10:08 Matej Košík
2017-11-21 19:59 ` Stefan Monnier [this message]
2017-11-23  9:53   ` Matej Košík
2017-11-24  2:20     ` Stefan Monnier

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=jwvk1yjpfo8.fsf-monnier+Inbox@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=caml-list@inria.fr \
    /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).