* [Caml-list] long lines in some OCaml code
@ 2013-10-03 6:58 Francois Berenger
2013-10-03 7:07 ` Adrien Nader
2013-10-03 8:09 ` Lukasz Stafiniak
0 siblings, 2 replies; 4+ messages in thread
From: Francois Berenger @ 2013-10-03 6:58 UTC (permalink / raw)
To: caml users
Is there a way to automatically cut all long lines
in a code base (and indent the cut part correctly)?
--
Best regards,
Francois Berenger.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] long lines in some OCaml code
2013-10-03 6:58 [Caml-list] long lines in some OCaml code Francois Berenger
@ 2013-10-03 7:07 ` Adrien Nader
2013-10-03 7:09 ` David House
2013-10-03 8:09 ` Lukasz Stafiniak
1 sibling, 1 reply; 4+ messages in thread
From: Adrien Nader @ 2013-10-03 7:07 UTC (permalink / raw)
To: Francois Berenger; +Cc: caml users
Hi,
On Thu, Oct 03, 2013, Francois Berenger wrote:
> Is there a way to automatically cut all long lines
> in a code base (and indent the cut part correctly)?
That's something I never do automatically on whole files for fear of
making huge and ugly diffs but instead with vim's "gq<movement>"
command. It works well except for strings that end up spanning lines
(but that's a matter of vim configuration :) ).
If you want to do it on whole files (with a commit that only does
reformatting :) ), you might want to look at ocp-indent[1].
[1] http://www.typerex.org/ocp-indent.html
--
Adrien Nader
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] long lines in some OCaml code
2013-10-03 7:07 ` Adrien Nader
@ 2013-10-03 7:09 ` David House
0 siblings, 0 replies; 4+ messages in thread
From: David House @ 2013-10-03 7:09 UTC (permalink / raw)
To: Adrien Nader; +Cc: Francois Berenger, caml users
I generally find highlighting in my editor with ugly background
colours characters that are past your personal max column preference
is a good way to achieve this. There are a few exceptions to the max
column width that I would not like to automatically wrap -- sometimes
for whatever reason you really need a long line.
On 3 October 2013 08:07, Adrien Nader <adrien@notk.org> wrote:
> Hi,
>
> On Thu, Oct 03, 2013, Francois Berenger wrote:
>> Is there a way to automatically cut all long lines
>> in a code base (and indent the cut part correctly)?
>
> That's something I never do automatically on whole files for fear of
> making huge and ugly diffs but instead with vim's "gq<movement>"
> command. It works well except for strings that end up spanning lines
> (but that's a matter of vim configuration :) ).
>
> If you want to do it on whole files (with a commit that only does
> reformatting :) ), you might want to look at ocp-indent[1].
>
> [1] http://www.typerex.org/ocp-indent.html
> --
> Adrien Nader
>
> --
> Caml-list mailing list. Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] long lines in some OCaml code
2013-10-03 6:58 [Caml-list] long lines in some OCaml code Francois Berenger
2013-10-03 7:07 ` Adrien Nader
@ 2013-10-03 8:09 ` Lukasz Stafiniak
1 sibling, 0 replies; 4+ messages in thread
From: Lukasz Stafiniak @ 2013-10-03 8:09 UTC (permalink / raw)
To: Francois Berenger; +Cc: caml users
[-- Attachment #1: Type: text/plain, Size: 450 bytes --]
On Thu, Oct 3, 2013 at 8:58 AM, Francois Berenger <berenger@riken.jp> wrote:
> Is there a way to automatically cut all long lines
> in a code base (and indent the cut part correctly)?
>
>
If I wanted to do it I would write a script in Emacs. (Sorry for unhelpful
answer, but the other answers were also unhelpful...) I use
`auto-fill-mode' in Emacs: when I insert a space beyond a given column, it
automatically breaks the line at a previous space.
[-- Attachment #2: Type: text/html, Size: 853 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-03 8:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-03 6:58 [Caml-list] long lines in some OCaml code Francois Berenger
2013-10-03 7:07 ` Adrien Nader
2013-10-03 7:09 ` David House
2013-10-03 8: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