Re: Retire @bool recent_files_group_always?

2019-06-12 Thread Edward K. Ream
On Wed, Jun 12, 2019 at 8:43 PM Rob  wrote:

> Yes, makes sense to me. Seems to work as expected now. Thanks for the fix!
>

You're welcome.  Thanks for the confirmation.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS1QSDEpC4Lo6w8k99d7-Oh%3DFDQYVQRJvHxScWD4Wduo-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Data-Forge Notebook 1.0 release may be of interest

2019-06-12 Thread Matt Wilkie
Cool! I hadn't thought of using Leo has a client.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/691a7feb-856e-49f8-ac90-408cfbec7fe4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using Sync with Leo on Win/MacOs

2019-06-12 Thread Matt Wilkie
Make all the paths relative to the .leo file (don't start with slash or 
drive letter), and use forward slashes. They work on Windows and 'nix 
(because python converts them automatically).

@path projects/Something

# works everywhere

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/a6ae057d-2747-4e81-b959-ec193f5dd017%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Data-Forge Notebook 1.0 release may be of interest

2019-06-12 Thread Chris George
As soon as I saw "edit in external editor" I had to export and load in Leo.

Joplin uses sentinels to keep track of all the snippets of md. 



id: 00e76bec2ebd416fb31e10a9921e0945

parent_id: abbb63233c614a8ba6262ae0eed79bd6

created_time: 2019-06-13T01:04:20.807Z

updated_time: 2019-06-13T01:04:20.807Z

is_conflict: 0

latitude: 0.

longitude: 0.

altitude: 0.

author: 

source_url: 

is_todo: 0

todo_due: 0

todo_completed: 0

source: joplin-desktop

source_application: net.cozic.joplin-desktop

application_data: 

order: 0

user_created_time: 2019-06-13T01:04:20.807Z

user_updated_time: 2019-06-13T01:04:20.807Z

encryption_cipher_text: 

encryption_applied: 0

type_: 1




When Leo imports them Leo gets the nesting right. Joplin uses md to denote 
its tree.

Chris

