Re: What have I done now ? (aka CR and LF confusion)

2020-05-28 Thread Mark Talluto via use-livecode
On May 28, 2020, at 10:33 AM, Mark Wieder via use-livecode 
 wrote:
> 
> On 5/28/20 10:17 AM, Mark Talluto via use-livecode wrote:
>> I am a fan of moving Mac to default to LF. We use LF explicitly as our line 
>> ending of choice in all of our current software projects.
>> LF is useful if only to natively work with the expected line endings from 
>> Github and text files interchanged with Linux servers.
> 
> I agree, but have you tried adjusting your git core.autocrlf settings?

No. I was unaware. While this is very complete of them, standardizing has 
unified our experience and made it consistent. But, it is good to know that 
GitHub is accommodating. 


Best regards,

Mark Talluto
livecloud.io 
nursenotes.net 
canelasoftware.com 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What have I done now ? (aka CR and LF confusion)

2020-05-28 Thread Mark Wieder via use-livecode

On 5/28/20 10:17 AM, Mark Talluto via use-livecode wrote:

I am a fan of moving Mac to default to LF. We use LF explicitly as our line 
ending of choice in all of our current software projects.
LF is useful if only to natively work with the expected line endings from 
Github and text files interchanged with Linux servers.


I agree, but have you tried adjusting your git core.autocrlf settings?

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What have I done now ? (aka CR and LF confusion)

2020-05-28 Thread Mark Talluto via use-livecode
I am a fan of moving Mac to default to LF. We use LF explicitly as our line 
ending of choice in all of our current software projects. 
LF is useful if only to natively work with the expected line endings from 
Github and text files interchanged with Linux servers. 


Best regards,

Mark Talluto
livecloud.io 
nursenotes.net 
canelasoftware.com 


> On May 28, 2020, at 9:14 AM, Brian Milby via use-livecode 
>  wrote:
> 
> Just changes CR to LF.  2 files updated.
> https://github.com/livecode/livecode/pull/7214/files
> 
> On Thu, May 28, 2020 at 12:10 PM Richard Gaskin via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Alex Tweedly wrote:
>> 
>>> Re. a PR to change it, it does seem it will run into concerns about
>>> backward compatability. Is it likely to succeed to propose a new
>>> URL-type - maybe "textfile".
>> 
>> What exactly does the PR do?
>> 
>> If it changes default Mac line endings from CR to LF, thumbs up.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What have I done now ? (aka CR and LF confusion)

2020-05-28 Thread Brian Milby via use-livecode
Just changes CR to LF.  2 files updated.
https://github.com/livecode/livecode/pull/7214/files

On Thu, May 28, 2020 at 12:10 PM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Alex Tweedly wrote:
>
>  > Re. a PR to change it, it does seem it will run into concerns about
>  > backward compatability. Is it likely to succeed to propose a new
>  > URL-type - maybe "textfile".
>
> What exactly does the PR do?
>
> If it changes default Mac line endings from CR to LF, thumbs up.
>
>
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What have I done now ? (aka CR and LF confusion)

2020-05-28 Thread Brian Milby via use-livecode
binfile is just short for binary file... it means that the file is written
exactly as presented.  If you use encode (UTF8/16 etc) then you need to use
it anyway.

The PR is a pretty much single constant update (changes CR to LF for Mac
line ending).

The backwards compatibility issue is a very minor edge case.  To be
impacted you need to export text from LiveCode which uses CR where a
non-LiveCode app/process consumes the data and requires the CR line
ending.  LiveCode file in/out will automatically convert, so there would be
no impact to a LiveCode generated application that uses file for in/out.

