Re: Anyone know how to update Leo's pypi index?

2017-10-19 Thread Edward K. Ream
On Thu, Oct 19, 2017 at 9:31 PM, Matt Wilkie  wrote:

Thanks for clarifying that it's chiefly the announcement you were after. If
> my next couple of sessions working with setup.py don't result in a recipe
> that any maintainer can follow with a minimum of fuss I'll go ahead and
> remove the PyPi entry.
>

​Sounds good.

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.


Re: Improved 'extract' command

2017-10-19 Thread Edward K. Ream
On Thu, Oct 19, 2017 at 9:37 AM, Edward K. Ream  wrote:

​I don't see an importer for clojurescript, but it probably would not be
> too difficult to create it.
>

​Presumably the clojure importer would be a slight modification of
plugins/importers/elisp.py.​

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.


Re: Anyone know how to update Leo's pypi index?

2017-10-19 Thread Matt Wilkie
You're welcome. I'm happy to contribute.

Yeah the process sucks rocks. I think it's worth persisting a bit longer;
`pip install thing` is the mainstream method and now that PyQt can be
installed with pip on py3+ the biggest roadblock to a complete `pip install
leo` has been dealt with.

Thanks for clarifying that it's chiefly the announcement you were after. If
my next couple of sessions working with setup.py don't result in a recipe
that any maintainer can follow with a minimum of fuss I'll go ahead and
remove the PyPi entry.


Matt

On Thu, Oct 19, 2017 at 7:52 AM, Edward K. Ream  wrote:

> On Fri, Oct 6, 2017 at 3:46 PM, Matt Wilkie  wrote:
>
> With the help of https://blog.ionelmc.ro/2014/05/25/python-packaging/ and
>> https://ep2015.europython.eu/conference/talks/less-known-pac
>> kaging-features-and-tricks I have managed to get a Leo wheel
>> distribution built and uploaded to Test PyPi. It installs and works on
>> Linux Mint[0] 18.2 and Windows 7 x64.
>>
>> Please test with
>>
>> pip install --index-url https://test.pypi.org/simple/ leo
>>
>> which should fetch "leo-5.6.post3" (I had to hardcode a test version
>> number because pypi doesn't allow re-use of same number)
>>
>> [0] On my linux box `leo` doesn't work from command line. I had to
>> specify full path `python ~/.local/lib/python2.7/site-pa
>> ckages/leo/scripts/lunchLeo.py`)
>>
>> Pushed to setup branch as 8616d58
>> 
>> .
>>
>
> ​First, many thanks for all this work.
>
> Having said that, I'm disgusted with the entire process.  All I want to do
> is to update the *announcement *at https://pypi.python.org/pypi/leo.  I
> see no reason to duplicate the work done in creating the distro at
> SourceForge.
>
> Unless the announcement can be updated easily, I would prefer to delete
> Leo's entry at pypi.python.org/pypi.
>
> 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.
>

-- 
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: Web help wanted: viewing Joe Orr's Leo view page locally

2017-10-19 Thread Edward K. Ream
On Thu, Oct 19, 2017 at 2:48 PM, Joe Orr  wrote:

> You can also get the newest versions from the project repo, run 'npm run
> build'
>

​This fails for me.  The contents of npm-debug.log is:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\PROGRA~1\\nodejs\\node.exe',
1 verbose cli   'C:\\PROGRA~1\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build' ]
2 info using npm@2.15.1
3 info using node@v4.4.4
4 verbose stack Error: ENOENT: no such file or directory, open
'c:\Web\leo-examples\package.json'
4 verbose stack at Error (native)
5 verbose cwd c:\Web\leo-examples
6 error Windows_NT 10.0.15063
7 error argv "C:\\PROGRA~1\\nodejs\\node.exe"
"C:\\PROGRA~1\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
8 error node v4.4.4
9 error npm  v2.15.1
10 error path c:\Web\leo-examples\package.json
11 error code ENOENT
12 error errno -4058
13 error syscall open
14 error enoent ENOENT: no such file or directory, open
'c:\Web\leo-examples\package.json'
14 error enoent This is most likely not a problem with npm itself
14 error enoent and is related to npm not being able to find a file.
15 verbose exit [ -4058, true ]

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.


Re: Web help wanted: viewing Joe Orr's Leo view page locally

2017-10-19 Thread Joe Orr
You can also get the newest versions from the project repo, run 'npm run 
build', they will be in dist folder. Will update readme soon.

