Re: A study outline containing eric6 docs

2018-02-24 Thread Zoom.Quiet
OT: JupyterLab Documentation — JupyterLab 1.0 Beta documentation
http://jupyterlab.readthedocs.io/en/latest/

Jupyter will make web page as IDE...


On Thu, Feb 22, 2018 at 8:56 PM, Edward K. Ream  wrote:
> Tonight I got eric6 installed on Ubuntu and wrote a do-nothing plugin for
> it.
>
> The attached .leo file contains is a rendering of this .pdf file. It's a lot
> easier for me to see what is going on in a Leo outline, though some of the
> figures are missing.
>
> 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.



-- 
life is pathetic, go Pythonic! 人生苦短, Python当歌!
俺: http://zoomquiet.io
授: http://creativecommons.org/licenses/by-sa/2.5/cn/
怒: 冗余不做,日子甭过!备份不做,十恶不赦!
KM keep growing environment culture which promoting organization learning!

-- 
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: Error starting Leo: 'NoneType' object has no attribute 'QObject'

2018-02-24 Thread Edward K. Ream
On Sat, Feb 24, 2018 at 12:32 PM, Chris George  wrote:

> I have learned how to avoid this problem.
>

​Thanks for these notes.  They illustrate the myriad installation problems
that can arise.​


​The general principle is, thankfully, quite simple: if Leo fails to start
there are problems with your installation, most likely with pyqt.

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: how to run a script when Leo starts

2018-02-24 Thread Edward K. Ream
On Sat, Feb 24, 2018 at 12:33 PM, Terry Brown  wrote:

> Imo, #740 Execute .leo/leo_startup.py on startup
> ​ ​
> is simpler and
> ​ ​
> safer.
>
> Sure, although the per outline specificity of @script nodes is useful.
> But unless we're going to remove @script nodes I don't think it's up to
> us to try any decide if a user can manage the risk safely or not, and
> whether they should know about the feature.


​Once again, I agree. @script will remain.​


I have just toned down the language in the first comment of
#741, Require confirmation for @script nodes



Realistically most Leo
> users will never receive a .leo file from someone else, so while the
> potential risk of @script is very high, most of the time the actual
> risk is quite low.
>

​Perhaps this is where we disagree. Somebody, don't remember who, created
an impressive system for scientific computing. It defined maybe a dozen
@button nodes. I can well imagine having him share his work.

Also, I have just updated the first comment of
#740: Execute .leo/leo_startup.py on startup

to say that there is a security risk if/when people start sharing Leo
startup scripts!

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.


Leo 5.7b2 on PyPi - please test

2018-02-24 Thread Matt Wilkie
 Hi Folks,

I've uploaded `leo-5.7b2.dev27` to PyPi.org. It installs successfully on
Win7x64 for Python 3.6 and Python 2.7. It should work on Win10 and Linux
also, can anyone confirm that? Run the command below from your desired
command shell:

End user install:

pip install leo

Developer install:

git clone --depth=50 https://github.com/leo-editor/leo-editor.git
pip install --editable .\leo-editor


Completely new bare bones Anaconda environment example:

conda create --name Leo-test-py36 --python=36
activate Leo-test-py36
conda install pip
conda install pyqt
pip install leo
leo-console --version
deactivate


conda create --name Leo-test-py27 --python=27
activate Leo-test-py27
conda install pip
conda install pyqt
pip install leo
leo-console --version
deactivate

Thanks!

matt

-- 
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: Shrinking pane contents

2018-02-24 Thread Chris George
I disabled the touchpad and use an external keyboard and mouse.

Of course this only came about after losing much work to unintended
touches of the trackpad by my hands.

And I am addicted to my Ducky keyboard.

Chris

On 2/24/18, Matt Wilkie  wrote:
> Sounds like a touch that is interpreted as gesture for "zoom out". You
> could try seeing if the touchpad control panel has setting for ignoring
> gestures, or a palm strike sensitivity setting.
>
> --
> 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: Improving the javascript importer

2018-02-24 Thread vitalije
Here is one of rust libraries for generating lexer/parser LALRPOP 


Here is rust library for writing shared library extensions for CPython 
rust-cpythton 

Here is a video  explaining how to 
write python extension in rust.


> ​I didn't know that :-)
> ​
>  
>

I am certain that I saw one rust library that implements a high performance 
parser for modern javascript, but I can't remember the name. It was bunch 
of related libraries. I remember vaguely that one of those libraries has 
"joker" in its name, but I am not sure of 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: ENB: Adding Leo to Atom

2018-02-24 Thread Matt Wilkie

>
> ENB <-- means ?
>

Engineering Note Book writing, meant to document the thought process behind 
something. They don't require a response from others (but contributions are 
still welcome)  and are usually a kind of "thinking out loud".

