@clean cr/lf problem

57 views
Skip to first unread message

_spt_

unread,
Jul 14, 2015, 8:57:48 AM7/14/15
to leo-e...@googlegroups.com
Hello,

I'm new to Leo, and it looks like the perfect tool for me.

I want to create a file from my nodes, with CR and LF, the text file will contain Forth code which will be spooled into an emulator. The CR are wanted because it trigger the input buffer in the emulator that a line of forth has been
'typed' and the return key has been hit.

my node starts with @clean  forth_test.txt with @lineending cr / lf @language forth @others in the node body.
more nodes in the tree have the code. If you know forth then its a node for each forth word.

The Problem ,
when the forth_test.txt is created is creates there are no CR's

Can some tell me what I'm doing wrong with a setting?

many thanks,


 
 

Jacob Peck

unread,
Jul 14, 2015, 9:04:12 AM7/14/15
to leo-e...@googlegroups.com
Hi _spt_,

The proper setting is:

@lineending crlf

Not

@lineending cr / lf

I just tested this with @clean and have a file that has CRLF line endings:

$ file forth-test.txt
forth-test.txt: ASCII text, with CRLF line terminators

Hope this helps,
-->Jake


_spt_

unread,
Jul 14, 2015, 11:34:38 AM7/14/15
to leo-e...@googlegroups.com
 Thanks Jake,

But that does not seem to works for me.


_spt_


 

Edward K. Ream

unread,
Jul 15, 2015, 10:30:56 AM7/15/15
to leo-editor
On Tue, Jul 14, 2015 at 10:34 AM, _spt_ <s...@parry-thomas.co.uk> wrote:
 Thanks Jake,

But that does not seem to works for me.

​Rev a7e2e86 should fix the problem. 
Let me know if other problems remain.

EKR

_spt_

unread,
Jul 15, 2015, 11:15:57 AM7/15/15
to leo-e...@googlegroups.com
Thanks Edward,
But Rev a7e2e86 is the same problem for me.

Could this be a windows 7 issue? I will get leo up on my linux mint box later this evening.

I could be me, being new missing something

If I use my leo nodes as @rst3 this creates the text file with CRLF - no issue
 
_spt_

john lunzer

unread,
Jul 15, 2015, 11:27:21 AM7/15/15
to leo-e...@googlegroups.com
Might be worth attaching a sample leo file that exhibits the problem. It might help Edward narrow down the issue.

Edward K. Ream

unread,
Jul 15, 2015, 11:52:32 AM7/15/15
to leo-editor
On Wed, Jul 15, 2015 at 10:15 AM, _spt_ <s...@parry-thomas.co.uk> wrote:
Thanks Edward,
But Rev a7e2e86 is the same problem for me.

Could this be a windows 7 issue? I will get leo up on my linux mint box later this evening.

​The code works for me on both Windows & Ubuntu, and on Python 2 and 3.

Edward

_spt_

unread,
Jul 15, 2015, 12:13:52 PM7/15/15
to leo-e...@googlegroups.com

ok must be me (; or my code/settings.

In the IRC channel there's a link to my file if anyone would to look at them.

thanks.

Jacob Peck

unread,
Jul 15, 2015, 1:02:42 PM7/15/15
to leo-e...@googlegroups.com
Replied in IRC, but I'll post it here for clarity and 'the recordbooks':

'@lineending crlf' is a directive, not a @setting -- directives go into node bodies.

In your clean-strings.leo example, you had @lineending crlf in an @settings tree within your @clean file.  That is not going to work. 

In your rst-strings example, you had it as a directive in the top-level @rst node -- this is how it needs to be.  No wonder your rst example was working, but your clean example wasn't!

So, basically, to get the behavior you're looking for out of @clean, you need the following in your @clean node:

@language forth
@lineendings crlf
@others

And... nothing else.  :)

Hope this clarifies some things.
-->Jake
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

_spt_

unread,
Jul 15, 2015, 2:15:38 PM7/15/15
to leo-e...@googlegroups.com

ok, here we go again!

two screen shots, spt_leo_ss1  shows one node a forth word, spt_leo_ss2 shows the @lang,@lineending crlf and @others.
 you can see the leo log with the error. the resulting forth_test.txt is not written.  Yet if i do @@lineending crlf the file will write but
with no CR's.


spt_leo_ss1.png
spt_leo_ss2.png

Jacob Peck

unread,
Jul 15, 2015, 2:19:26 PM7/15/15
to leo-e...@googlegroups.com
That is most certainly a python 3 bug.  Once that's fixed, @lineendings crlf should work for you.

Edward?

-->Jake

Edward K. Ream

unread,
Jul 15, 2015, 3:35:16 PM7/15/15
to leo-editor
On Wed, Jul 15, 2015 at 1:19 PM, Jacob Peck <gates...@gmail.com> wrote:
That is most certainly a python 3 bug.  Once that's fixed, @lineendings crlf should work for you.

​That was fixed today at rev a7e2e86.

EKR

Jacob Peck

unread,
Jul 15, 2015, 3:49:39 PM7/15/15
to leo-e...@googlegroups.com
According to the screenshot, he's running a7e2e86.  In IRC, he reported his python version as 3.4.3.
-->Jake

_spt_

unread,
Jul 16, 2015, 1:38:28 PM7/16/15
to leo-e...@googlegroups.com

thank you for the fix.

Leo version  5.1-final, build 20150715093248, Wed Jul 15 09:32:48 CDT 2015

creates the @clean files with crlf when @lineending crlf is used.

many thanks for everyone's help.



Edward K. Ream

unread,
Jul 16, 2015, 1:39:45 PM7/16/15
to leo-editor
On Thu, Jul 16, 2015 at 12:38 PM, _spt_ <s...@parry-thomas.co.uk> wrote:

thank you for the fix.

​You're welcome.  Glad everything is working.

EKR
Reply all
Reply to author
Forward
0 new messages