BTW @john, you can load multiple leo files by putting a link to a leo file 
in the node title. The doc.leo file has an example of this, see also the 
Shakespeare file. 

Joe

On Thursday, October 19, 2017 at 2:19:00 PM UTC-4, Edward K. Ream wrote:
>
>
>
> On Thu, Oct 19, 2017 at 11:29 AM, Edward K. Ream  > wrote:
>
>> On Tuesday, October 10, 2017 at 9:53:18 AM UTC-5, john lunzer wrote:
>>>
>>> I want to thank you for this work Joe, this is really amazing and has 
>>> the potential how I use Leo to share information. I was able to download 
>>> all the files listed in index.html from the aws site and run the entire 
>>> thing locally without having to run a web server. 
>>>
>>
>> Could you provide a link for these files.  I just signed up for a free 
>> aws account, but don't see how to get the files.
>>
>
> ​Never mind.  Just entering the actual urls into the browser url tab 
> works, for example:
>
> leoviewer.s3.amazonaws.com/manifest.js
>
> That is, the contents of the desired file appears in the browser, and it's 
> then possible to save the file locally.
>
> 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.


Re: Web help wanted: viewing Joe Orr's Leo view page locally

2017-10-19 Thread Edward K. Ream
On Thu, Oct 19, 2017 at 11:29 AM, Edward K. Ream 
wrote:

> On Tuesday, October 10, 2017 at 9:53:18 AM UTC-5, john lunzer wrote:
>>
>> I want to thank you for this work Joe, this is really amazing and has the
>> potential how I use Leo to share information. I was able to download all
>> the files listed in index.html from the aws site and run the entire thing
>> locally without having to run a web server.
>>
>
> Could you provide a link for these files.  I just signed up for a free aws
> account, but don't see how to get the files.
>

​Never mind.  Just entering the actual urls into the browser url tab works,
for example:

leoviewer.s3.amazonaws.com/manifest.js

That is, the contents of the desired file appears in the browser, and it's
then possible to save the file locally.

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.


Re: Improved 'extract' command

2017-10-19 Thread Kent Tenney
one for each @file @auto @clean ...
one for @path
one for @button
one for @menu
one for 
...
...
one which says "so many features even Edward can't keep up"

On Thu, Oct 19, 2017 at 11:09 AM, Edward K. Ream 
wrote:

>
>
> On Thu, Oct 19, 2017 at 10:47 AM, vitalije  wrote:
>
>>
>>> ​Have you tried parse-body?  It uses Leo's importer code for the
>>> @language in effect, if one exists. See the node "ic.parse_body & helper".
>>> This should save you lots of work for the
>>>
>>
>> I wasn't aware of this command. I will definitely try it. It is just
>> another example how many cool things there are in Leo which even after 10+
>> years of using Leo one can easily miss.
>>
>
> ​Another way to the same thing is to use @auto the first time and then
> convert @auto to @file.​
>
>>
>> Having said that, one editor feature came in to my mind. One of the
>> editors that I used before (not sure which one), had this feature: to show
>> tips on usage on start-up. Every time it starts it would greet a user with
>> a window with something like: "Did you know that you can use ... to achieve
>> " along with link to the page in documentation explaining further this
>> feature. I remember discovering some very useful features that way. I
>> suppose it wouldn't be too complicated to make such feature in Leo, but
>> those short tips are to be written and collected first.
>>
>
> ​Good idea.  The first items on this list would be bookmarks.py and cff.
> Then maybe tab completion in the minibuffer.
>
> Any other candidates?
>
> 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.
>

-- 
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: Web help wanted: viewing Joe Orr's Leo view page locally

2017-10-19 Thread Edward K. Ream
On Tuesday, October 10, 2017 at 9:53:18 AM UTC-5, john lunzer wrote:
>
> I want to thank you for this work Joe, this is really amazing and has the 
> potential how I use Leo to share information. I was able to download all 
> the files listed in index.html from the aws site and run the entire thing 
> locally without having to run a web server. 
>

Could you provide a link for these files.  I just signed up for a free aws 
account, but don't see how to get the files.

Thanks,

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.


Re: Improved 'extract' command

2017-10-19 Thread Chris George
Abbreviations, including the ability to collect data via scripts.

Chris

On Thu, Oct 19, 2017 at 9:09 AM, Edward K. Ream  wrote:

>
>
> On Thu, Oct 19, 2017 at 10:47 AM, vitalije  wrote:
>
>>
>>> ​Have you tried parse-body?  It uses Leo's importer code for the
>>> @language in effect, if one exists. See the node "ic.parse_body & helper".
>>> This should save you lots of work for the
>>>
>>
>> I wasn't aware of this command. I will definitely try it. It is just
>> another example how many cool things there are in Leo which even after 10+
>> years of using Leo one can easily miss.
>>
>
> ​Another way to the same thing is to use @auto the first time and then
> convert @auto to @file.​
>
>>
>> Having said that, one editor feature came in to my mind. One of the
>> editors that I used before (not sure which one), had this feature: to show
>> tips on usage on start-up. Every time it starts it would greet a user with
>> a window with something like: "Did you know that you can use ... to achieve
>> " along with link to the page in documentation explaining further this
>> feature. I remember discovering some very useful features that way. I
>> suppose it wouldn't be too complicated to make such feature in Leo, but
>> those short tips are to be written and collected first.
>>
>
> ​Good idea.  The first items on this list would be bookmarks.py and cff.
> Then maybe tab completion in the minibuffer.
>
> Any other candidates?
>
> 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.
>

-- 
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: Improved 'extract' command

2017-10-19 Thread Edward K. Ream
On Thu, Oct 19, 2017 at 10:47 AM, vitalije  wrote:

>
>> ​Have you tried parse-body?  It uses Leo's importer code for the
>> @language in effect, if one exists. See the node "ic.parse_body & helper".
>> This should save you lots of work for the
>>
>
> I wasn't aware of this command. I will definitely try it. It is just
> another example how many cool things there are in Leo which even after 10+
> years of using Leo one can easily miss.
>

​Another way to the same thing is to use @auto the first time and then
convert @auto to @file.​

>
> Having said that, one editor feature came in to my mind. One of the
> editors that I used before (not sure which one), had this feature: to show
> tips on usage on start-up. Every time it starts it would greet a user with
> a window with something like: "Did you know that you can use ... to achieve
> " along with link to the page in documentation explaining further this
> feature. I remember discovering some very useful features that way. I
> suppose it wouldn't be too complicated to make such feature in Leo, but
> those short tips are to be written and collected first.
>

​Good idea.  The first items on this list would be bookmarks.py and cff.
Then maybe tab completion in the minibuffer.

Any other candidates?

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.


Re: Improved 'extract' command

2017-10-19 Thread vitalije

>
>
> ​Have you tried parse-body?  It uses Leo's importer code for the @language 
> in effect, if one exists. See the node "ic.parse_body & helper".  This 
> should save you lots of work for the 
>

I wasn't aware of this command. I will definitely try it. It is just 
another example how many cool things there are in Leo which even after 10+ 
years of using Leo one can easily miss.  

Having said that, one editor feature came in to my mind. One of the editors 
that I used before (not sure which one), had this feature: to show tips on 
usage on start-up. Every time it starts it would greet a user with a window 
with something like: "Did you know that you can use ... to achieve " 
along with link to the page in documentation explaining further this 
feature. I remember discovering some very useful features that way. I 
suppose it wouldn't be too complicated to make such feature in Leo, but 
those short tips are to be written and collected first.

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: @path exception

2017-10-19 Thread Edward K. Ream
On Thursday, September 28, 2017 at 9:59:18 AM UTC-5, Kent Tenney wrote:

rclick node @path /to/the/dir
> choose path=>active-path-set-path-to-absolute-path-recursive
>

I've just created #555  
for this.

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.


Re: Anyone know how to update Leo's pypi index?

2017-10-19 Thread Edward K. Ream
On Fri, Oct 6, 2017 at 3:46 PM, Matt Wilkie  wrote:

With the help of https://blog.ionelmc.ro/2014/05/25/python-packaging/ and
> https://ep2015.europython.eu/conference/talks/less-known-
> packaging-features-and-tricks I have managed to get a Leo wheel
> distribution built and uploaded to Test PyPi. It installs and works on
> Linux Mint[0] 18.2 and Windows 7 x64.
>
> Please test with
>
> pip install --index-url https://test.pypi.org/simple/ leo
>
> which should fetch "leo-5.6.post3" (I had to hardcode a test version
> number because pypi doesn't allow re-use of same number)
>
> [0] On my linux box `leo` doesn't work from command line. I had to specify
> full path `python ~/.local/lib/python2.7/site-
> packages/leo/scripts/lunchLeo.py`)
>
> Pushed to setup branch as 8616d58
> 
> .
>