-- 
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: Error starting Leo: 'NoneType' object has no attribute 'QObject'

2018-02-24 Thread Matt Wilkie


> @Edward K Ream: I might suggest that (at least in the near term) some 
>> popular linux distros (including Debian) are shipping systems that contain 
>> both python v2 and python v3 and therefore this issue is probably going to 
>> crop up often for linux users. Subsequently, it might be worth noting this 
>> issue in the leo documentation dealing with installation?
>>
>
> ​That section is already too long and difficult.  Perhaps Matt can come up 
> with an automatic solution.
>

This must be a common problem, so there must be an idiomatic solution. I'll 
see what I can learn, but after fixing the pip install problems. It might 
be as simple as `#!/usr/bin/env python3` in the script header (but not that 
precisely because then py2 isn't used for the people who want that).

matt

-- 
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: Improving the javascript importer

2018-02-24 Thread Edward K. Ream
On Sat, Feb 24, 2018 at 9:49 AM, vitalije  wrote:

When rust language appeared on this forum, I've got interested in it
> especially when I learned that it is quite easy to make python extensions
> in rust.
>

​I didn't know that :-)
​


> Rust also allows pattern matching which is wonderful feature for writing
> parsers. There is a rust library that parses modern javascript. When I saw
> all these, I had an impulse to try it for Leo import when I got some time
> to experiment with this.
>
> There is also python module ply  for
> writing lexer/parser functions in pure python. AFAR this module was
> requiring latest Python3.6, but as I write this and check the previous
> link, it seems that they made ply compatible with both python2 and python3
> versions (which is good news for Leo if this module is to be used).
> I can try to:
>
>- write lexer/parser using ply in pure python
>- write python extension for using rust library for creating
>lexers/parsers
>
> Any of this will build AST of imported script. With AST at ones disposal,
> one can easily check all function definitions, object definitions, property
> definitions for their start line and end line. In case they contain more
> lines than some user preference this peace of code can be extracted into
> separate node, inserting @others if it is not already inserted. Also types
> of AST nodes can give very good suggestion for what the headline might be.
>
> Javascript is important language nowadays and it might be worth building
> lexer/parser for it. But it is open-ended project. Javascript syntax is
> permanently changing and even native javascript tools have a hard time to
> keep up.
>

​I agree with you that Leo would benefit from making this effort.
​


> On the other hand for the effective use of AST we still would need those
> text manipulating functions. It seems to me that these functions should be
> our first target, and then if they would not suffice, build lexer/parser
> that would generate AST  which can be used to automatically split the
> source file into nodes.
>

​Sounds reasonable.

Thanks for all these thoughtful comments.

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: Cleaning imported javascript headlines

2018-02-24 Thread Edward K. Ream
On Friday, February 23, 2018 at 11:35:42 AM UTC-6, Edward K. Ream wrote:

> Afaik, there are few if any problems with other languages.

Just for the record, there is a generic problem with all importers that has 
no real solution, namely constructs that look like section references.  
Recognizing such things isn't the problem.

Rather, the problem is how to alter the original code.  Any of Leo's 
importers will generate an @ignore directive for such files because the 
"missing" section reference will cause the perfect import checks to fail.  
It will then be up to the user to change the sources.  Imo, this is a 
reasonable approach.

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: Improving the javascript importer

2018-02-24 Thread vitalije

>
>
> Vitalije, are you thinking of a strict or lenient parser?
>
> EKR
>
I must say that I thought that the writing full lexer/parser for the jungle 
of current javascript dialects was out of question. It seemed to me way too 
much work for just a single language. That is why I did abandon this 
approach and proposed some kind of combination of human intelligence and 
dummy but fast computer text operations, so that user can very easily shape 
code the way he/she likes.

When rust language appeared on this forum, I've got interested in it 
especially when I learned that it is quite easy to make python extensions 
in rust. Rust also allows pattern matching which is wonderful feature for 
writing parsers. There is a rust library that parses modern javascript. 
When I saw all these, I had an impulse to try it for Leo import when I got 
some time to experiment with this.

There is also python module ply  for writing 
lexer/parser functions in pure python. AFAR this module was requiring 
latest Python3.6, but as I write this and check the previous link, it seems 
that they made ply compatible with both python2 and python3 versions (which 
is good news for Leo if this module is to be used).
I can try to:

   - write lexer/parser using ply in pure python
   - write python extension for using rust library for creating 
   lexers/parsers

Any of this will build AST of imported script. With AST at ones disposal, 
one can easily check all function definitions, object definitions, property 
definitions for their start line and end line. In case they contain more 
lines than some user preference this peace of code can be extracted into 
separate node, inserting @others if it is not already inserted. Also types 
of AST nodes can give very good suggestion for what the headline might be.

Javascript is important language nowadays and it might be worth building 
lexer/parser for it. But it is open-ended project. Javascript syntax is 
permanently changing and even native javascript tools have a hard time to 
keep up.

On the other hand for the effective use of AST we still would need those 
text manipulating functions. It seems to me that these functions should be 
our first target, and then if they would not suffice, build lexer/parser 
that would generate AST  which can be used to automatically split the 
source file into nodes.

Importers are extremely important for using Leo like an ordinary text 
editor. Suppose some user wants to try Leo and issues command leo 
somesource.js Leo would respond by opening new empty outline and importing 
the given source file. If it takes too much time (more than 500ms) it would 
make very poor impression on the user. In case the user is forgiving and 
willing to wait that long, at least what he/she sees after waiting must 
look good enough. Otherwise, most of the users would regret for even trying 
Leo.

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.


Improving the javascript importer

2018-02-24 Thread Edward K. Ream
Improving how the javascript importer assigns lines to nodes has a high 
priority.  Javascript is arguably the most important computer language in 
the world.

We both want the js importer to do as well as possible, especially with all 
common idioms, whatever they are ;-)