On Wednesday, June 12, 2019 at 4:30:11 PM UTC-7, Matt Wilkie wrote:
>
> Responding to "{thing} may be of interest" part of the topic, here's one 
> that's caught my eye recently: 
>
> *Joplin* (https://joplinapp.org/).
>
> *"a free, open source note taking and to-do application, which can handle 
> a large number of notes organised into notebooks. The notes are searchable, 
> can be copied, tagged and modified either from the applications directly or 
> from your own text editor. The notes are in Markdown format 
> . ... (images, attachments, etc.) and 
> complete metadata (geolocation, updated time, created time, etc.).  The 
> notes can be synchronised  with 
> various cloud services including Nextcloud , 
> Dropbox, OneDrive, WebDAV or the file system (for example with a network 
> directory). When synchronising the notes, notebooks, tags and other 
> metadata are saved to plain text files which can be easily inspected, 
> backed up and moved around. The application is available for Windows, 
> Linux, macOS, Android and iOS. A Web Clipper 
> , to 
> save web pages and screenshots from your browser, is also available for 
> Firefox 
>  and 
> Chrome 
> ."*
>
> New first run user experience is top notch. Setting up sync across devices 
> was smooth and relatively painless. The ease of pasting images and adding 
> attachments is very nice (note: images are automatically resized smaller). 
> This is an application to watch and learn from if not outright use.
>
> It doesn't have any concept of hierarchy or DAG. The only system-imposed 
> organization are Notebooks, which are named collection of pages.
>
> No further comments till I dive in further. Looks promising at this point.
>>
>
> Ditto! 
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ad988d3e-2d56-4417-b1c3-7c95b3df8756%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Retire @bool recent_files_group_always?

2019-06-12 Thread Rob
Yes, makes sense to me. Seems to work as expected now. Thanks for the fix!

Rob...
>
>
> At last I understand.  If I understand correctly, this means that #1188 
> can be closed.
>
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/11d269b8-e997-44ea-9c1d-b8d0c69484bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Data-Forge Notebook 1.0 release may be of interest

2019-06-12 Thread Matt Wilkie
Responding to "{thing} may be of interest" part of the topic, here's one 
that's caught my eye recently: 

*Joplin* (https://joplinapp.org/).

*"a free, open source note taking and to-do application, which can handle a 
large number of notes organised into notebooks. The notes are searchable, 
can be copied, tagged and modified either from the applications directly or 
from your own text editor. The notes are in Markdown format 
. ... (images, attachments, etc.) and 
complete metadata (geolocation, updated time, created time, etc.).  The 
notes can be synchronised  with 
various cloud services including Nextcloud , 
Dropbox, OneDrive, WebDAV or the file system (for example with a network 
directory). When synchronising the notes, notebooks, tags and other 
metadata are saved to plain text files which can be easily inspected, 
backed up and moved around. The application is available for Windows, 
Linux, macOS, Android and iOS. A Web Clipper 
, to 
save web pages and screenshots from your browser, is also available for 
Firefox 
 and 
Chrome 
."*

New first run user experience is top notch. Setting up sync across devices 
was smooth and relatively painless. The ease of pasting images and adding 
attachments is very nice (note: images are automatically resized smaller). 
This is an application to watch and learn from if not outright use.

It doesn't have any concept of hierarchy or DAG. The only system-imposed 
organization are Notebooks, which are named collection of pages.

No further comments till I dive in further. Looks promising at this point.
>

Ditto! 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/393f1448-cf03-4b81-bbc6-e41759cbd20f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Rev 2dd87c in devel: plugins use Qt docks when possible

2019-06-12 Thread Edward K. Ream
This completes #1154 . 
Please report any problems.

Only a straightforward change to LeoQtLog.createTab was needed.

Initially, quicksearch.py (The Nav pane) crashed.  The fix was to disable a 
legacy binding when g.app.dock is 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/e4ce7be8-7efb-4532-a7bc-f8de2ea8eee4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bookmarks plugin for docks

2019-06-12 Thread Edward K. Ream
On Wed, Jun 12, 2019 at 4:29 PM Edward K. Ream  wrote:

Thanks for this.  I'll add it to the list.
>

Heh.  bookmarks.py does not create any tab in the Log pane, so nothing
needs to be done.

> plugins probably use common code to add themselves to the (legacy) Log
> pane.  I'll just adapt that code to use docks.
>

To be more specific, I was talking about the Tab methods in the LeoQtLog
class in
leo/plugins/qt_frame.py.  Perhaps only LeoQtLog.createTab will need to
change.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2%3DxnmiSnvzUzoJneW09RnYbJ23VAAkKssfeb4e_nHGBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bookmarks plugin for docks

2019-06-12 Thread Edward K. Ream
On Wed, Jun 12, 2019 at 1:38 PM Terry Brown  wrote:

> Bookmarks isn't particularly entangled in the old UI, I had it working in
> my attempt at a docks based UI.
>
> I don't really see it as different from the other plugins listed in #1154
> , it has state
> persistence, but I don't think that's a GUI tied issue.
>

Thanks for this.  I'll add it to the list.  Actually, the list may not
matter much, because all the plugins probably use common code to add
themselves to the (legacy) Log pane.  I'll just adapt that code to use
docks.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS23ugTeUyQC6OHvyw06KJiRpFGzCA-Jy8B_r%2BqZtKLPBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Retire @bool recent_files_group_always?

2019-06-12 Thread Edward K. Ream
On Wed, Jun 12, 2019 at 3:02 PM Rob  wrote:

> I use the setting because I have a number of .leo files withe the same
> name, but different file paths. By grouping them, it reduces clutter and
> makes it easier to see which path version I'm opening.
>

At last I understand.  If I understand correctly, this means that #1188 can
be closed.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2zkz4gRe%2BXTBGO1G0cdove2kKKfeN7jO88dCV%3DCeAzxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Retire @bool recent_files_group_always?

2019-06-12 Thread Rob
I use the setting because I have a number of .leo files withe the same 
name, but different file paths. By grouping them, it reduces clutter and 
makes it easier to see which path version I'm opening.

HTH

It won't be the 'end of the world' to deprecate the option, but it is 
useful. Perhaps I'm the only one...

Rob...

On Wednesday, June 12, 2019 at 6:23:35 AM UTC-4, Edward K. Ream wrote:
>
> Rev 3afff37 fixes #1188 
>  by undoing a 
> change related to #1121 
> : unicode 
> characters in command names.
>
> This new fix is unlikely to cause problems.
>
> However, I don't see the purpose of setting @bool 
> recent_files_group_always to True.  It seems mostly to clutter the recent 
> files menu.  Can anyone explain why this setting is useful?
>
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/873cb5b8-c86b-4d15-ad04-986ccda07b51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bookmarks plugin for docks

2019-06-12 Thread Terry Brown
Bookmarks isn't particularly entangled in the old UI, I had it working in
my attempt at a docks based UI.

I don't really see it as different from the other plugins listed in #1154
, it has state
persistence, but I don't think that's a GUI tied issue.

That said, the old GUI worked by letting plugins register as things that
could provide a widget for the GUI to manage.  It also handled persistence
in that process.  In that context bookmarks.py would work equally well in a
new GUI that registers a list of things that can provide widgets to manage.
If the new model is for each plugin to understand the GUI and manage itself
within it, then there might be more work to be done.

Cheers -Terry


On Wed, Jun 12, 2019 at 11:06 AM Edward K. Ream  wrote:

>
>
> On Wed, Jun 12, 2019 at 8:31 AM lewis  wrote:
>
> I have found Leo's Bookmarks plugin a very useful tool. With the
>> introduction of docks it is no longer available unless you use the
>> --no-dock option, but then you lose dock features.
>> Is there any prospect of there being a compatible plugin enabling a
>> Bookmark panel to be inserted or merged into a dock?
>>
>
> bookmarks.py is a hard case. It's entangled with the old gui. It would
> need a rethink/rewrite for docks.
>
> The plugins listed in #1154
> should port to
> using docks without much fuss.  I'll likely to that before 6.0b1.
>
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/leo-editor/CAMF8tS3NK-gM3KqV-ZBN4XvLRcBNhrw_-oRnqvhrJvOJhD4anw%40mail.gmail.com
> 
> .
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAFPg46Q%2B8YvxRYQ%3DMkFdJr7aXaxVTOauQ2PJCuwM9RBh1MOcqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Leo 6.0b1 coming Friday, June 14

2019-06-12 Thread Edward K. Ream
On Monday, June 10, 2019 at 11:36:56 AM UTC-5, Edward K. Ream wrote:

> The remaining issues scheduled for 6.0 

 
need not delay 6.0b1. 

I may delay b1 for a few days. There is no need to rush.

Several people have reported "fit and finish" problems with the new code 
base. Keep up the good testing!

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/d84a271c-c680-464c-b2ad-05a1815b7a7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Retire @bool recent_files_group_always?

2019-06-12 Thread Edward K. Ream
On Wednesday, June 12, 2019 at 5:23:35 AM UTC-5, Edward K. Ream wrote:

However, I don't see the purpose of setting @bool recent_files_group_always 
> to True.  It seems mostly to clutter the recent files menu.  Can anyone 
> explain why this setting is useful?
>

I have a half memory that this was supposed to group recent files by 
folder. This might be useful, but the present code doesn't do that.  I'll 
make a note in #1188 .  
Eventually, I should either retire @bool recent_files_group_always or make 
it 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/d898a113-649a-4764-919f-67b1f2dd251c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bookmarks plugin for docks

2019-06-12 Thread Edward K. Ream
On Wed, Jun 12, 2019 at 8:31 AM lewis  wrote:

I have found Leo's Bookmarks plugin a very useful tool. With the
> introduction of docks it is no longer available unless you use the
> --no-dock option, but then you lose dock features.
> Is there any prospect of there being a compatible plugin enabling a
> Bookmark panel to be inserted or merged into a dock?
>

bookmarks.py is a hard case. It's entangled with the old gui. It would need
a rethink/rewrite for docks.

The plugins listed in #1154
should port to using
docks without much fuss.  I'll likely to that before 6.0b1.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS3NK-gM3KqV-ZBN4XvLRcBNhrw_-oRnqvhrJvOJhD4anw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ENB: another playful prototye

2019-06-12 Thread Edward K. Ream
On Wed, Jun 12, 2019 at 10:49 AM Edward K. Ream  wrote:

> On Wed, Jun 12, 2019 at 6:59 AM vitalije  wrote:
> On my machine in my version of LeoPy.leo this script finds about 3737
missing docstrings in 122.28ms.

Please feel free to add this script to scripts.leo.  Presumably you would
disable the timeit code.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2KB_jv26sEndZak0t0MeVi1-DYS56b_EnS1PLqtYZcbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ENB: another playful prototye

2019-06-12 Thread Edward K. Ream
On Wed, Jun 12, 2019 at 6:59 AM vitalije  wrote:

> I am not sure what were your intentions for find-missing-docstrings
> command.
>

It was mostly to play with live objects. Pylint's "missing-docstring" test
creates clickable links, so for actually adding docstrings pylint is the
best tool.  However, it was fun so see that a simple script discovers
missing docstrings in about 1/10 sec.

I assume you found out that it is impossible to use live objects in
> general, but useful for searching in Leo's own code.
>

Exactly.

Here is my script that searches Leo outline for methods and classes with
> missing docstrings:
>
> import timeit
> def has_docstring(lines, n):
> '''returns True if function/method/class whose definition
>starts on n-th line in lines has a docstring'''
> for line in lines[n:]:
> s = line.strip()
> if not s or s.startswith('#'): continue
> return s.startswith(('"', "'"))
>
> def is_a_definition(line):
> return line.startswith(('def ', 'class ')) and not line.partition('
> ')[2].startswith('__init__')
> # I guess it is useful to skip __init__ methods because their docstring
> # is usually docstring of the class
>
> def find_all_missing_docstrings():
> for p in c.all_positions():
> lines = p.b.split('\n')
> for i, line in enumerate(lines, start=1):
> if is_a_definition(line) and not has_docstring(lines, i):
> yield p, i
> def f():
> return list(find_all_missing_docstrings())
> def nlink(p, i):
> return "%s,%d"%(p.get_UNL(with_proto=True,
>   with_count=True,
>   with_index=True),i)
> c.frame.log.clearTab('Log')
> t1 = timeit.timeit(f, number=20)/20 * 1000
> g.es('finished in %.2fms'%t1)
> res =  f()
> g.es(len(res))
> p, i = res[3117]
> lines = p.b.split('\n')
> g.es(lines[i-1], nodeLink=nlink(p, i))
>
>
> On my machine in my version of LeoPy.leo this script finds about 3737
> missing docstrings in 122.28ms.
> The script will write to Log pane 3117-th occurrence with the clickable
> link. I guess it would take long to write all the occurrences in the Log
> pane, so I've chosen one random item.
>

Excellent!  I'll try it out.  It looks like it will find missing docstring
in any .leo 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2wCorOoSKRBsUa9yVTdXA%2BBXzh5HXrN-BSjv4R7Rq2Og%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ignoring a node without using sentinels

2019-06-12 Thread Edward K. Ream
On Wed, Jun 12, 2019 at 10:00 AM Josef  wrote:

> I mostly work with @clean these days, as that gives me the least grief
> when working with others, who do not use Leo.
> I often would like to ignore or at least comment out node including the
> subtree underneath, ideally by marking the node headline.
>

In python, you can do this:

if False:
  @others

This effectively ignores all child nodes.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS1vWTh2zAUrFfe7P3wpSnSFKyz0T6aOPgRko6yrSUVEdg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


ignoring a node without using sentinels

2019-06-12 Thread Josef
I mostly work with @clean these days, as that gives me the least grief when 
working with others, who do not use Leo.
I often would like to ignore or at least comment out node including the 
subtree underneath, ideally by marking the node headline.

So far I only found a way by commenting out the body text using @ and @c.
Unfortunately, that is not visible in the outline, and it would be much 
better if I could see in the outline that the node has been ignored (or 
commented out).

With @file I can use @ignore, but this does not work with @shadow, because 
the content of the node gets lost. An @ignore under @clean generates an 
error. So there seems to be no way to ignore a node, without using 
sentinels - or is there?

If commenting out (from the headline) would work, that would be an 
acceptable compromise.

- Josef

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/4b31726b-adf5-41fe-aee0-b61402585bd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Bookmarks plugin for docks

2019-06-12 Thread lewis
I have found Leo's Bookmarks plugin a very useful tool. With the 
introduction of docks it is no longer available unless you use the 
--no-dock option, but then you lose dock features.
Is there any prospect of there being a compatible plugin enabling a 
Bookmark panel to be inserted or merged into a dock?

Regards
Lewis

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/efe26a59-e291-4ac2-af2f-25d823e7a987%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ENB: another playful prototye

2019-06-12 Thread vitalije
I am not sure what were your intentions for find-missing-docstrings 
command. I assume you found out that it is impossible to use live objects 
in general, but useful for searching in Leo's own code.
Here is my script that searches Leo outline for methods and classes with 
missing docstrings:

import timeit
def has_docstring(lines, n):
'''returns True if function/method/class whose definition
   starts on n-th line in lines has a docstring'''
for line in lines[n:]:
s = line.strip()
if not s or s.startswith('#'): continue
return s.startswith(('"', "'"))

def is_a_definition(line):
return line.startswith(('def ', 'class ')) and not line.partition(' 
')[2].startswith('__init__')
# I guess it is useful to skip __init__ methods because their docstring
# is usually docstring of the class

def find_all_missing_docstrings():
for p in c.all_positions():
lines = p.b.split('\n')
for i, line in enumerate(lines, start=1):
if is_a_definition(line) and not has_docstring(lines, i):
yield p, i
def f():
return list(find_all_missing_docstrings())
def nlink(p, i):
return "%s,%d"%(p.get_UNL(with_proto=True,
  with_count=True,
  with_index=True),i)
c.frame.log.clearTab('Log')
t1 = timeit.timeit(f, number=20)/20 * 1000
g.es('finished in %.2fms'%t1)
res =  f()
g.es(len(res))
p, i = res[3117]
lines = p.b.split('\n')
g.es(lines[i-1], nodeLink=nlink(p, i))


On my machine in my version of LeoPy.leo this script finds about 3737 
missing docstrings in 122.28ms.
The script will write to Log pane 3117-th occurrence with the clickable 
link. I guess it would take long to write all the occurrences in the Log 
pane, so I've chosen one random item.

HTH Vitalije

On Tuesday, June 11, 2019 at 4:47:58 PM UTC+2, Edward K. Ream wrote:
>
> I spent most of this weekend working on the `script: report missing 
> docstrings in Leo itself` script in scripts.leo. You can open scripts.leo 
> with leo-sc.
>
> This was going to be the basis of a new find-missing-docstrings command.  
> That won't happen, as I'll now explain. This is an Engineering Notebook 
> post, full of geeky details.  Feel free to ignore.
>
> *g.getRepresentativeLiveObjects*
>
> This new function is the highlight of the prototype.  It's in devel, and 
> it's going to stay.  Here it is:
>
> def getRepresentativeLiveObjects():
> '''
> Return a dict. Keys classes.
> Values are the first (representative) live object for each type.
> '''
> d = {} # Keys are types, values are the *first* instance.
> for obj in gc.get_objects():
> t = type(obj)
> if t not in d and hasattr(obj, '__class__'):
> d [t] = obj
> return d
>
> This function is astoundingly fast.  g.get_objects returns *all* the live 
> objects in Leo.  Nevertheless, this function runs in about 1/20 sec on my 
> machine.  This was the happy surprise of the prototype.
>
> *The plan*
>
> I thought to myself.  Gee. It's really easy to get a representative live 
> object for any (instantiated) class in Leo.  Why not use that live object 
> to detect missing docstrings?  Well, the "report missing docstrings" script 
> does that. As shown in #1187 
> , its output is:
>
>  
>  7 missing docstrings in AbbrevCommandsClass
>   1 missing docstring  in AtButtonCallback
>  30 missing docstrings in AtFile
>  19 missing docstrings in AutoCompleterClass
>   2 missing docstrings in BindingInfo
>   6 missing docstrings in Bunch
>   2 missing docstrings in Chapter
>  10 missing docstrings in ChapterController
>   3 missing docstrings in CommanderCacher
>   2 missing docstrings in CommanderWrapper
> 113 missing docstrings in Commands
>   4 missing docstrings in ControlCommandsClass
>   3 missing docstrings in ConvertCommandsClass
>   3 missing docstrings in DebugCommandsClass
>   2 missing docstrings in DefaultDict
>   5 missing docstrings in DefaultWrapper
>  28 missing docstrings in DynamicWindow
>  39 missing docstrings in EditCommandsClass
>  11 missing docstrings in EditFileCommandsClass
>   7 missing docstrings in EvalController
>   3 missing docstrings in EventWrapper
>   3 missing docstrings in FastRead
>  39 missing docstrings in FileCommands
>   7 missing docstrings in FindTabManager
>   4 missing docstrings in FreeLayoutController
>   1 missing docstring  in GeneralSetting
>   1 missing docstring  in GetArg
>   1 missing docstring  in GlobalCacher
>   4 missing docstrings in GlobalConfigManager
>   1 missing docstring  in GoToCommands
>   6 missing docstrings in HelpCommandsClass
>  37 missing docstrings in JEditColorizer
>  49 missing docstrings in KeyHandlerClass
>   3 missing docstrings in KeyHandlerCommandsClass
>   9 missing docstrings in KeyStroke
>   6 missing docstrings in KillBufferCommandsClass
>   1 missing docstring  in KillBufferIterClass
>  13 missing docstrings 

Re: Data-Forge Notebook 1.0 release may be of interest

2019-06-12 Thread Edward K. Ream
On Tue, Jun 11, 2019 at 5:49 PM Paul  wrote:

> Data-Forge Notebook version 1.0 has been released
> http://www.data-forge-notebook.com/
>

Thanks for this link. I've bookmarked it. Let us know what you discover.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS3EcQXxOzmV%3DfMQMZPewd2gH0KOHSww6UVepjPZCgVu%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Retire @bool recent_files_group_always?

2019-06-12 Thread Edward K. Ream
Rev 3afff37 fixes #1188 
 by undoing a change 
related to #1121 : 
unicode characters in command names.

This new fix is unlikely to cause problems.

However, I don't see the purpose of setting @bool recent_files_group_always 
to True.  It seems mostly to clutter the recent files menu.  Can anyone 
explain why this setting is useful?

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/efc54dde-fe9c-47f5-8739-442144ab1826%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.