Re: New plugin line_numbering

2017-07-28 Thread vitalije
On Friday, July 28, 2017 at 2:29:28 AM UTC+2, zhaohe wang wrote:
>
> Could you explain the command *'toggle-line-numbering-root'* more info, I 
> can not understand it. Thanks!
>

If you are developing a script that is not part of any file. You may have 
break this script into many descendant nodes, but they all make one script 
rooted at the first node of your script. In such case it may be convenient 
to mark beginning of script as a start position for counting lines in its 
subtree. You can achieve this by selecting node where script begins and 
invoke the command '*toggle-line-numbering-root*'. Invoking it again clears 
that mark and its children would be counted as separate files. 

While developing script consisting of many nodes, if an exception was 
thrown Leo would report some line number where the exception was thrown. 
Using this plugin one can see where is that line, if start of script is 
marked with '*toggle-line-numbering-root*' command.

I hope that this explanation is more clear. 
Vitalije

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: ENB: What I learned from Vitalije's new read/write code

2017-07-28 Thread Edward K. Ream
On Mon, Jul 24, 2017 at 3:58 PM, vitalije  wrote:

> I've just pushed new version in snippets repository
> 
> .
> This file now contains dev nodes exp-7 and exp-8.
>

​Still haven't looked at this, but even on vacation I keep thinking of
reopening #366 . Sure,
we want to keep code compatibility, but worrying about unlikely uses of
v._bodyString may be overly cautious.  Would reopening #366 help you?

Edward

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


command to move between outlines but keep focus in Body - am I missing something?

2017-07-28 Thread jkn
I've just (!) realised that I am missing (ie. have need of) key bindings 
for moving up or down within the Headline tree, ** but keeping the focus in 
the Body **

Do the command for such movement exist? I can't see anything likely...

Would anyone else find these useful?

Thanks
Jon N

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: ENB: What I learned from Vitalije's new read/write code

2017-07-28 Thread vitalije

>
> compatibility, but worrying about unlikely uses of v._bodyString may be 
> overly cautious.  Would reopening #366 help you?
>

It can be implemented as one-way property. Assigning to lines maybe 
disabled or it may immediately assign to _bodyString. Reading lines will 
check if _bodyString has changed meanwhile just by comparing it with cached 
version, and return cached tuple if it is still valid. For example:
def _get_lines(self):
if self._old_bodyString == self._bodyString:
return self._lines
else:
self._old_bodyString = self._bodyString
self._lines = tuple(g.splitLines(self._bodyString))
return sefl._lines

lines = property(_get_lines)

It will merely make code more readable. It is not requirement for the new 
read/write/line_numbering code. That code uses its own caching to achieve 
the same effect, but it turned out that even without caching performance is 
good. Because new code makes only one pass through all nodes and lines and 
it makes little difference if lines were cached or not. 

But even without speed gains I would like to use v.lines for readability 
although vlines(p) is almost the same and function implementation of vlines 
is trivial even with caching. The only drawback is that it should be 
re-implemented in all scripts that use it.

Vitalije

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: command to move between outlines but keep focus in Body - am I missing something?

2017-07-28 Thread vitalije
I usually use Alt-arrows to start moving through nodes, and Return when I 
want to enter body focus again. I am not aware of any command that combines 
the two, but it is just one key stroke.

Vitalije

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: New plugin line_numbering

2017-07-28 Thread zhaohe wang
ok, thanks! It is clear enough!

在 2017年7月28日星期五 UTC+8下午5:42:44,vitalije写道:
>
> On Friday, July 28, 2017 at 2:29:28 AM UTC+2, zhaohe wang wrote:
>>
>> Could you explain the command *'toggle-line-numbering-root'* more info, 
>> I can not understand it. Thanks!
>>
>
> If you are developing a script that is not part of any file. You may have 
> break this script into many descendant nodes, but they all make one script 
> rooted at the first node of your script. In such case it may be convenient 
> to mark beginning of script as a start position for counting lines in its 
> subtree. You can achieve this by selecting node where script begins and 
> invoke the command '*toggle-line-numbering-root*'. Invoking it again 
> clears that mark and its children would be counted as separate files. 
>
> While developing script consisting of many nodes, if an exception was 
> thrown Leo would report some line number where the exception was thrown. 
> Using this plugin one can see where is that line, if start of script is 
> marked with '*toggle-line-numbering-root*' command.
>
> I hope that this explanation is more clear. 
> Vitalije
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: How does instant update work in Pharo?

2017-07-28 Thread Offray Vladimir Luna Cárdenas


On 26/07/17 07:59, Edward K. Ream wrote:
>
>
> On Sun, Jul 23, 2017 at 3:43 AM, Offray Vladimir Luna Cárdenas
> mailto:off...@riseup.net>> wrote:
>
> I would go trying to emulate the features of Leo files,
> particularly clones in the Grafoscopio world, so that would be
> like the opposite approach to reproduce "Leo" into Smalltalk by
> reproducing/migrating the storage, instead of reproduce Smalltalk
> into Leo by reproducing/migrating functionality.
>
> ​I think this a good strategy.  I will lead to healthy competition.
>

This will be more like complementarity that competition: Grafoscopio has
bring outlining and interactive documentation to the Pharo world and
will be looking to bring cloning, but is not trying to bring the amazing
text deconstructing capabilities of Leo to Pharo, that allow you to take
arbitrary existing text files and reorder them the way you like and
reconstruct them the way computer likes. I will leave that heavy and
well done work to Leo. I want to import though, the files with clones
that Leo produces, at some point maybe. But the important issue is to
implement the idea of clones, that are really helpful in an outlining
interactive writing environment.

Still a lot of things to do and learn from Leo and its community,
hopefully for several years.

Cheers,

Offray

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: New plugin line_numbering

2017-07-28 Thread zhaohe wang
Why dose linenumber start from 3 not 1 after run line-numbering-toggle?

在 2017年7月28日星期五 UTC+8上午8:29:28,zhaohe wang写道:
>
> Could you explain the command *'toggle-line-numbering-root'* more info, I 
> can not understand it. Thanks!
>
> 在 2017年7月28日星期五 UTC+8上午6:23:34,vitalije写道:
>>
>> Revision 7fe3217e 
>> 
>>  contains 
>> new plugn line_numbering.py.
>>
>> This plugin when used with setting '@bool use-gutter=True', will show 
>> real line numbers (as they are in external file) in gutter. The effect of 
>> this plugin can be temporarily turned off and on using new command 
>> 'line-numbering-toggle'. The plugin also allows to mark a node as fictive 
>> root for line numbering purposes using command 'toggle-line-numbering-root'.
>>
>> Vitalije
>>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: New plugin line_numbering

2017-07-28 Thread Edward K. Ream
On Fri, Jul 28, 2017 at 8:29 PM, zhaohe wang  wrote:

> Why dose linenumber start from 3 not 1 after run line-numbering-toggle?
>

​Probably because there are two hidden sentinel comment lines preceding the
first "visible" lines of the external file.

Edward

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.