​First, many thanks for all this work.

Having said that, I'm disgusted with the entire process.  All I want to do
is to update the *announcement *at https://pypi.python.org/pypi/leo.  I see
no reason to duplicate the work done in creating the distro at SourceForge.

Unless the announcement can be updated easily, I would prefer to delete
Leo's entry at pypi.python.org/pypi.

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.


Re: Improved 'extract' command

2017-10-19 Thread Edward K. Ream
On Thu, Oct 19, 2017 at 4:34 AM, vitalije  wrote:

> In rev:df3d88bb1, I have added one simple method to try each of selected
> lines in sequence. First line that matches will win. That will cover I
> believe most cases like nested definitions, python decorators and such.
> However, it will be broken if the last pattern matches always.
>
> The rev:df3d88bb1 will successfully extract the example code Terry has
> given.
>
​The code looks good to me.

Finally, the user can always changed the newly-created node by hand, using
>> all of her natural pattern-matching abilities ;-)
>>
> ​...​

>  It is more trouble than that. If extractDef doesn't find headline, it
> strips the first line from the selection and uses it as headline. In effect
> it deletes the first line of selected code and it can be frustrating for
> the user. If it however, finds a match even a wrong one, it will keep all
> selected lines intact and the only a headline can possibly be wrong.
>

​Ok.  I had forgotten that.​

> I don't know if anyone else was using this command very often. I know that
> I had written a private plugin whose sole purpose was to patch commander
> with the new definition of extractDef. It was long time ago before I got
> commit access to Leo repository, so it was the only way for me to change
> Leo code.
>
​...​

> When importing and analyzing code written in coffeescript, javascript or
> clojurescript, this command was tremendously helpful (in patched version)
> and totally useless in its original version. That made me wander if there
> is anyone else there who uses this command at all.
>

​I used to use this command.  Now I typically use parse-body.​

> Of course, it was designed to work with python definitions, but surely
> there are users who use Leo for writing code in other languages as well. My
> conclusion was that most probably those users haven't been using extract
> command at all. How else could it be possible that nobody ever complained
> about its shortcomings before?
>
​I can't answer that.  We have to rely on complaints, including our own.

> This is how I use the extract command when importing foreign code. Usually
> I open source file with the '@edit` node. It places the whole code in one
> large body. Then I try to find the largest blocks of code (classes, exports
> objects,...). Reading from the top of the file, whenever I find the
> beginning of a block (class definition, or very often comment line that
> announces a block of correlated classes/functions), I search for the
> beginning of next such block. When I find the next block (or the end of
> file if it is the last block), I select all lines from current position up
> to the beginning of the block and execute extract command (Ctrl+Shift+d).
>
​Have you tried parse-body?  It uses Leo's importer code for the @language
in effect, if one exists. See the node "ic.parse_body & helper".  This
should save you lots of work for the languages for which importers exist,
including coffeescript and javascript. I don't see an importer for
clojurescript, but it probably would not be too difficult to create it.

> That gives me a few nodes smaller than the original one. In each of them I
> look for smaller blocks like methods or functions and repeat the process
> with those blocks. I add '@others' where necessary in parent nodes. And so
> I repeat this process until I have chunked all code into small enough
> nodes. The alternative would be to use '@auto' import for a source file,
> but I was never truly satisfied with the results at least not for
> coffeescript, javascript and clojurescript files. That is why I find the
> extract command so useful to me. If you have never heard of extract command
> or you have tried it before and weren't satisfied with what it did, now is
> the time to give it a try.
>
​You can always rearrange nodes after doing parse-body, which you can't do
when using @auto, so parse-body plus manual tweaks is likely to save you
lots of work.

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.


Re: Improved 'extract' command

2017-10-19 Thread vitalije
 

In rev:df3d88bb1, I have added one simple method to try each of selected 
lines in sequence. First line that matches will win. That will cover I 
believe most cases like nested definitions, python decorators and such. 
However, it will be broken if the last pattern matches always.


The rev:df3d88bb1 will successfully extract the example code Terry has 
given.


I hope Edward, you won't consider this solution overly complicated :-)


What remains to be done, is writing some test cases to check and verify 
expected behavior of this command. 

