<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-05-01 16:44 GMT+02:00 Ben Coman <span dir="ltr"><<a href="mailto:btc@openinworld.com" target="_blank">btc@openinworld.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 28, 2017 at 1:47 PM, Eliot Miranda <span dir="ltr"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br><div dir="auto"><div>Ben,<br></div><div><br>On Apr 27, 2017, at 7:06 PM, Ben Coman <<a href="mailto:btc@openinworld.com" target="_blank">btc@openinworld.com</a>> wrote:<br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 28, 2017 at 6:16 AM, Eliot Miranda <span dir="ltr"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 27, 2017 at 2:38 PM, Nicolas Cellier <span dir="ltr"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmai<wbr>l.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br><div dir="ltr"><div><div>Hi Eliot,<br></div>it's not about my favourite editor, it's about the universally available one:<br><br><a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/57c9ef837f7b0914351c4836734d1df3c880c288" target="_blank">https://github.com/OpenSmallta<wbr>lk/opensmalltalk-vm/commit/57c<wbr>9ef837f7b0914351c4836734d1df3c<wbr>880c288</a><br><br></div>The LF are displayed correctly in Squeak/Pharo and we can use nextLine in replacement of upTo: Character cr, so I fail to see the problem of LF.<br>Could you explain?<br></div></blockquote><div><br></div><div>It's ok.  I give up.  This is another example of the tail wagging the dog, which gets on my nerves.  But getting them to fix their interface is way more difficult than us accommodating their limitations so go ahead.</div></div></div></div></blockquote><div><br></div><div>Its not github!  When looking into Sophie's issue, opening those ST scripts were unreadable </div><div>when opened in `vi` .  It was a pain that I had to break context to hunt for a GUI text app to read them</div></div></div></div></div></blockquote></div></blockquote><div><div><div><br></div><div>I'd advocate going to LF EOL, but if its really important, a bit of research dug up how git can work with CR-line-ending</div><div>Here is a recipe to demonstrate the effect. </div><div><br></div><div>First restore one commit back from "Use LF instead of CR as image/*.st line ending"</div><div>$ git status    # && git stash  # if required  </div><div>$ git checkout 9fd4e371~1</div><div>HEAD detached at 11d990e<br></div><div><div>nothing to commit, working directory clean</div></div><div>$ git diff</div><div>no output, okay.</div><div><br></div><div>Make a change in directory opensmalltalk-vm/<wbr>image/</div><div>$ vi StartReader.st</div><div>         insert a line "comment 1"</div><div>$ git diff  </div><div><div>@@ -1 +1 @@<br></div><div>-Transcript clear.^MSmalltalk snapshot: true andQuit: true.^M[[Processor activeProcess bindToThreadId: 2]^M     on: Error^M     do: [:ex|].^M StdioListener new run] forkAt: Processor activePriority + 1</div><div>+"comment 1"^MTranscript clear.^MSmalltalk snapshot: true andQuit: true.^M[[Processor activeProcess bindToThreadId: 2]^M        on: Error^M     do: [:ex|].^M StdioListener new run] forkAt: Processor activePriority + 1^M<br></div><div><br></div></div><div>yuck!</div><div><br></div><div>Add a git filter for ST files...</div><div>$ vi opensmalltalk-vm/.git/config</div><div>    append...<br></div><div><div>        [filter "crLineEnd"]</div><div>             clean = tr '\\r' '\\n'</div><div>             smudge = tr '\\n' '\\r'</div></div><div>$ vi opensmalltalk-vm/.<wbr>gitattributes</div><div>    append...</div><div>        *.st filter=crLineEnd</div><div><br></div><div>Commit file so that EOLs are updated to LF internal to git.</div><div>In directory opensmalltalk-vm/image/ ...</div><div>$ git add StartReader.st<br></div></div><div>$ git commit -m "apply filter - test only, throw away"</div><div><br></div><div>Now make a second change...</div><div>$ vi StartReader.st</div><div>        insert line "comment 2"</div><div>$ git diff</div><div><div>@@ -1,4 +1,5 @@</div><div> "comment 1"</div><div>+"comment 2"</div><div> Transcript clear.</div><div> Smalltalk snapshot: true andQuit: true.</div><div> [[Processor activeProcess bindToThreadId: 2]</div></div><div><br></div><div>Better!  </div><div>I didn't test it on github, but IIUC it just uses `git diff`</div></div><div> </div></div></div></div></blockquote><div><br></div><div>Thanks for the tip. Sounds like a viable way to not change our line end policy.<br></div><div>The only thing I wonder: is unixy tr available on every client? (think windows...)<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div>It's a three liner to wrap vi in a script that converts from CR to LF, invokes vi and then concerts back.  Is it really that problematic?<br></div></div></blockquote><div><br></div><div>Its not immediately obvious to me how to do that (maybe sed or tr to a temporary file that vi then edits?)</div><div>So "three lines" is not really a measure of the effort required to work out how to implement it, <br>and test that doesn't conflict with normal 'vi' usage. All this breaks from the context of what I was doing.  </div><div><br></div><div>Anyhow Tobias's vimrc advice works. </div><div><br></div><div class="gmail_quote">On Fri, Apr 28, 2017 at 8:03 PM, David T. Lewis <span dir="ltr"><<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>></span> <wbr>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="m_4842445058202737884gmail-"><br>On Fri, Apr 28, 2017 at 09:39:28AM +0200, Tobias Pape wrote:</span><span class="m_4842445058202737884gmail-"><br>><br>> (in .vimrc)<br>><br>> set fileformats=unix,mac,dos<br><br></span>Tobias,<br><br>Thank you! I can't believe I have gone so many years without ever knowing<br>about this simple editor setting.<br><br>Dave</blockquote><div><br></div><div>Also thx Tobias.  So many little corners of knowledge.</div><div>This works good for me.  Still not so good for the next newcomer that doesn't know this.   </div></div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>CR-only line endings are sooooooo last century, for machines like: Commodore 8-bit machines, Acorn BBC, ZX Spectrum, TRS-80, Apple II family, Oberon, the classic Mac OS up to version 9, MIT Lisp Machine and OS-9 [1].  These dogs died a long time ago ;)</div><div><br></div><div>Is there something particularly Smalltalk related I'm not aware of that makes CR-only line endings preferable?</div><div><br></div><div>[1] <a href="https://en.wikipedia.org/wiki/Newline" target="_blank">https://en.wikipedia.org/wiki/<wbr>Newline</a></div></div></div></div></div></blockquote></div></div></blockquote><div><br></div>On Fri, Apr 28, 2017 at 3:48 PM, Nicolas Cellier <span dir="ltr"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.<wbr>nice@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Ben,<br></div><div>There's no need to have three ways to do the same thing, line ending. </div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>So Smalltalk has chosen one and stick to it. it was CR. </div></div></div></div></blockquote><div><br></div><div>Back when Smalltalk was created, I guess CR was the dominant platform line ending and so was the choice was "align with the dominant convention".  Now that the dominant convention has progressed, the question arises whether to follow to reduce friction with other systems.   The trouble of course being that there are two competing line endings LF & CRLF.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>Thus you will see a message #cr used everywhere in the code base (either sent to Character or to a WriteStream to write an end of line).<br></div></div></div></div></blockquote><div><br></div><div>Ahh. I never made that connection before. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>Also, carriage return is used thru a CR variable in TextConstants pool dictionary.<br><br></div><div>The wisdom was that connections to/from outside world (external streams like files/sockets...) should do the conversion in/out the Smalltalk space.<br></div><div>But this has been inequally applied, especially in Squeak/Pharo where the zoo of Stream is not so well engineered (it's a mess!).<br><br></div><div>Since the boundary was messy, I've taken the responsibility to introduce the complexity inside the code base by:<br></div><div>- changing display of LF and adding hacks to display a single end of line in case of CR-LF pair<br></div><div>- introduce nextLine et a few other methods to deal with the zoo of line endings<br></div><div>I'm still not completely sure that it was a good idea... Maybe </div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>If we want to change our conventions to be more fashioned, we must get rid of cr message in the code base and replace it with something like eol (end of line).<br></div></div></div></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>Cuis has changed the CR to LF inside the image.<br><br></div></div></div></div></blockquote><div><br></div><div>I guess Cuis aligned closely with git since thats its main mechanism for its sources (??).</div><div>GNU Smalltalk uses LF (its aligned with Unix).</div><div>Dolphin uses CRLF (its aligned with Windows) </div><div><br></div><div>Theoretically, a move to the Unicode Line Separator U+2038 might solve all problems, <br>   <a href="http://unicode.org/standard/reports/tr13/tr13-5.html" target="_blank">http://unicode.org/standard/<wbr>reports/tr13/tr13-5.html</a><br></div><div>but practically it doesn't (yet) seem supported by vim or emacs <br>And of course, there is this about Standards...   <a href="https://xkcd.com/927" target="_blank">https://xkcd.com/927</a>   .</div><div><br></div></div></div></div></blockquote><div><br></div><div>Hmm, yet another line ending...<br>To me it sounds too much like what I call a "Trojan badger"...<br>(from the sketch of Monty Python Holly Grail where the knights of the round table forgot to climb into the Trojan rabbit, and after a blank, one suggest to build a wooden badger)<br><br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>cheers -ben</div><div><br></div></div></div></div>
<br></blockquote></div><br></div></div>