On Thu, May 28, 2020 at 11:21 AM Alex Tweedly via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thanks Brian, that was a very helpful and clear description. It's
> amazing that I've been an active Runrev/livecode for nearly 20 years and
> not been affected by this until now :-)
>
> Re. a PR to change it, it does seem it will run into concerns about
> backward compatability. Is it likely to succeed to propose a new
> URL-type - maybe "textfile".
>
> Then you could do
>
>put tData into URL "textfile:tiny.txt"   to get the sane behaviour
>
> but continue to do
>
>put tData into URL "file:tiny.txt"   to get the existing behaviour
>
> To me, it feels like a better self-documenting case - binfile vs
> textfile, rather than binfile vs file.
>
> Alex.
>
>
> On 28/05/2020 03:15, Brian Milby via use-livecode wrote:
> > You need to use binfile on Mac to get sane line endings.  I have a PR to
> fix, but doubt it will get merged.
> >
> > On Mac/Windows, file will convert line endings to what LC thinks is the
> native one for the OS.  CRLF for Windows and CR for Mac (the real CR, not
> the one that LC uses internally where CR and LF are synonyms for LF).  So
> on Linux you can use either file or binfile, on Windows you need to use
> file, and on Mac you need to use binfile to get the currently expected line
> endings.
> >
> > Thanks,
> > Brian
> > On May 27, 2020, 9:24 PM -0400, Alex Tweedly via use-livecode <
> use-livecode@lists.runrev.com>, wrote:
> >> I don't know if I've done something to my LC prefs, or to my Mac, or to
> >> myself :-)
> >>
> >> the following script
> >>
> >>> on mouseUp
> >>> local t
> >>> put "asd" & CR & "qwe" & CR & "zxc"  into t
> >>> put t into URL ("file:/Users/alextweedly/tiny.txt")
> >>> end mouseUp
> >> does create a file - but that file can't be (easily, properly) used by
> >> some other Mac apps, because all the end-of-line characters are 0x0d
> >> (i.e. numtochar(13)). So unix utilities like wc, cat, grep, more, ...
> >> won't deal with it properly - though emacs, Sublime, Coda2, etc. do ok.
> >>
> >> If I create the same file in an editor (emacs, Sublime Text, ...) they
> >> all produce e-o-l characters which are 0x0A (i.e. numtochar(10)), and
> >> this works in both editors and utilities mentioned above, as well as LC.
> >>
> >> Maybe it's always been like this ??
> >>
> >> I don't know - I just noticed because I tried to 'grep' for some
> >> characters in all files within a folder, and didn't find anything
> >> (though I should have done).
> >>
> >> SO I can get by - just avoid using any files created within LC with any
> >> other apps - but I'd rather find out if I should be doing something
> >> different, or if I've accidentally changed some setting that causes
> this.
> >>
> >> Thanks for any thoughts,
> >>
> >> Alex.
> >>
> >>
> >> ___
> >> use-livecode mailing list
> >> use-livecode@lists.runrev.com
> >> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What have I done now ? (aka CR and LF confusion)

2020-05-28 Thread Richard Gaskin via use-livecode

Alex Tweedly wrote:

> Re. a PR to change it, it does seem it will run into concerns about
> backward compatability. Is it likely to succeed to propose a new
> URL-type - maybe "textfile".

What exactly does the PR do?

If it changes default Mac line endings from CR to LF, thumbs up.

macOS is a certified Unix, and has been for more than 20 years.  LF is 
the OS-default line ending. Command-line tools expect LF, and the GUI 
apps I've explored this in accept both where they use CR at all.


So while I can understand a concern about backward compatibility, it 
seems this one really only applies to a relatively small subset of edge 
cases for those depending on the simpler non-binary syntax for a 
specific binary sequence.


The simpler non-binary syntax is there to make things, well, simple.

Those needing a specific binary sequence should expect to use the binary 
syntax, while everyone else can enjoy simple file I/O reliably.


Keep in mind that "everyone else" includes what we hope will be a much 
larger audience of future users than the sum of all users to date.  Why 
plan for no-growth?  And even among current users, as in this thread it 
seems most expect the default to use the OS'es current default, not 
something leftover from the '90s.


Am I missing something?

LC has a very strong and favorable history of maintaining backward 
compatibility, far beyond anything I've seen with any other language.


I wonder sometimes if we take it too far, if maybe the rest of the world 
isn't wrong in sometimes allowing for the inevitable changes that take 
place in OSes.


From time to time LC does deprecate and change things, and sometimes 
that means a little extra work for folks moving to a newer engine.  But 
given how rarely this happens, I don't think folks would mind another 
rare moment of change, esp. one that seems far more an improvement for 
most devs than a problem.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What have I done now ? (aka CR and LF confusion)

2020-05-28 Thread Alex Tweedly via use-livecode
Thanks Brian, that was a very helpful and clear description. It's 
amazing that I've been an active Runrev/livecode for nearly 20 years and 
not been affected by this until now :-)


Re. a PR to change it, it does seem it will run into concerns about 
backward compatability. Is it likely to succeed to propose a new 
URL-type - maybe "textfile".


Then you could do

  put tData into URL "textfile:tiny.txt"   to get the sane behaviour

but continue to do

  put tData into URL "file:tiny.txt"   to get the existing behaviour

To me, it feels like a better self-documenting case - binfile vs 
textfile, rather than binfile vs file.


Alex.


On 28/05/2020 03:15, Brian Milby via use-livecode wrote:

You need to use binfile on Mac to get sane line endings.  I have a PR to fix, 
but doubt it will get merged.