If we bump later on some corner cases those cases should be added to these 
tests. 




> Finally, the user can always changed the newly-created node by hand, using 
> all of her natural pattern-matching abilities ;-)
>
> What do you think?
>
> Edward
>
 It is more trouble than that. If extractDef doesn't find headline, it 
strips the first line from the selection and uses it as headline. In effect 
it deletes the first line of selected code and it can be frustrating for 
the user. If it however, finds a match even a wrong one, it will keep all 
selected lines intact and the only a headline can possibly be wrong.


I don't know if anyone else was using this command very often. I know that 
I had written a private plugin whose sole purpose was to patch commander 
with the new definition of extractDef. It was long time ago before I got 
commit access to Leo repository, so it was the only way for me to change 
Leo code.


When importing and analyzing code written in coffeescript, javascript or 
clojurescript, this command was tremendously helpful (in patched version) 
and totally useless in its original version. That made me wander if there 
is anyone else there who uses this command at all. Of course, it was 
designed to work with python definitions, but surely there are users who 
use Leo for writing code in other languages as well. My conclusion was that 
most probably those users haven't been using extract command at all. How 
else could it be possible that nobody ever complained about its 
shortcomings before?


This is how I use the extract command when importing foreign code. Usually 
I open source file with the '@edit` node. It places the whole code in one 
large body. Then I try to find the largest blocks of code (classes, exports 
objects,...). Reading from the top of the file, whenever I find the 
beginning of a block (class definition, or very often comment line that 
announces a block of correlated classes/functions), I search for the 
beginning of next such block. When I find the next block (or the end of 
file if it is the last block), I select all lines from current position up 
to the beginning of the block and execute extract command (Ctrl+Shift+d). 
That gives me a few nodes smaller than the original one. In each of them I 
look for smaller blocks like methods or functions and repeat the process 
with those blocks. I add '@others' where necessary in parent nodes. And so 
I repeat this process until I have chunked all code into small enough 
nodes. The alternative would be to use '@auto' import for a source file, 
but I was never truly satisfied with the results at least not for 
coffeescript, javascript and clojurescript files. That is why I find the 
extract command so useful to me. If you have never heard of extract command 
or you have tried it before and weren't satisfied with what it did, now is 
the time to give it a try. 


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: Improved 'extract' command

2017-10-19 Thread Edward K. Ream
On Thu, Oct 19, 2017 at 2:02 AM, vitalije  wrote:

>
>
> On Friday, October 13, 2017 at 8:53:10 PM UTC+2, Terry Brown wrote:
>>
>> Hmm, some unforeseen challenges.
>>
>> I have slightly change algorithm for detecting headline in extractDef
> method. Now it checks the first line of selection and only if there is no
> match, checks the whole selection. As you have witnessed, in some languages
> like javascript and coffeescript there are often nested function
> definitions and it makes difficult to find the right headline. My solution
> is far from being complete, but I believe it reduces number of false
> positives.
>
> As I write this, I think the proper solution would be to find all matches
> and then to choose one with the lowest indentation. Presumably, it would be
> the most common thing to do, something that most users would expect, I
> imagine. Am I wrong in this assumption?
>

​Hmm. I am uneasy with complex solutions to this problem. They could easily
lead to confusion and unintended behavior.

The simplest thing that could possibly work would be to pick the first
identifier of the first line of the selection as the headline of the new
node, assuming no regex matched. This could be done by adding one last
default regex to extractDef, to be matched after all extractDef_patterns
patterns and all user patterns.

Finally, the user can always changed the newly-created node by hand, using
all of her natural pattern-matching abilities ;-)

What do you think?

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.


Re: Improved 'extract' command

2017-10-19 Thread vitalije


On Friday, October 13, 2017 at 8:53:10 PM UTC+2, Terry Brown wrote:
>
> Hmm, some unforeseen challenges. 
>
> I have slightly change algorithm for detecting headline in extractDef 
method. Now it checks the first line of selection and only if there is no 
match, checks the whole selection. As you have witnessed, in some languages 
like javascript and coffeescript there are often nested function 
definitions and it makes difficult to find the right headline. My solution 
is far from being complete, but I believe it reduces number of false 
positives.

As I write this, I think the proper solution would be to find all matches 
and then to choose one with the lowest indentation. Presumably, it would be 
the most common thing to do, something that most users would expect, I 
imagine. Am I wrong in this assumption?

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.