Suppose Vitalije devise a truly excellent js parser that knows (somehow!) 
how to split a js file into lines. Imo, we can prove the following theorem:

js_i.gen_lines and its helpers can implement any stand-alone parse of 
javascript.

At present, the guts of the js importer is just js_i.starts_block, a helper 
of the i.gen_lines in the *base *Importer class in 
importers/linescanner.py. The theorem implies that the js importer might 
have to override i.gen_lines, creating js_i.gen_lines and who knows what 
helpers.

The theorem is important because the base Importer class provides a lot of 
services. In particular, it handles tokenizing javascript. Tokenizing is 
fraught because recognizing regex expressions depends on context. A 
*prototype* js parser could ignore such things, 

*Summary*

Here is my proposed strategy:

1. Verify that a new parser does substantially better than the present 
code.  I trust that Vitalije can do this.

2. Do whatever is necessary to recast the algorithm in terms of the 
existing Importer organization. I'll know what this entails only when I see 
the new parser algorithm and its code.

Edward

P. S. A *strict parser* never split incoming lines into two (or more?) 
lines. A* lenient parser* may split incoming lines.  A strict parser will 
"just work" with Leo's existing Importer base class.  A lenient parser 
would probably require tweaks to the prefect import tests, but this is not 
a deal breaker.

Vitalije, are you thinking of a strict or lenient parser?

EKR

-- 
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 to run a script when Leo starts

2018-02-24 Thread Terry Brown
On Fri, 23 Feb 2018 11:15:42 -0800 (PST)
Phil  wrote:

> I want a script to run every time I start Leo. How can I do this?
> 
> Thanks,
> Phil

Although your question has prompted some clever new ideas, I wonder if
the answer is simpler than the response ;-)

You can set 

@bool scripting-at-script-nodes = True

The nodes labeled starting with "@script " will run on load.  Note the
docs. for that setting:

  True: dynamically executes script in @script nodes when a window is
  created.  DANGEROUS!

If they're your own scripts, they're only as dangerous if you make
them ;-), but of course it means loading a .leo file from an unknown or
maybe compromised source allows arbitrary code execution on your
computer.

So Kent's hash idea is very good, but for now you can already do this,
albeit needing to know the potential risk.

Cheers -Terry

-- 
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 expensive is p.setDirty and can it be cheaper

2018-02-24 Thread Edward K. Ream
On Sat, Feb 24, 2018 at 7:31 AM, vitalije  wrote:

It seems that p.setDirty propagates dirty status not only to the ancestors
> but also to the all descendant nodes as well, nodes that are roots of
> external files (v.isAnyAtFileNode()). At first I thought this was
> unnecessary, but then I realized this is probably to allow that change in
> the ancestor can change resulting path of the descendant file nodes which
> would require those nodes to be written on the next save operation.
>

​Yes.​


If this is the reason to propagate dirty status down the tree, then perhaps
> it can be skipped if this node doesn't contain at-path or any other
> directive that might cause need for writing descendant file nodes. That
> would be almost always the case.
>

​I have forgotten all details of the code and its motivations.​


Changing for example top level node "Code" in LeoPyRef.leo causes more than
> 160 files to be set dirty on the next save command, which seems to me wrong.
>

​As you say, it's probably safe not to set descendant nodes dirty if the
top node contains no directive that affect descendant @ nodes.  Since
"Code" contains only @language python, you would think all is well.

Alas, it's not enough to look at the present contents of a node.  One must
compare this with the previous contents, to ensure, say, that an @path
directive has not just been deleted.