On Mac/Windows, file will convert line endings to what LC thinks is the native 
one for the OS.  CRLF for Windows and CR for Mac (the real CR, not the one that 
LC uses internally where CR and LF are synonyms for LF).  So on Linux you can 
use either file or binfile, on Windows you need to use file, and on Mac you 
need to use binfile to get the currently expected line endings.

Thanks,
Brian
On May 27, 2020, 9:24 PM -0400, Alex Tweedly via use-livecode 
, wrote:

I don't know if I've done something to my LC prefs, or to my Mac, or to
myself :-)

the following script


on mouseUp
    local t
    put "asd" & CR & "qwe" & CR & "zxc"  into t
    put t into URL ("file:/Users/alextweedly/tiny.txt")
end mouseUp

does create a file - but that file can't be (easily, properly) used by
some other Mac apps, because all the end-of-line characters are 0x0d
(i.e. numtochar(13)). So unix utilities like wc, cat, grep, more, ...
won't deal with it properly - though emacs, Sublime, Coda2, etc. do ok.

If I create the same file in an editor (emacs, Sublime Text, ...) they
all produce e-o-l characters which are 0x0A (i.e. numtochar(10)), and
this works in both editors and utilities mentioned above, as well as LC.

Maybe it's always been like this ??

I don't know - I just noticed because I tried to 'grep' for some
characters in all files within a folder, and didn't find anything
(though I should have done).

SO I can get by - just avoid using any files created within LC with any
other apps - but I'd rather find out if I should be doing something
different, or if I've accidentally changed some setting that causes this.

Thanks for any thoughts,

Alex.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What have I done now ? (aka CR and LF confusion)

2020-05-27 Thread Brian Milby via use-livecode
You need to use binfile on Mac to get sane line endings.  I have a PR to fix, 
but doubt it will get merged.

On Mac/Windows, file will convert line endings to what LC thinks is the native 
one for the OS.  CRLF for Windows and CR for Mac (the real CR, not the one that 
LC uses internally where CR and LF are synonyms for LF).  So on Linux you can 
use either file or binfile, on Windows you need to use file, and on Mac you 
need to use binfile to get the currently expected line endings.

Thanks,
Brian
On May 27, 2020, 9:24 PM -0400, Alex Tweedly via use-livecode 
, wrote:
> I don't know if I've done something to my LC prefs, or to my Mac, or to
> myself :-)
>
> the following script
>
> > on mouseUp
> >    local t
> >    put "asd" & CR & "qwe" & CR & "zxc"  into t
> >    put t into URL ("file:/Users/alextweedly/tiny.txt")
> > end mouseUp
> does create a file - but that file can't be (easily, properly) used by
> some other Mac apps, because all the end-of-line characters are 0x0d
> (i.e. numtochar(13)). So unix utilities like wc, cat, grep, more, ...
> won't deal with it properly - though emacs, Sublime, Coda2, etc. do ok.
>
> If I create the same file in an editor (emacs, Sublime Text, ...) they
> all produce e-o-l characters which are 0x0A (i.e. numtochar(10)), and
> this works in both editors and utilities mentioned above, as well as LC.
>
> Maybe it's always been like this ??
>
> I don't know - I just noticed because I tried to 'grep' for some
> characters in all files within a folder, and didn't find anything
> (though I should have done).
>
> SO I can get by - just avoid using any files created within LC with any
> other apps - but I'd rather find out if I should be doing something
> different, or if I've accidentally changed some setting that causes this.
>
> Thanks for any thoughts,
>
> Alex.
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


What have I done now ? (aka CR and LF confusion)

2020-05-27 Thread Alex Tweedly via use-livecode
I don't know if I've done something to my LC prefs, or to my Mac, or to 
myself :-)


the following script


on mouseUp
   local t
   put "asd" & CR & "qwe" & CR & "zxc"  into t
   put t into URL ("file:/Users/alextweedly/tiny.txt")
end mouseUp
does create a file - but that file can't be (easily, properly) used by 
some other Mac apps, because all the end-of-line characters are 0x0d 
(i.e. numtochar(13)). So unix utilities like wc, cat, grep, more, ... 
won't deal with it properly - though emacs, Sublime, Coda2, etc. do ok.


If I create the same file in an editor (emacs, Sublime Text, ...) they 
all produce e-o-l characters which are 0x0A (i.e. numtochar(10)), and 
this works in both editors and utilities mentioned above, as well as LC.


Maybe it's always been like this ??

I don't know - I just noticed because I tried to 'grep' for some 
characters in all files within a folder, and didn't find anything 
(though I should have done).


SO I can get by - just avoid using any files created within LC with any 
other apps - but I'd rather find out if I should be doing something 
different, or if I've accidentally changed some setting that causes this.


Thanks for any thoughts,

Alex.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode