<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace"></div><div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Let's consider line-wrapping.</div><div class="gmail_default" style="font-family:monospace,monospace">There are at least four levels that wrapping could be done at.</div><div class="gmail_default" style="font-family:monospace,monospace">1. Character level.  When you reach column N-1,</div><div class="gmail_default" style="font-family:monospace,monospace">   whack in a \ and continue on the next line.</div><div class="gmail_default" style="font-family:monospace,monospace">2. Token level.  When the next token would not fit in the current line,</div><div class="gmail_default" style="font-family:monospace,monospace">   add a line break.  Ideally, indent it.</div><div class="gmail_default" style="font-family:monospace,monospace">3. Phrase level.  Pick some major phrase type(s) in the language and</div><div class="gmail_default" style="font-family:monospace,monospace">   insert line breaks while trying to preserve phrases intact.</div><div class="gmail_default" style="font-family:monospace,monospace">4. Semantic level.  Add line breaks in a way that disguises the</div><div class="gmail_default" style="font-family:monospace,monospace">   logical structure of the code as little as possible.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">Sadly, emacs works at level 1.  It doesn't even keep *tokens* intact,</div><div class="gmail_default" style="font-family:monospace,monospace">happily inserting line breaks not merely in comments and strings but</div><div class="gmail_default" style="font-family:monospace,monospace">even in numbers and keywords.  For me, the result is that emacs line-</div><div class="gmail_default" style="font-family:monospace,monospace">wrapping is a major impediment to readability.  Backslashes in the</div><div class="gmail_default" style="font-family:monospace,monospace">rightmost column of the window are to me as the chirping of the</div><div class="gmail_default" style="font-family:monospace,monospace">ceiling bird.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">There have been language-BASED editors that enforced the rules of</div><div class="gmail_default" style="font-family:monospace,monospace">the programming language as you typed and laid the code out by the</div><div class="gmail_default" style="font-family:monospace,monospace">book instead of the way you wanted it.  I used one and hated it,</div><div class="gmail_default" style="font-family:monospace,monospace">but it *did* respond rationally to both narrow and wide lines.<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">We've had a number of discussions in the Erlang mailing list over the</div><div class="gmail_default" style="font-family:monospace,monospace">years along the lines of "what do I do when my functions get so big</div><div class="gmail_default" style="font-family:monospace,monospace">that the indentation pushes stuff too far to the right" where the</div><div class="gmail_default" style="font-family:monospace,monospace">consensus is "don't do that", "don't be scared to write small functions",</div><div class="gmail_default" style="font-family:monospace,monospace">"rewrite for clarity", "don't be scared of vertical space", and such-like.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">Demented elder anecdote time:  during my PhD studies I met a programmer</div><div class="gmail_default" style="font-family:monospace,monospace">who wrote in an Algolish AI programming this way:</div><div class="gmail_default" style="font-family:monospace,monospace"> - he began each function on a new line</div><div class="gmail_default" style="font-family:monospace,monospace"> - he put a space between tokens only when forced to</div><div class="gmail_default" style="font-family:monospace,monospace">   (this includes NEVER using any indentation)</div><div class="gmail_default" style="font-family:monospace,monospace"> - he pressed the return key only when the next token would not</div><div class="gmail_default" style="font-family:monospace,monospace">   fit on the current line or at the end of a function.</div><div class="gmail_default" style="font-family:monospace,monospace">In Erlang terms, the result would have looked like</div><div class="gmail_default" style="font-family:monospace,monospace">handle_call(get_nodes,_From,Nodes)->{reply,Nodes,Nodes};<br>handle_call(get_node,_From,[{Load,N}|Tail])->{reply,N,Tail++[{Load+1,N}]};<br>handle_call({attach,Node},_From,Nodes)->case lists:keymember(Node,2,Nodes)<br>of true->{reply,already_attached,Nodes};false->erlang:monitor_node(Node,<br>true),spawn_link(Node,pool,statistic_collector,[]),{reply,attached,Nodes++<br>[{999999,Node}]}end;<br>handle_call({spawn,Gl,M,F,A},_From,Nodes)->{reply,N,NewNodes}=handle_call(<br>get_node,_From,Nodes),Pid=spawn(N,pool,do_spawn,[Gl,M,F,A]),{reply,Pid,<br>NewNodes};<br>handle_call(stop,_From,Nodes)->{stop,normal,stopped,Nodes}.</div><div class="gmail_default" style="font-family:monospace,monospace">He was the reason we wrote a pretty-printer for that language.</div><div class="gmail_default" style="font-family:monospace,monospace">But now imagine this with very wide lines, or wrapped by Emacs.<br><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, 24 Jan 2026 at 05:10, Zetian Lin <<a href="mailto:zaaktin.lam@outlook.com">zaaktin.lam@outlook.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

  
  <div>
    <p>I'm used to emacs w/ line wrapping turned on so extra-long lines
      probably feel less like a serious problem to me than other
      people... that said, I try to control the line width to under 100
      columns in my code. (I do make exceptions for certain cases e.g.
      in purely templating works where it's clear that you're just
      appending strings.)<br>
      <br>
      Cheers,</p>
    <p>Z Lin</p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div>On 1/21/26 14:15, Ralph Becket wrote:<br>
    </div>
    <blockquote type="cite">
      
      
      <div style="font-family:Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
        Hi everybody,</div>
      <div style="font-family:Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
        <br>
      </div>
      <div style="font-family:Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
        <br>
      </div>
      <div style="font-family:Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
        Happy New Year!</div>
      <div style="font-family:Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
        <br>
      </div>
      <div style="font-family:Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
        About twenty years back, when I left Mercury to start in
        mainstream commercial programming, monitors were a lot
        narrower.  There was a strong feeling then that 80 columns was
        the Right and Proper Line Length.  Nowadays, of course, monitors
        are much more generous.  While I reject uncontrolled line
        lengths, 80 columns seems painfully tight.  (I think the Linux
        developers moved away from this some years ago).  That said,
        when (back) in Rome, do as the Romans do.  So: what's the modern
        community position on this?</div>
      <div style="font-family:Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
        <br>
      </div>
      <div style="font-family:Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
        Cheers,</div>
      <div style="font-family:Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
        Ralph</div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
users mailing list
<a href="mailto:users@lists.mercurylang.org" target="_blank">users@lists.mercurylang.org</a>
<a href="https://lists.mercurylang.org/listinfo/users" target="_blank">https://lists.mercurylang.org/listinfo/users</a>
</pre>
    </blockquote>
  </div>

_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.mercurylang.org" target="_blank">users@lists.mercurylang.org</a><br>
<a href="https://lists.mercurylang.org/listinfo/users" rel="noreferrer" target="_blank">https://lists.mercurylang.org/listinfo/users</a><br>
</blockquote></div></div>