​This will be tricky, but there might be a clever way to do it. My concern
is that the affected code will be far removed from p.setDirty and its
helpers.  I would much rather try to write 160 files, without effect, than
to get this wrong, now or in future.

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: how to run a script when Leo starts

2018-02-24 Thread Edward K. Ream

On Saturday, February 24, 2018 at 5:35:53 AM UTC-6, Edward K. Ream wrote:

Most other editors allow a script to be executed once on startup. I have 
> just created #740 Execute .leo/leo_startup.py on startup 
>  to schedule this 
> enhancement.
>

Following Kent's excellent suggestion, I have just created #741 Require 
confirmation for @script nodes 
.

For now, creating a plugin is probably best. Safety and security are worth 
some extra work. I'll be happy to answer any question you might have.

This would be a good example plugin. There are some interesting techniques 
involved.

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: How expensive is p.setDirty and can it be cheaper

2018-02-24 Thread vitalije
It seems that p.setDirty propagates dirty status not only to the ancestors 
but also to the all descendant nodes as well, nodes that are roots of 
external files (v.isAnyAtFileNode()). At first I thought this was 
unnecessary, but then I realized this is probably to allow that change in 
the ancestor can change resulting path of the descendant file nodes which 
would require those nodes to be written on the next save operation.

If this is the reason to propagate dirty status down the tree, then perhaps 
it can be skipped if this node doesn't contain at-path or any other 
directive that might cause need for writing descendant file nodes. That 
would be almost always the case.

Changing for example top level node "Code" in LeoPyRef.leo causes more than 
160 files to be set dirty on the next save command, which seems to me wrong.
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 expensive is p.setDirty and can it be cheaper

2018-02-24 Thread Edward K. Ream
On Sat, Feb 24, 2018 at 6:21 AM, vitalije  wrote:

Today I have looked in p.setDirty and I've found that it is overly
> complicated and as one might expect accordingly expensive.
>

​Have you considered clones?

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.


How expensive is p.setDirty and can it be cheaper

2018-02-24 Thread vitalije
Yesterday I worked on fixing issue #722 
 (replace-all can not 
be saved with crtl + s), I have found that culprit was inside replace-all 
command caused by avoiding to use p.setDirty() because of its cost, and 
using rather p.v.setDirty().

The difference between the two is that p.setDirty, traverses parents and 
calls setDirty on them also, while p.v.setDirty just sets dirty bit in p.v

At first, it seemed to me that really this propagation of setting dirty bit 
to all parents and grandparents must be too expensive to be used inside 
replace-all loop. That is why I wrote just one loop after replace-all is 
finished to set dirty flags to all nodes that are affected by replace-all 
command.

Today I have looked in p.setDirty and I've found that it is overly 
complicated and as one might expect accordingly expensive. I don't know if 
this method has other duties to perform, but if it is just setting dirty 
bit to all nodes that have in their subtree p.v, then it strikes me as odd 
that this method should be so expensive.

I have made small experiment script that counts how many nodes should be 
affected if any given vnode is setDirty, and shows maximum, and average 
value of this count for all vnodes in my copy of LeoPyRef.leo.

Maximum was 35, and average is 7.1. Now, flipping one bit in 35 nodes can't 
be that expensive. Here is a function that propagates dirty flag to all 
ancestors in the outline of given vnode.
def mkDirty(v):
v.setDirty()
for v1 in v.parents:
mkDirty(v1)

Measuring this function on the node with most ancestor nodes   
UNL:(#Notes-->@file ../doc/leoNotes.txt-->Test code: do not delete-->Unused 
unit tests-->@ignore mini tests-->Other tests-->Printing tests...-->Print 
iterations: do not delete-->b-->c-->c2-->c3), using timeit module gives the 
following results:

calls[n=10]  avg:0.033ms

What would be the consequences of replacing Position.setDirty method with 
the above function? Does that method have some other responsibilities that 
I am not aware of? Perhaps those responsibilities can be divided in several 
methods and this one responsibility delegated to new method (for example: 
propagateDirty)?

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 to run a script when Leo starts

2018-02-24 Thread Edward K. Ream
On Fri, Feb 23, 2018 at 1:15 PM, Phil  wrote:

> I want a script to run every time I start Leo. How can I do this?
>

​There are several ways:

1. *Clumsy*: Create a plugin that runs at startup, that is, at 'start1' or
'start2' time.  See this page
.​

2. *Dangerous*: Set @bool scripting-at-script-nodes = True. You can then
put an @script node in your .leo files.

This is a serious security issue.  It will enable @script nodes in *all*
your .leo files. For this reason, @bool scripting-at-script-nodes can only
be set to True in your myLeoSettings.leo file.

Most other editors allow a script to be executed once on startup. I have
just created #740 Execute .leo/leo_startup.py on startup
 to schedule this
enhancement.

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.