Re: Attributes vs. Relationships

2016-02-17 Thread 'Terry Brown' via leo-editor

From: Edward K. Ream 
 To: leo-editor  
 Sent: Wednesday, February 17, 2016 8:31 AM
 Subject: Re: Attributes vs. Relationships
   

​​[snip]


I would like to see a general user interface that would associate icons with 
attributes/predicate/relation. That way the user can see all the nodes with a 
given attribute. Stay tuned.

Edward

I think the easiest way to get that done might be the (unfortunately named) 
"tree declutter patterns" 
D:\local\leo-editor\leo\config\leoSettings.leo#@settings-->Tree 
operation-->@bool tree-declutter = False
D:\local\leo-editor\leo\config\leoSettings.leo#@settings-->Tree 
operation-->@data tree-declutter-patterns

docs. in the latter node.  Currently they add icons (and otherwise fiddle with 
appearance) based on regex matches of headline text, seems like it would be 
straight forward to add matches to uA content as well. Of course I don't really 
know to what uA content, seems that would be user use case dependent.  Although 
the presence of tags from Jacob's tagging plugin would be an obvious target. 
The could also add icons for ToDo status, but the todo.py plugin already does 
that.
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: Attributes vs. Relationships

2016-02-16 Thread 'Terry Brown' via leo-editor
On Tue, 16 Feb 2016 20:32:03 -0800 (PST)
Largo84 <larg...@gmail.com> wrote:

> Maybe a stupid question, but where do I find the plugin? It doesn't
> load from the standard GitHub repo.

They're in the standard repo. - let me check the names...

backlink.py
graphcanvas.py

from my settings @enabled-plugins, superseding any other spellings I
may have offered.

Not sure about Python 3 compatibility though...

Cheers -Terry

> Rob...
> 
> 
> On Tuesday, February 16, 2016 at 6:04:54 PM UTC-5, Terry Brown wrote:
> >
> > Hmm, well, at risk of sounding like a broken record, you could use
> > the backlinks plugin, the attached image shows A and B in their
> > "native" or "outline" relationship (or lack thereof) in the tree,
> > then in backlinks (middle pane) with a link via a node
> > "blocking_dependency" which is a rich relationship description with
> > "severity" and "description" components, and in the bottom pane in
> > graphcanvas plugin, which uses backlinks for its relationships
> > (they're two interfaces to the same info.). Sorry about the colors,
> > but the white arrow is the parent->child relationship of Nodes Y
> > and B, and the black arrows run through the "blocking_dependency"
> > relationship node as described.
> >
> > You could use the same approach in place of clones for gathering
> > nodes relevant to a particular bug or something, just link all the
> > nodes of interest to one otherwise unrelated "issue" node, which
> > perhaps resides in a list of such issues.  I'd tend to use
> > bookmarks plugin instead, although I'm realizing how much
> > redundancy there is between backlinks and bookmarks... hmm, they're
> > not really the same, phew ;-)
> >
> > I'm not sure how tractable the API is for using backlinks in
> > scripts, there's some support I think, and of course more can be
> > added if there's demand.
> >
> > Cheers -Terry
> >
> > --
> > *From:* Largo84 <lar...@gmail.com >
> > *To:* leo-editor <leo-e...@googlegroups.com > 
> > *Cc:* terry_...@yahoo.com 
> > *Sent:* Tuesday, February 16, 2016 3:36 PM
> > *Subject:* Re: Attributes vs. Relationships
> >
> > Yes, Terry, that's a good description of what I envision. Is that
> > possible now? If so, I don't see the mechanism. How (where) would
> > you create that link?
> >
> > Rob.
> >
> > On Tuesday, February 16, 2016 at 4:25:13 PM UTC-5, Terry Brown
> > wrote:
> >
> > Something I think you run into here is nodes vs. edges
> > (connections) carrying information.  So two nodes are related:
> >
> > A -> B
> >
> > now you want to describe the relationship, "implements" (the
> > "source order" view) or "documents" or "todo_item" (issue /
> > ticket), whatever.
> >
> > Ok, so somehow you store those different flavors of relationship.
> > But now maybe you want to record priority, percent complete etc. on
> > the "todo_item" relation, or build documentation for different
> > contexts into the "documents" relationship.  Suddenly describing a
> > relationship needs a complex data structure..., maybe some
> > hierarchy... 
> >
> > So you end up in a situation where you could effectively use a node
> > to describe the relationship:
> >
> > A -> x -> B
> >
> > where if x is a node with its own children etc., there's no
> > restriction on how complex the description of the relationship
> > between A and B can be.
> >
> > And maybe you also have
> >
> > M -> x -> N and S -> x -> T where the relationships between A and
> > B, M and N, and S and T are all the same and described by the same
> > node 'x', so 'x' is a collecting point for nodes related in a
> > particular way.
> >
> > So Rob I'm not disagreeing with you or even perhaps responding to
> > what you're saying directly, just saying that I've seen "adding
> > descriptive elements to connections / edges / relationships" evolve
> > into "using nodes to describe connections" in the past.
> >
> > Cheers -Terry
> >
> >
> > --
> > *From:* Largo84 <lar...@gmail.com>
> > *To:* leo-editor <leo-e...@googlegroups.com> 
> > *Sent:* Tuesday, February 16, 2016 2:35 PM
> > *Subject:* Attributes vs. Relationships
> >
> > I'm following with much interest the recent discussio

Re: Attributes vs. Relationships

2016-02-16 Thread 'Terry Brown' via leo-editor
Hmm, well, at risk of sounding like a broken record, you could use the 
backlinks plugin, the attached image shows A and B in their "native" or 
"outline" relationship (or lack thereof) in the tree, then in backlinks (middle 
pane) with a link via a node "blocking_dependency" which is a rich relationship 
description with "severity" and "description" components, and in the bottom 
pane in graphcanvas plugin, which uses backlinks for its relationships (they're 
two interfaces to the same info.). Sorry about the colors, but the white arrow 
is the parent->child relationship of Nodes Y and B, and the black arrows run 
through the "blocking_dependency" relationship node as described.
You could use the same approach in place of clones for gathering nodes relevant 
to a particular bug or something, just link all the nodes of interest to one 
otherwise unrelated "issue" node, which perhaps resides in a list of such 
issues.  I'd tend to use bookmarks plugin instead, although I'm realizing how 
much redundancy there is between backlinks and bookmarks... hmm, they're not 
really the same, phew ;-)
I'm not sure how tractable the API is for using backlinks in scripts, there's 
some support I think, and of course more can be added if there's demand.
Cheers -Terry
 
  From: Largo84 <larg...@gmail.com>
 To: leo-editor <leo-editor@googlegroups.com> 
Cc: terry_n_br...@yahoo.com
 Sent: Tuesday, February 16, 2016 3:36 PM
 Subject: Re: Attributes vs. Relationships
   
Yes, Terry, that's a good description of what I envision. Is that possible now? 
If so, I don't see the mechanism. How (where) would you create that link?
Rob.

On Tuesday, February 16, 2016 at 4:25:13 PM UTC-5, Terry Brown wrote:
Something I think you run into here is nodes vs. edges (connections) carrying 
information.  So two nodes are related:
    A -> B
now you want to describe the relationship, "implements" (the "source order" 
view) or "documents" or "todo_item" (issue / ticket), whatever.
Ok, so somehow you store those different flavors of relationship. But now maybe 
you want to record priority, percent complete etc. on the "todo_item" relation, 
or build documentation for different contexts into the "documents" 
relationship.  Suddenly describing a relationship needs a complex data 
structure..., maybe some hierarchy... 
So you end up in a situation where you could effectively use a node to describe 
the relationship:
A -> x -> B
where if x is a node with its own children etc., there's no restriction on how 
complex the description of the relationship between A and B can be.
And maybe you also have
M -> x -> N and S -> x -> T where the relationships between A and B, M and N, 
and S and T are all the same and described by the same node 'x', so 'x' is a 
collecting point for nodes related in a particular way.
So Rob I'm not disagreeing with you or even perhaps responding to what you're 
saying directly, just saying that I've seen "adding descriptive elements to 
connections / edges / relationships" evolve into "using nodes to describe 
connections" in the past.
Cheers -Terry

 
  From: Largo84 <lar...@gmail.com>
 To: leo-editor <leo-e...@googlegroups.com> 
 Sent: Tuesday, February 16, 2016 2:35 PM
 Subject: Attributes vs. Relationships
  
I'm following with much interest the recent discussions on data structures and 
possible new directions for Leo. Sorry in advance if this new post hashes old 
ground, but it seemed to be somewhat of a different approach (or question).
It would be really cool to better expose the uA's and make them truly useful. 
However, I see them as merely metadata (like tags in media files). What would 
also be useful is to describe in some meaningful way the nature of a data 
relationship between elements (objects or 'nodes' in the Leo sense). Looking at 
the wikipedia article on DAGs, I see the directed vectors (arrows), but don't 
see how those describe what the 'nature' of the relationship is between 
objects, just a direction (of course, I may be missing something obvious).
As an example, consider how MusicBrainz describes advanced relationships (ARs). 
A music track (like on a CD) may have a relationship with a composition (work) 
and that relationship is described in a somewhat 'symmetrical' way, such that 
the given work is 'related' to multiple recordings and the track may be related 
to multiple compositions (eg. medleys). These relationship 'descriptors' are 
directional which prevents recursion problems.
It seems to me that the only relationship inherent in the Leo data model is one 
of Parent/Child (and maybe Sibling). I suppose that's what makes it a DAG. Is 
it possible to describe other arbitrary types of relationships between objects 
(nodes) that goes beyond simply assigning a uA (tag) to a node. 

Re: Attributes vs. Relationships

2016-02-16 Thread 'Terry Brown' via leo-editor
Something I think you run into here is nodes vs. edges (connections) carrying 
information.  So two nodes are related:
    A -> B
now you want to describe the relationship, "implements" (the "source order" 
view) or "documents" or "todo_item" (issue / ticket), whatever.
Ok, so somehow you store those different flavors of relationship. But now maybe 
you want to record priority, percent complete etc. on the "todo_item" relation, 
or build documentation for different contexts into the "documents" 
relationship.  Suddenly describing a relationship needs a complex data 
structure..., maybe some hierarchy... 
So you end up in a situation where you could effectively use a node to describe 
the relationship:
A -> x -> B
where if x is a node with its own children etc., there's no restriction on how 
complex the description of the relationship between A and B can be.
And maybe you also have
M -> x -> N and S -> x -> T where the relationships between A and B, M and N, 
and S and T are all the same and described by the same node 'x', so 'x' is a 
collecting point for nodes related in a particular way.
So Rob I'm not disagreeing with you or even perhaps responding to what you're 
saying directly, just saying that I've seen "adding descriptive elements to 
connections / edges / relationships" evolve into "using nodes to describe 
connections" in the past.
Cheers -Terry

 
  From: Largo84 
 To: leo-editor  
 Sent: Tuesday, February 16, 2016 2:35 PM
 Subject: Attributes vs. Relationships
   
I'm following with much interest the recent discussions on data structures and 
possible new directions for Leo. Sorry in advance if this new post hashes old 
ground, but it seemed to be somewhat of a different approach (or question).
It would be really cool to better expose the uA's and make them truly useful. 
However, I see them as merely metadata (like tags in media files). What would 
also be useful is to describe in some meaningful way the nature of a data 
relationship between elements (objects or 'nodes' in the Leo sense). Looking at 
the wikipedia article on DAGs, I see the directed vectors (arrows), but don't 
see how those describe what the 'nature' of the relationship is between 
objects, just a direction (of course, I may be missing something obvious).
As an example, consider how MusicBrainz describes advanced relationships (ARs). 
A music track (like on a CD) may have a relationship with a composition (work) 
and that relationship is described in a somewhat 'symmetrical' way, such that 
the given work is 'related' to multiple recordings and the track may be related 
to multiple compositions (eg. medleys). These relationship 'descriptors' are 
directional which prevents recursion problems.
It seems to me that the only relationship inherent in the Leo data model is one 
of Parent/Child (and maybe Sibling). I suppose that's what makes it a DAG. Is 
it possible to describe other arbitrary types of relationships between objects 
(nodes) that goes beyond simply assigning a uA (tag) to a node. Maybe that uA 
may also be a relationship 'type' that creates a 'link' between two or more 
nodes. Maybe this also creates opportunities to create multiple 'views' based 
on relationship types other than the native Parent/Child.
Rob..-- 
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: Use case for clones/views/attributes

2016-02-16 Thread 'Terry Brown' via leo-editor
Attached is an example of what that looks like, with links made by hand. Base 
has links to two subclasses, each of which has a link back to base, and the foo 
method in each subclass is linked back to the foo method in Base, which has 
links back to the two replacement versions.  Also attached is the outline 
itself, so you can move around it with the backlinks plugin.  Couple of known 
bugs:
 - on initial load the links pane is not updated, needs fixing - when a linked 
node is copy / pasted (e.g. to create a second subclass) the pasted   node has 
links to the same nodes the original had, but those nodes don't have links   
back to the pasted node.  This gets fixed by clicking backlink's rescan button 
or a   save / load cycle.  Could be handled with a hook if it was a major 
problem.
Cheers -Terry


 
  From: 'Terry Brown' via leo-editor <leo-editor@googlegroups.com>
 To: "leo-editor@googlegroups.com" <leo-editor@googlegroups.com> 
 Sent: Tuesday, February 16, 2016 12:01 PM
 Subject: Re: Use case for clones/views/attributes
   
One approach would be to use the backlinks plugin machinery - wouldn't be that 
hard to parse an outline to automatically create links from subclass to parent 
class, and inherited / overwritten methods.
Cheers -Terry
 
  From: john lunzer <lun...@gmail.com>
 To: leo-editor <leo-editor@googlegroups.com> 
 Sent: Tuesday, February 16, 2016 9:59 AM
 Subject: Use case for clones/views/attributes
  
I want to view a class's "full" definition including all the methods from its 
parent class in a unified format. I think this could be done using clones as it 
would involve putting nodes from different parents in the same sub-tree, but 
seems like it would be a big effort to get there. I'm wondering if it can be 
done and if it can't it might be a potential use case for views and threads.-- 
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.


   

-- 
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.


parentage.leo
Description: Binary data


Re: Use case for clones/views/attributes

2016-02-16 Thread 'Terry Brown' via leo-editor
One approach would be to use the backlinks plugin machinery - wouldn't be that 
hard to parse an outline to automatically create links from subclass to parent 
class, and inherited / overwritten methods.
Cheers -Terry
 
  From: john lunzer 
 To: leo-editor  
 Sent: Tuesday, February 16, 2016 9:59 AM
 Subject: Use case for clones/views/attributes
   
I want to view a class's "full" definition including all the methods from its 
parent class in a unified format. I think this could be done using clones as it 
would involve putting nodes from different parents in the same sub-tree, but 
seems like it would be a big effort to get there. I'm wondering if it can be 
done and if it can't it might be a potential use case for views and threads.-- 
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: How do I add a child node to comment parrent in @clean?

2016-02-12 Thread 'Terry Brown' via leo-editor
Probably only because it just came up in another thread, it occurs to me that 
you could use the backlinks plugin for this.  I.e. the answer to your question 
is no, there isn't really a way to do that directly, but backlinks would allow 
links from nodes in you @clean code tree to nodes somewhere else with the 
comments.  The backlink UI tab (in the "log" or "tab" pane) would display the 
headline of the comment node, and clicking on it would take you to the node, 
much like having a child node. You might want to use the free_layout pane 
customization system to give backlinks its own pane, so it's not hidden each 
time the log tab pops to front in the tab pane.
Cheers -Terry
 
  From: Propadovic Nenad 
 To: leo-editor  
 Sent: Friday, February 12, 2016 8:02 AM
 Subject: How do I add a child node to comment parrent in @clean?
   
Hello everybody,
lets say I want to create a @clean (Python) file and I want to attach comments 
to some nodes. 
I imagine those comments being child nodes of nodes to be generated. 
But I don't want the the nodes containing comments to be part of the created 
external file.
I'd assume this to work similar like 
http://leoeditor.com/tutorial-rst3.html#rst-ignore-rst-ignore-tree-ignore-text, 
but for @clean.
I tried @ignore and found it's deprecated for @lean files.
I tried, naively, to add comments to orphan nodes. You know the result.
So how do I do this correctly? Is there a way?
Thanx in advance,
Nenad
-- 
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: Leo reimagined: a tree/dag/view for every attribute!!!

2016-02-12 Thread 'Terry Brown' via leo-editor


 
  From: Jacob Peck <gatesph...@gmail.com>
 To: leo-editor@googlegroups.com 
 Sent: Friday, February 12, 2016 8:40 AM
 Subject: Re: Leo reimagined: a tree/dag/view for every attribute!!!
   
Hi Edward,


 
 Fascinating stuff.  I'm unclear on one thing though -- what you mean by 
'attribute'.  Is this just some arbitrary, user-definable key that would act as 
a name for a particular view/colored-thread?

My take after Edward's last comment, is there's *one* new attribute, 
'view_mode' or whatever, and a different set of connections between nodes for 
each *value* of that attribute. Values might be "base_tree", "scroll_bug", 
"todo", etc. depending on what you're trying to focus on.
Cheers -Terry


 UI would be of paramount importance in this scheme -- there's lots of places 
visually and conceptually such a powerful idea could go terribly wrong.  If you 
hide all the information that isn't immediately relevant (i.e., show only the 
black-thread DAG with no visual indication that there are other threads 
available) then you can lose a coherent view of the whole document.  If instead 
you show all the info at all times, you will overload the user, and as a result 
turn even more people off of Leo at first blush.  A happy medium would be one 
active attribute, with small visual hints that others exist, with some set of 
convenient key-bindings to switch between them, list them, etc.  I imagine a 
combobox much like the Chapter control would help with this immensely.
 
 One thing that comes to mind as being potentially tricky -- how does saving 
external files work?  Would the save command create all valid files for all 
valid attributes/views, or would it save only the current view?  What if there 
are collisions -- i.e. multiple views creating the same file with different 
contents -- which attribute would take priority?
 
 I thought of a potential use case, if scripts were allowed to be created in 
one view but called from another: the 'exec(g.findTestScript())' trick wouldn't 
be required to include shared code nodes any more -- simply create a new view 
for each script pulling in the nodes you need.  In fact, this paradigm could 
extend to full projects, if flexible enough!  The ultimate in write-once coding.
 
 I'm genuinely intrigued by this new development.  Exciting times indeed.
 
 -->Jake
 
 On 2/12/2016 6:49 AM, Edward K. Ream wrote:
  
  ​​On Thu, Feb 11, 2016 at 6:20 PM, 'Terry Brown' via leo-editor 
<leo-editor@googlegroups.com> wrote:
 
  
 Might be worth a look at the backlinks plug-in, which provides a mechanism and 
gui for superimposing a general graph on the tree. Graphcanvas plug-in is just 
another gui for the same mechanism.
  
 
 ​As I said in the original posting, the new scheme won't be used as a general 
graph.​  
 
 > Not ​ entirely sure I follow the 'attribute' part vs nodes,
 
 ​At the implementation level, v.parents and v.children ​get swapped in and out 
depending on which attribute is in effect for the display of the outline. The 
drawing code stays the same! It doesn't know about the switcheroo.
   
 ​> ​ Also long ago I did demo navigation of a cyclic graph using a tree, not 
sure if that's relevant. 
 
 ​I think that's something different, because the new idea gives, in effect, a 
set of layers (one per attribute). Each layer contains Leo's existing tree 
structure.
 
 > ​ Also recalling the sea of nodes idea that's surfaced periodically.
 
 ​Thanks for reminding me of this!​ Iirc, this was B. H.'s (LeoUser's) 
suggestion. At the time he made it, I had no idea what it meant. But the Aha 
makes it perfectly clear.  Yes, the "black" threading could be called a 
preferred view, but it's just as valid to think of each node as being 
completely independent of all other nodes. Each node is an island in the sea. 
Each node can participate in arbitrarily many threadings/ trees.
  
 ​> ​ Interesting direction, for sure. 
 
 ​To repeat what I said to Kent, the question I am presently asking myself is 
what my work flow would be in the new scheme.  In some sense, I need a 
prototype, but I think pencil and paper will suffice.  In fact, I am 
considering what keystrokes/commands I would use as an alternative to Ctrl-` 
(clone), etc.  No conclusions yet. I won't do anything until I am sure that the 
new scheme actually simplifies Leo for all users, including me.
 
  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.

Re: Leo reimagined: a tree/dag/view for every attribute!!!

2016-02-11 Thread 'Terry Brown' via leo-editor
Sounds very interesting. Might be worth a look at the backlinks plug-in, which 
provides a mechanism and gui for superimposing a general graph on the tree. 
Graphcanvas plug-in is just another gui for the same mechanism. 

Bit entirely sure I follow the 'attribute' part vs nodes, and of course 
something more integral to Leo's core would be a lot more powerful than the 
backlinks overlay. 

Also long ago I did demo navigation of a cyclic graph using a tree, not sure if 
that's relevant. Also recalling the sea of nodes idea that's surfaced 
periodically. 

Interesting direction, for sure. 
Cheers -Terry

On February 11, 2016 5:12:19 PM CST, "Edward K. Ream"  
wrote:
>John Lunzer's recent remarks has triggered one of the biggest Aha's in 
>Leo's history, one that was totally unexpected until this afternoon.
>
>Leo's fundamental data structure is a tree of nodes.  More accurately,
>it 
>is a Directed Acyclic Graph or dag.  Links in such a graph can point
>"down" 
>the tree, but never up, so there are no cycles.  Leo's clones are well 
>defined just exactly because there are no cycles.  Given a node, we
>know 
>precisely *and* intuitively which nodes are descendants. Because of
>clones, 
>a node may have more than one parent.
>
>Here's the Aha.  Imagine this data structure as being linked with
>*black* 
>thread.  Now imagine another *completely independent* set of *red* 
>threads.  The only requirement is that the links defined by the red
>threads 
>must *also* be a tree/dag. That is, there is *absolutely no* necessary 
>relationship between the red and black threads.
>
>Now imagine that every Leo attribute creates its *own* sets of 
>links/threads.  *We have a new view for every attribute.* Let's call
>such a 
>data structure a *multi-threaded tree/dag*. Trees might actually be
>enough, 
>but I'm not sure so I'll refer to tree/dag (tree or dag). *Important*:
>some 
>nodes may not have any thread running them for some colored threads 
>(attributes).  That's just fine.
>
>Alas, the term "multi-threaded data structure" is commonly used for
>data 
>structures that can be accessed by independently running threads.
>That's 
>not at all what I am talking about.
>
>I am not aware of anything like this in graph theory. Could this be a
>truly 
>new idea?  I really have no idea.
>
>Of course, you could call the resulting structure a general graph, and 
>technically it is, but how the data structure will be used inside Leo
>is *very 
>*different. Instead of a single, unintuitive mess, we have a collection
>of 
>easily traversed trees/dags. *We instantly have an arbitrary
>dimensioned 
>graph*! Each color creates a new dimension.  Of course, we only *see*
>one 
>dimension at a time, but attributes may be the *composition* of other 
>attributes (unions, intersections or other relations), so this is no
>real 
>restriction.
>
>And listen to this.  *It is astoundingly easy to create this multi-dag
>in 
>Leo*.  At present, each vnode has a parents list and a children list. 
>All 
>we have to do is replace these two lists by dictionaries whose keys are
>
>attributes and whose values are the parents or children lists for those
>
>attributes.  Finally, we add Python properties shield the dictionary
>lookup 
>from the rest of Leo.  We are talking about maybe 50 lines of code! As
>far 
>as the rest of Leo is concerned, vnodes *still* have parents and
>children 
>lists.  The switcheroo happens totally invisibly, when the user wants
>to 
>see another view.  The attribute changes and that changes what the
>vnode 
>dictionary/properties "deliver" to the rest of Leo. 
>
>To recap: What we see depends only on the attribute that defines the
>view.  
>This attribute determines what parents and children lists become
>active.  
>So easy.  So very powerful.
>
>Each *current view* will show only the nodes with the given attribute.
>To 
>repeat, attributes can be composed of other attributes, so in effect
>each 
>view can be associated with an *arbitrary set* of attributes.  This is
>an 
>*astoundingly* general data structure.
>
>The real challenge lies in assigning different colored links to nodes.
>I'm 
>still trying to wrap my thoughts around all of this.
>
>As always with truly huge Ahas, it's already impossible to know exactly
>
>what thoughts lead to it.  As soon as the Aha happened, the world
>changed 
>so much that the past becomes hard to reconstruct.  But for sure the 
>following factors were "in the air":
>
>1. Most importantly, the consensus has been building among the usual 
>suspects that attributes are a more intuitive, and perhaps more
>powerful, 
>alternative to clones.
>
>2. For the last year I have been trying to ignore the fact that
>sometimes 
>clones get in the way.  This was the meaning of today's remark that "I
>love 
>clones, I hate clones".
>
>3. John's remark about attributes and hoists certainly triggered the 
>avalanche.
>
>*Notice*: multi-threaded tree/dags collapse a lot of behind-the scenes 

Re: Leo reimagined: a tree/dag/view for every attribute!!!

2016-02-11 Thread 'Terry Brown' via leo-editor


On February 11, 2016 6:20:52 PM CST, 'Terry Brown' via leo-editor 
<leo-editor@googlegroups.com> wrote:

>Bit entirely sure I follow the 'attribute' part vs nodes, and of course

*Not* entirely, phone email autocomplete :-/

-- 
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: strange diff on LeoPyRef.leo

2016-02-10 Thread 'Terry Brown' via leo-editor


 
  From: Zoltan Benedek 
 To: leo-editor  
 Sent: Wednesday, February 10, 2016 3:01 PM
 Subject: strange diff on LeoPyRef.leo
   
Hi,
Can someone explain to me, how could happen this?I only opened LeoPyRef.leo in 
Leo and saved it (Ctrl + S). No changes at all, but got a surprising diff:

Not sure I can explain it exactly, but maybe something to do with clones and / 
or references to other files, I've seen that sort of thing happen occasionally, 
perhaps there's still a file or two (.txt files) referenced from more than one 
.leo file, or clones of bits of such files within a .leo file, and it seems to 
take another load / save cycle for the changes to propagate.  Not a good 
explanation, just a general idea.

The way to avoid it, and the easiest way to interact with LeoPyRef.leo, is to 
copy it to LeoPy.leo and open and use that instead, then it isn't an issue with 
git. You only need to actually load / edit / save LeoPyRef.leo when you're 
adding a new file to the codebase that needs to be referenced from 
LeoPyRef.leo, which does not happen very often.
Cheers -Terry


diff --git a/leo/core/LeoPyRef.leo b/leo/core/LeoPyRef.leoindex 
8601387..258bb9c 100644--- a/leo/core/LeoPyRef.leo+++ b/leo/core/LeoPyRef.leo@@ 
-1621,8 +1621,8 @@ unl: class Ui_LeoQuickSearchWidget-->retranslateUi  # -*- mode: python 
-*- '''-launchLeo.spec: the spec file for pyinstaller.-Run with pyinstaller 
launchLeo.spec, **not** with launchLeo.py.+launchLeo-single.spec: a spec file 
for pyinstaller that creates a single-executable version of Leo.+Run with 
pyinstaller launchLeo-single.spec, **not** with launchLeo.py. ''' import glob, 
os @@ -1641,7 +1641,7 @@ else:     # Same code as in runLeo.py.     path = 
os.getcwd()     if path not in sys.path:-        print('launchLeo.spec: 
appending %s to sys.path' % path)+        print('launchLeo-single.spec: 
appending %s to sys.path' % path)         sys.path.append(path)      import 
leo.core.leoGlobals as g@@ -1717,13 +1717,16 @@ datas = [ if True:     
datas.extend([         # leo-editor: loaded by LeoPy.leo...-            
('launchLeo.spec', ''),+           ('launchLeo-folder.spec', ''),+            
('launchLeo-single.spec', ''),             ('pylint-leo.py', ''),             
('setup.py', ''),     # leo.commands...             ext('.py', 'leo/commands'), 
        # leo.core...-            ext('.leo', 'leo/core'),+       # Only 
include reference files.+                # ext('.leo', 'leo/core'),+            
   ('leo/core/LeoPyRef.leo', 'leo/core'),             ext('.py', 'leo/core'),   
          ext('.txt', 'leo/core'),         # leo.dist...@@ -1762,7 +1765,10 @@ 
if True:             ext('.json', 'leo/external/ckeditor'),             
ext('.md', 'leo/external/ckeditor'),         # leo/plugins...-            
ext('.leo', 'leo/plugins'),+            # Only include reference files.+        
    # ext('.leo', 'leo/plugins'),+               
('leo/plugins/leoPluginsRef.leo', 'leo/plugins'),+               
('leo/plugins/leoGuiPluginsRef.leo', 'leo/plugins'),         ext('.txt', 
'leo/plugins'),             ext('.py', 'leo/plugins/examples'),             
ext('.py', 'leo/plugins/test'),@@ -1819,6 +1825,10 @@ if generate_folder:       
  name='Leo')  # -*- mode: python 
-*-+'''+launchLeo-folder.spec: a spec file for pyinstaller that creates a 
folder-based install of Leo.+Run with pyinstaller launchLeo-folder.spec, 
**not** with launchLeo.py.+'''  block_cipher = None @@ -1894,16 +1904,16 @@ 
datas = [     # Additional Leo data fles...     # leo-editor: loaded by 
LeoPy.leo...         ('launchLeo-folder.spec', ''),-       
('launchLeo-single.spec', ''),-       ('leo_to_html.xsl', ''),-       
('pylint-leo.py', ''),+        ('launchLeo-single.spec', ''),+        
('leo_to_html.xsl', ''),+        ('pylint-leo.py', ''),         ('setup.py', 
''),         # leo.commands...             ext('.py', 'leo/commands'),         
# leo.core...-           # Only include reference files.+            # Only 
include reference files.                 # ext('.leo', 'leo/core'),-            
   ('leo/core/LeoPyRef.leo', 'leo/core'),+                
('leo/core/LeoPyRef.leo', 'leo/core'),             ext('.py', 'leo/core'),      
       ext('.txt', 'leo/core'),         # leo.dist...@@ -1942,10 +1952,10 @@ 
datas = [             ext('.json', 'leo/external/ckeditor'),             
ext('.md', 'leo/external/ckeditor'),         # leo/plugins...-           # Only 
include reference files.+            # Only include reference files.            
 # ext('.leo', 'leo/plugins'),-               ('leo/plugins/leoPluginsRef.leo', 
'leo/plugins'),-               ('leo/plugins/leoGuiPluginsRef.leo', 
'leo/plugins'),+                ('leo/plugins/leoPluginsRef.leo', 
'leo/plugins'),+                ('leo/plugins/leoGuiPluginsRef.leo', 
'leo/plugins'),             ext('.txt', 'leo/plugins'),             ext('.py', 
'leo/plugins/examples'),             ext('.py', 

Re: how to share @command functionality between nodes?

2016-02-08 Thread 'Terry Brown' via leo-editor
On Mon, 8 Feb 2016 06:07:33 -0800 (PST)
john lunzer  wrote:

> I'm a little confused by your request and perhaps Jacob answered it
> but I feel like I heard a much simpler question.
> 
> You can use the @others directive in the body of you @command node.
> This is the same as what you would do in an @ node.

I think there are two different ideas here:

@command("command_a")
   command_a preamble
   @others
   first part of command_a
   second part of command_a
   first subpart of second part of command_a
   second subpart of second part of command_a

so a single command, with structure organized in a tree, vs.

common_setup
some common code
@command("command_b")
eval(g.findTestScript(c,'common_setup'))
command_b stuff
@command("command_c")
eval(g.findTestScript(c,'common_setup'))
command_c stuff

i.e. two commands sharing code.

that said, can't imagine how a single command could have 70 child
nodes, so maybe I'm not understanding what you were up to John.

Cheers -Terry terry_n_br...@yahoo.com

> I have abused this horribly to my own ends to write a complex
> refactoring plugin as an @command that has over 70 child nodes. I did
> this before I fully understood plugins. 
> 
> On Friday, February 5, 2016 at 4:20:23 PM UTC-5, jkn wrote:
> >
> > I'm getting around to writing some useful @command scripts today,
> > and I wondered about what is probably a faq:
> >
> > does the whole body of an @command script have to live within a
> > single node? I have several commands which have common
> > functionality, and I want to be able to do the equivalent of
> > 'import '.
> >
> > The Scripting tutorial page tantalises with: "*you can create
> > complex scripts from a node and its descendants*", but I think this
> > is referring to scripts written to external files.
> >
> > Apologies if there is (as I suspect) a simple explanation of this 
> > somewhere.
> >
> > Thanks
> > Jon N
> >
> 

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


Re: Code academy: icons

2016-02-06 Thread 'Terry Brown' via leo-editor
On Sat, 6 Feb 2016 14:36:29 -0600
"'Terry Brown' via leo-editor" <leo-editor@googlegroups.com> wrote:

> If you'd tested
> 'icons' instead of 'lineYOffset', you'd have seen no problem.

I see you were following an example that tested 'lineYOffset'.  Also, I
see no use of 'lineYOffset' in the code base except setting to 3 when
icons are added and 0 when they're deleted, I think it's debris from
the old Tk interface.

So I've deleted all reference to it, and you'll need to use 

  aList = [p.copy() for p in c.all_unique_positions()
   if 'icons' in p.u]

for getting the list of nodes with icons.

Hope that's not breaking too much of anything for anyone - banking on
most people other that Edward ;-) picking 'icons' rather than
'lineYOffset' as a text target :-)

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: Code academy: icons

2016-02-06 Thread 'Terry Brown' via leo-editor
On Sat, 6 Feb 2016 11:00:38 -0800 (PST)
Richard Andersen <monta...@gmail.com> wrote:

[snip]

> ''' create a listing of all nodes which have icons '''
> 
> aList = [p.copy() for p in c.all_unique_positions() if 'lineYOffset'
> in p.u] #print('\n'.join([p.h for p in aList]))
> g.es_print('\n'.join([p.h for p in aList]))
> 
> ... because the nodes show up in the list produced by Script 3 and
> nothing I can do (including running the "delete Todo from all"
> function from within todo.py) is removing the data remnant.   I have
> checked to make sure that there are no Tags on the nodes either.

What you're doing makes sense, you're just tripping over a bit of cruft
in the code base.  Todo.py uses icons, but icons are separate, so
delete Todo isn't relevant.  The problem is that 

c.editCommands.deleteNodeIcons(p=p)

doesn't clean up p.u as fully as it might:

insert an icon...

V {'icons': [{'file': 
u'/mnt/usr1/usr1/home/tbrown/t/Package/leo/git/leo-editor/leo/Icons/Tango/16x16/devices/battery.png',
'on': 'VNode',
'relPath': u'Tango/16x16/devices/battery.png',
'type': 'file',
'where': 'beforeHeadline',
'xoffset': 2,
'xpad': 1,
'yoffset': 0}],
 'lineYOffset': 3}

delete all icons

V {'lineYOffset': 0}

c.editCommands.deleteNodeIcons(p=p) should delete both 'icons' *and*
'lineYOffset' from p.u, but it leaves that remnant.  If you'd tested
'icons' instead of 'lineYOffset', you'd have seen no problem.  I guess
it is setting it back to zero, but seeing that's the default / assumed,
deleting it would be cleaner, I'll make that change on trunk, but you
can just check 'icons' instead as a work around / avoidance.

Cheers -Terry terry_n_br...@yahoo.com

> It's a puzzler for me -- probably a no-brainer for many others.   
> 
> -Richard
> 
> On Sunday, January 31, 2016 at 6:34:21 AM UTC-8, Terry Brown wrote:
> >
> > On Sat, 30 Jan 2016 18:18:17 -0600 
> > "Edward K. Ream" <edre...@gmail.com > wrote: 
> >
> > > On Sat, Jan 30, 2016 at 5:57 PM, Largo84 <lar...@gmail.com
> > > > 
> > wrote: 
> > > 
> > > I struggled w/ Git at first too, but found that Sourcetree 
> > > > <https://www.atlassian.com/software/sourcetree/overview/> made
> > > > it a lot easier for me. 
> >
> > GitHub has recently (< 6 months?) released a "GitHub desktop" 
> > https://desktop.github.com/ 
> > app. which seems ok, I usually use the command-line (or gitk for 
> > review). But the desktop app. might help some. 
> >
> > Cheers -Terry 
> >
> > > ​I too started with SourceTree.  Alas, it has severe performance 
> > > problems. Imo, its best feature is gui-oriented selective adding.
> > > You can do something similar on the command line with git add -p,
> > > but I never have. 
> > > 
> > > I finally got fed up with the performance problems (and small
> > > fonts, which they refused to fix) and switched to gitk.  Works
> > > fine for routine tasks. ​ 
> > > 
> > > > I still don't really 'get Git', but I'm using it nonetheless.
> > > > For pull requests only, it's pretty simple. 
> > > 
> > > ​Yes, me too. 
> > > 
> > > 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: Reducing visual clutter in Tree

2016-02-02 Thread 'Terry Brown' via leo-editor
On Tue, 2 Feb 2016 05:11:36 -0800 (PST)
john lunzer <lun...@gmail.com> wrote:

> Sorry to dredge up an old topic, Terry is there any reason this
> change can't be folded into the code base? I continue changing it
> every time I update Leo.

Sure - I still haven't seen it, so my guess is that I have a plugin
installed that's triggering the update by triggering a node selection
event, or something like that, but the code shouldn't be relying on
that.  So yes, fold it in.

Cheers -Terry
terry_n_br...@yahoo.com

> On Monday, August 31, 2015 at 11:53:12 AM UTC-4, Terry Brown wrote:
> >
> > On Mon, 31 Aug 2015 08:37:25 -0700 (PDT) 
> > john lunzer <lun...@gmail.com > wrote: 
> >
> > > When I save a Leo outline all of my icons disappear? The next 
> > > headline update will restore them. Anyone seeing similar
> > > behavior? 
> >
> > No, although I can see how that could happen.  The visual-declutter 
> > code clears all the icons it inserted based on rules before the
> > save, so that you're not left with a file riddled with "virtual"
> > icons mixed with icons you may have added manually yourself and
> > want to keep.  I.e. if you disable the declutter code, all it's
> > icons should disappear.  You would think it would need to put them
> > back after the save, but I'm not seeing them disappear. 
> >
> > Hmm, so based on the code I would expect the problem you report, 
> > because of 
> > leo-editor/leo/core/LeoPy.leo#Code-->Qt gui-->@file 
> > ../plugins/qt_tree.py-->qtree.Drawing-->qtree.full_redraw & 
> > helpers-->qtree.clear_visual_icons 
> >
> > But I don't see the problem.  The solution would be to add 
> >   self.declutter_update = True 
> > to the above clear_visual_icons() - can you try that and see if the 
> > problem goes away? 
> >
> > Cheers -Terry 
> >
> > > On Monday, August 17, 2015 at 3:06:38 PM UTC-4, Terry Brown
> > > wrote: 
> > > > 
> > > > On Mon, 17 Aug 2015 05:09:55 -0700 (PDT) 
> > > > john lunzer <lun...@gmail.com > wrote: 
> > > > 
> > > > > I've discovered a visual glitch when using the rules for the
> > > > > task icons. After the icon has been added by the declutter
> > > > > feature if I then attempt to edit the headline again by
> > > > > making it shorter (backspace or delete) the original headline
> > > > > seems to get "burned in" 
> > > > 
> > > > Thought that was going to be a tough one but seemed simple
> > > > after all, very lightly tested but seems to be fixed (and
> > > > pushed). 
> > > > 
> > > > Cheers -Terry 
> > > > 
> > > > > behind the editable headline box so that the end of the
> > > > > original headline still shows. Interestingly if I make a
> > > > > change and then press Ctrl + z (undo) then everything seems
> > > > > fine and the original headline is no longer "burned in" in
> > > > > the background. 
> > > > > 
> > > > > On Wednesday, August 12, 2015 at 11:56:07 AM UTC-4, john
> > > > > lunzer wrote: 
> > > > > > 
> > > > > > Also, kudos for collapsing leoSettings.leo again before 
> > > > > > pushing, so that 
> > > > > >> it looks right when opened. 
> > > > > > 
> > > > > > If that happened it was purely by accident :) Though I will 
> > > > > > certainly remember to do so in the future. 
> > > > > > 
> > > > > > On Wednesday, August 12, 2015 at 11:14:07 AM UTC-4, Terry
> > > > > > Brown wrote: 
> > > > > >> 
> > > > > >> On Wed, 12 Aug 2015 04:57:16 -0700 (PDT) 
> > > > > >> john lunzer <lun...@gmail.com> wrote: 
> > > > > >> 
> > > > > >> > Just pushed @path/active-path icons in the latest
> > > > > >> > commit. Check the updated tree-declutter-patterns in
> > > > > >> > leoSettings.leo for the accompanying rules. No need to
> > > > > >> > use them of course but I think they make a big
> > > > > >> > difference when using active-path. 
> > > > > >> 
> > > > > >> Like the way you handle removed files. 
> > > > > >> 
> > > > > >> Also, kudos for collapsing leoSettings.leo again be

How to write the unwriteable file?

2016-02-01 Thread 'Terry Brown' via leo-editor
Hmm, unfortunately I want to write files which contain content like this:
    this part is LaTeX etc. etc.
    <>=    this part is R code    @
    more LaTeX here
https://github.com/yihui/knitr/blob/master/inst/examples/knitr-minimal.Rnw
is an example, and http://yihui.name/knitr/demo/minimal/, comments at end of 
main post, explains the situation well.  I think the question "can we have user 
defined section delimiters instead of << >> has come up before and met with a 
probably quite reasonable No!

I know @asis and @nosent can do it, but I want hierarchy.  I can just use other 
delimiters and post-process.
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: Great to see the new Nav panel showing "parent tags"

2016-02-01 Thread 'Terry Brown' via leo-editor



 From: Richard Andersen <monta...@gmail.com>
 To: leo-editor <leo-editor@googlegroups.com> 
 Sent: Sunday, January 31, 2016 2:37 PM
 Subject: Re: Great to see the new Nav panel showing "parent tags"
   
Edward mentioned that the change was probably made by Terry Brown, so -- in 
that case -- thank you Terry for this really nice enhancement to the Nav area 
(quicksearch.py).
Wasn't me, if you really mean parent tags, I haven't noticed that, use tags 
rarely, don't know what that would have been, if you mean parent nodes, that 
was John Lunzer.
Cheers -Terry


-Richard

On Sunday, January 31, 2016 at 9:28:18 AM UTC-8, Richard Andersen wrote:
Edward,
This is awesome...



... in the Jan 29th build.
I need to experiment a bit with the drop-down options for All, Subtree, File, 
Node.
Thank you for making this change!

-Richard
-- 
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: output body and headlines (newbie)

2016-01-31 Thread 'Terry Brown' via leo-editor
On Sun, 31 Jan 2016 12:46:32 -0800 (PST)
Richard Andersen  wrote:

> Thank you, Terry.
> 
> I am trying the code with the Jan 29 build.Still seeing some
> errors...

Sorry, my bad, you need to enable the leoscreen plugin.  But that's
perhaps a bit klunky.  The way the script works, it displays the text
export in a preview window, then opens a file save dialog on top of
that so you can save (or cancel). Then you have to close the preview
window.  The preview window is from a function that happens to reside
in the otherwise unrelated leoscreen plugin, which is for two way
communication between Leo and unix command line apps. leveraging the
unix `screen` command.

Maybe it would be neater to just copy the content to the clipboard
and offer the file save dialog...

https://github.com/leo-editor/snippets/blob/master/scripts/output/outline2text.py

now does that - if you want to see the text, paste it into a node,
otherwise just save it somewhere, that seems like the more likely end
use.

Cheers -Terry

> exception executing script
> AttributeError: 'Commands' object has no attribute 'leo_screen'
> 
>   line 69: for i in c.getSelectedPositions():
> * line 70: export_text(i)
>   line 71: c.leo_screen.show('\n'.join(lines), 'text', plain=True)
>   line 72: 
> 
> ... and will keep working with it further to see what might be the
> issue.
> 
> -Richard
> 
> On Wednesday, October 5, 2011 at 1:49:18 PM UTC-7, Todd Mars wrote:
> >
> > Can I export text representation with both headlines and bodies in
> > a simple outline structure? (like a text dump)Perhaps there is a
> > way to do this in rst but output defaults to all left justified. 
> > thanks!
> 

-- 
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: Code academy: icons

2016-01-31 Thread 'Terry Brown' via leo-editor
On Sat, 30 Jan 2016 18:18:17 -0600
"Edward K. Ream"  wrote:

> On Sat, Jan 30, 2016 at 5:57 PM, Largo84  wrote:
> 
> I struggled w/ Git at first too, but found that Sourcetree
> >  made it a
> > lot easier for me.

GitHub has recently (< 6 months?) released a "GitHub desktop"
https://desktop.github.com/
app. which seems ok, I usually use the command-line (or gitk for
review). But the desktop app. might help some.

Cheers -Terry

> ​I too started with SourceTree.  Alas, it has severe performance
> problems. Imo, its best feature is gui-oriented selective adding. You
> can do something similar on the command line with git add -p, but I
> never have.
> 
> I finally got fed up with the performance problems (and small fonts,
> which they refused to fix) and switched to gitk.  Works fine for
> routine tasks. ​
> 
> > I still don't really 'get Git', but I'm using it nonetheless. For
> > pull requests only, it's pretty simple.
> 
> ​Yes, me too.
> 
> 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: output body and headlines (newbie)

2016-01-30 Thread 'Terry Brown' via leo-editor
On Sat, 30 Jan 2016 10:01:59 -0800 (PST)
Richard Andersen <monta...@gmail.com> wrote:

> Hi Terry (and others),
> 
> I see the script is from a while back, so perhaps something has
> changed in the core which is causing an error for me.
> 
> When I run it, I get this error...
> 
> exception executing script
> AttributeError: 'str' object has no attribute 'in_qt_dialog'
> 
>   line 453: self.attachLeoIcon(d)
> * line 454: c.in_qt_dialog = True

So I fiddled around with this a lot:
https://github.com/leo-editor/snippets/blob/master/scripts/output/outline2text.py

because I was trying to get it to run in python 2/3 qt 4/5 (it does),
and get it to handle an HTML template (gave up).

So the above should work, although you may need to get the latest Leo
code to get the preview view to work in Py 3 (just pushed a fix for
leoscreen, the plugin that provides the viewer for the preview).

All that said, I wonder if your problem is that c doesn't have it's
usual value (the commander / outline) but was changed to a string (str)
reference in your code?

Cheers -Terry


>   line 455: obj = 
> d.getSaveFileName(parent,title,os.curdir,filter_)
>   line 456: c.in_qt_dialog = False
> 
> ... immediately after the Dialog box comes up and I respond to either 
> option.
> 
> Would appreciate any direction you can provide.
> 
> -Richard
> 
> On Thursday, October 6, 2011 at 10:19:48 AM UTC-7, Terry Brown wrote:
> >
> > On Thu, 6 Oct 2011 12:13:48 -0500
> > Terry Brown <terry_...@yahoo.com > wrote:
> >
> > > # filename = g.app.gui.runSaveFileDialog('Save to file')
> > > filename = '/home/tbrown/Desktop/del.txt'
> >
> > whoops, of course that should be just
> >
> > filename = g.app.gui.runSaveFileDialog('Save to file')
> >
> > 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: Code academy: icons

2016-01-30 Thread 'Terry Brown' via leo-editor
On Sat, 30 Jan 2016 13:23:20 -0600
"Edward K. Ream"  wrote:

> On Sat, Jan 30, 2016 at 11:33 AM, Richard Andersen
>  wrote:
> 
> > Sorry if this is a really basic question.
> >
> > I'm running the Leo 5.1 release.How do I take advantage of
> > changes such as this one described here, where very recent changes
> > have been made to Leo's core?
> 
> ​Use git, as described yesterday.

I know this is the canonical answer :-) but would point out that you
can also download
https://github.com/leo-editor/leo-editor/archive/master.zip
as linked here
http://leoeditor.com/download.html (the "Latest" link).

Which gives you the latest code without using git.

Cheers -Terry

> 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: Code academy: icons

2016-01-29 Thread 'Terry Brown' via leo-editor



 From: Edward K. Ream 
 To: leo-editor  
 Sent: Friday, January 29, 2016 9:08 AM
 Subject: Code academy: icons
   
During our conference call, someone asked whether nodes may have more than one 
icon.  Indeed they can.

For example, running this script will insert three icons. Running the script 
again will insert three more.  You can delete the icons using the 
delete-node-icons command. I'm having trouble deleting icons programmatically.  
I'm investigating.


c.editCommands.setIconList(p, [])c.redraw()
If you don't want to delete them all:icons = c.editCommands.getIconList(p)icons 
= [i for i in icons if ]c.editCommands.setIconList(p, 
icons)

also, add a True param. at end of setIconList call to mark node dirty (changed, 
save required) if desired.
Cheers -Terry


table = (
    'edittrash.png',
    'connect_no.png',
    'error.png',
)
for icon in table:
    fn = g.os_path_finalize_join(g.app.loadDir,
        '..', 'Icons', 'Tango', '16x16', 'status', icon)
    if g.os_path_exists(fn):
        c.editCommands.insertIconFromFile(path=fn)

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: Leo's code academy: how to do cool things easily

2016-01-29 Thread 'Terry Brown' via leo-editor
On Thu, 28 Jan 2016 18:41:09 -0800 (PST)
"Edward K. Ream"  wrote:

> We discussed the so-called Easter-Egg interface to create new panes
> this from the gui, but a summary of how to do this programmatically
> is needed.

I've given a couple of examples of how to do this, let's see...

https://github.com/leo-editor/snippets/blob/master/examples/demo_widget.py

has comments,

https://gist.github.com/tbnorth/6165576

is another one that adds a web-browser pane, as written it opens it in
a separate window, which is part of the free_layout system.

Cheers -Terry

> *Note*: it's possible to save the layout so that Leo will
> restore it when Leo starts up the next time.

-- 
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: Code Academy: real Leo programmers use git

2016-01-29 Thread 'Terry Brown' via leo-editor
Git *users* can create gists, like https://gist.github.com/tbnorth/6165576
But https://github.com/leo-editor is a GitHub organization, not user, so it 
doesn't have gists, instead I made a separate repo. all members of leo-editor 
can push to: https://github.com/leo-editor/snippetsI'd vote for that.  There's 
more junk, um, I mean invaluable and educational examples :-),  laying around 
at the top level than there should be, but as long it doesn't get worse and 
people (myself included) remember to put things in subfolders going forward, I 
think it will be ok.
Does that seem like a workable option to you?  If it needed to look prettier, 
we could use github pages to make an index or something.
BTW, anyone know how to stop google-groups hiding my email address 
(terry_n_br...@yahoo.com)? I can't find the setting.
Cheers -Terry
 
  From: Largo84 
 To: leo-editor  
 Sent: Friday, January 29, 2016 1:57 PM
 Subject: Re: Code Academy: real Leo programmers use git
   
This is all great stuff. Yes, been using Git for a while now to stay current on 
the code base. I've often wondered if there's also an easier way to share code 
snippets and scripts. There's Leo wiki that would be ideal for that, but it 
hasn't been edited in over 4 years. Is that something that can be revived?
Rob...

On Friday, January 29, 2016 at 11:37:59 AM UTC-5, Edward K. Ream wrote:
If you are going to do interesting work on Leo and its plugins, you should be 
using Leo’s latest sources from GitHub using git. Once git is installed, 
getting the latest version of Leo is easy:

git clone https://github.com/leo-editor/ leo-editor.git
Once you have done that, you can get the latest sources with:

git pull
Git is great in tracking history and reverting unwanted changes. And it has 
many other benefits.

I've been wondering when to say this, but recent developments have forced my 
hand.  Today, as the result of our Code Academy discussion, I have added the 
p.u property and a keyword arg to c.editCommands. deleteNodeIcons.  If you 
don't use git you will quickly get out of the loop.

Although git is unique behind the scenes, using git is very similar to using 
bzr or hg or any other SCCS.  To change Leo, you add files, you commit files, 
and you push files.  That's about it.

I'll be happy to answer any git-related questions here.  Again, I strongly 
encourage all would-be Leo programmers to use Leo's git repo.

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: Leo personal organizer project (continuation of earlier thread)

2016-01-27 Thread 'Terry Brown' via leo-editor
On Tue, 26 Jan 2016 17:06:17 -0800 (PST)
Richard Andersen  wrote:

> It looks like a conference call on Thursday, 1/28 at 12 noon Pacific
> will work best for those that I've heard from.
> 
> Any and all are welcome and encouraged to join, just let me know.
> I'll send out the logistical details via email to those who'd like to
> join.

Can't promise I'll make it but send me the details and I'll see what
I'm up to then.

Cheers -Terry

> Thanks,
> 
> -Richard
> 
> On Monday, January 25, 2016 at 11:18:26 AM UTC-8, Richard Andersen
> wrote:
> >
> > [continuation of prior thread "Looking to engage a Leo expert in a
> > paid project" with new thread subject]
> >
> > Thanks to Jake, Rob, Terry, Edward, Jon, and Don, for expressing
> > interest in taking Leo further in the direction of being an optimum
> > personal organizer. Several of you have used Ecco Pro regularly for
> > years and like elements of it, such as...
> >
> > - outline centric interface
> > - elegant node manipulation
> > - rich context (parent nodes presented in certain views)
> > - robust search
> > - robust tag / metadata handling
> > - integrated contact file
> > - integrated calendar
> >
> > ... and struggle with some of the other aspects of a 23 year old
> > program (history here --> http://eccopro.com/history/arabesque/)
> > which still amazes most of us who have used it.
> >
> > - challenges exporting formatted outlines
> > - challenges moving nodes around from file to file
> > - lack of some modern capabilities (e.g. hoisting) without some
> > additional code / config
> > - difficulties handling node headers and bodies simultaneously
> > (without some additional code / config)
> >
> > The goal of this project, as of now, is not to replace Ecco Pro per
> > se, but rather to inform a direction for Leo in the area of
> > personal organizer (a purpose for which, out of the box, Leo is
> > very well-suited). Having spoken with a few of you, there is
> > interest in getting together and discussing what can be done, and
> > which ones of us could take on various sub-projects (design, dev,
> > testing, doc, etc.). It appears that quite a bit could be done in a
> > few weeks, so this doesn't need to be a massive, long-term project.
> >
> > I'd like to see how many can make a call this Wed or Thurs. I can
> > set up a conf bridge. I'll also demo how I'm using nodetags.py +
> > quicksearch.py with really good results. Perhaps others can share
> > some of the techniques they use as well.
> >
> > Please let me know if you're interested in joining and how your
> > calendar looks for those days or, alternatively, next week.
> >
> > -Richard

-- 
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: Copy rich text, paste markdown

2015-12-31 Thread 'Terry Brown' via leo-editor
On Thu, 31 Dec 2015 08:15:01 -0800 (PST)
Chris George  wrote:

> Hi Edward,
> 
> I don't think so. I use Linux Mint 17.2 KDE.
> 
> Leo 5.1-final, build 20151207062203, Mon Dec  7 06:22:03 CST 2015
> Git repo info: branch = master, commit = 0d2b4de265f0
> Python 2.7.6, PyQt version 4.8.6
> linux2
> 
> Terry identified it as an encoding issue specific to Qt, but in
> reading about how to solve this it turns out that KDE reads the
> clipboard using Qt as well, so I am not sure if that is where the
> problem lies.

I didn't mean to blame Qt specifically, it seemed necessary to use Qt
to read the clipboard because xclip would hang Leo in the Popen call
when HTML was requested and there wasn't any on the clipboard.  After
that there was encoding to deal with, but not necessarily anything Qt
was doing wrong.

Cheers -Terry

> My original "idea" was to enable Leo to read text/html from the
> clipboard and then convert and paste the string into Leo depending on
> the @language of the node. For example I could copy part of a web
> page (which all browsers on linux add to the clipboard as text/html)
> and paste it as markdown into a markdown node or rst in a rst node or
> as plain text into node with no @language setting. My solution
> doesn't address this added functionality in Leo, but it does solve my
> specific problem, on this specific OS/DE.
> 
> Chris 
> 
> On Thursday, December 31, 2015 at 6:51:03 AM UTC-8, Edward K. Ream
> wrote:
> >
> >
> >
> > On Tuesday, December 29, 2015 at 5:29:16 PM UTC-5, Chris George
> > wrote:
> >>
> >> I resolved this by coming at it from the other end.
> >>
> >> I created a shell script.
> >>
> >> pastedown.sh
> >>
> >> #!/bin/bash
> >>
> >> xclip -o -selection clipboard -t text/html|pandoc -r html -w
> >> markdown|xclip -i -selection clipboard
> >>
> >>
> >> Then I used the Custom Shortcuts feature in KDE to assign
> >> Ctrl-Shift-v to launch it. The script reads the clipboard,
> >> converts it to markdown and puts it back in the clipboard and then
> >> allows me to paste it into Leo using Ctrl-v as markdown. No
> >> encoding errors.
> >>
> >
> > Does this thread have any relevance to bug # 201 
> > ?
> >
> > 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: Body pane to be 14pt or 16pt?

2015-12-30 Thread 'Terry Brown' via leo-editor
On Wed, 30 Dec 2015 02:10:15 -0800 (PST)
Satheesh Vattekkat  wrote:

> Sorry, this looks like a stupid question -- but I've been struggling
> for 2 days to get this working.

Did you try this menu item:

Settings -> Edit Settings -> Fonts -> Body fonts -> Size

I'm not sure how it would interact with leo10pt.leo though, not
familiar with that.  Also the above menu thing tries to be clever, but
can't guarantee results in an environment with unknown changes.

For quick relief, you should be able to use Ctrl-Mousewheel to change
the font size in the body.

Cheers -Terry

> Got a new laptop with 14" with 1440x900 resolution; running Linux
> Mint 17.3. Installed leo from git, python 2, pyQT etc. All is good,
> except...
> 
> 1. Love the gray color scheme of leo10pt.leo. Copied @data 
> qt-gui-plugin-style-sheet into myLeoSettings.leo => @settings => path
> 2. Colors are all good.
> 3. Want to change the font to 14pt. Tried various things - hard
> coding, changing @font-size-body = 14pt to some 22pt; save, restart
> etc. But it is always at some 10pt.
> 4. Added a @data qt-user-style-sheet also; wherein I tried various 
> settings. No luck.
> 
> Note - these are the last two nodes in my @settings. There are no
> errors on startup. I remove this node, it goes back to old look and
> feel and even zoom-in/zoom-out works. I also put in content from
> leo14pt.leo instead of 10pt.leo; no impact on font-size.
> 
> I hadn't done any of these since it was a happy world in 1366x768
> laptop I had before. This small font everywhere else is fantastic for
> me. But body text is too small for eyes :( I've enabled VIM plugin
> and I can open the body in GVIM which is set to 14pt -- but that is a
> bit of a nuisance when all I want is to read quickly and also is a
> pain in tiling window manager I usually use.
> 
> Any help? I'm assuming that this is going to be a "aah, silly me"
> kind of issue; but just not able to figure out.
> 
> 

-- 
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: Copy rich text, paste markdown

2015-12-28 Thread 'Terry Brown' via leo-editor
On Sun, 27 Dec 2015 19:33:24 -0800 (PST)
Chris George  wrote:

> Hello All,
> 
> Some time ago I asked Terry about being able to copy rich text from a 
> browser window and paste rst. I was pointed to a solution that uses
> xclip and pandoc and have been using it since by running it in a
> command window and copy/pasting the output into Leo. This worked as I
> only needed to do this on rare occasions. I recently switched over to
> using markdown and the command line to make this happen works just
> great. I find myself using this capability more and more often though.
> 
> xclip -o -selection clipboard -t text/html | pandoc -r html -w
> markdown

> My question is: How do I automate this in Leo? It would be nice to be
> able to have this command run on all pastes (Ctrl-v) that have a
> markdown file as a destination, with plain text as a fallback if the
> clipboard provides something that isn't text/html.

"all pastes (Ctrl-v) that have a markdown file as a destination" would
require a bit more thought.  Here's a simple(*) solution you could
deploy as a @button, just stick it in a node called `@button h2m`,
reload or click the script-button button the first time (it will appear
automatically on reloads).

--- cut here ---
from subprocess import Popen, PIPE
from leo.core.leoQt import QtGui

clipboard = QtGui.QApplication.clipboard()
html = unicode(clipboard.text("html"))

if html:
cmd = "pandoc -r html -w markdown".split()
proc = Popen(cmd, stdout=PIPE, stdin=PIPE)
markdown, errors = proc.communicate(html.encode("utf-8"))
i = c.frame.body.wrapper.getInsertPoint()
c.frame.body.wrapper.insert(i, markdown)
else:
g.es("No HTML to convert")
--- cut here ---

For my setup I get a lot of extra chatter in the markdown, like
 
but maybe there are pandoc settings to stop that.

(*) ok, this seemed simple, but wasn't.  
  xclip -o -selection clipboard -t text/html
returns nothing when executed in the shell when there's no html on the
clipboard, but when execute from Popen without html, it never returns.
Hence using Qt to access the clipboard, with related encoding issues.

Cheers -Terry

> The usual disclaimer about me not being a programmer applies. I use
> Leo to write, not code.
> 
> Chris

-- 
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: Leo.exe: a christmas present for newbies

2015-12-26 Thread 'Terry Brown' via leo-editor
On Sat, 26 Dec 2015 03:37:40 -0800 (PST)
"Edward K. Ream"  wrote:

> On Friday, December 25, 2015 at 7:49:26 PM UTC-5, Edward K. Ream
> wrote:
> 
> > I'll be working on the Linux and MacOS versions when I return home
> > in a few weeks.
> 
> I'll upload Leo.exe (windows) today.
> 
> As of re df4313de1, there is nothing path or OS specific in
> launchLeo.spec, so to create a Linux (or MacOS) version, the
> following should work:
> 
> 1. Install PyInstaller with 'pip install pyinstaller'.
> 2. cd leo-editor.
> 3. pyinstaller launchLeo.spec
> 
> The resulting executable will be in leo-editor/dist.
> 
> Terry, could you try this on Linux?  Thanks.

Sure. Ubuntu 14.04.3 LTS

It failed, I'll email you a .zip of the lengthy log separately.
Congrats on getting the windows version going.

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: Configuration Screipt Pattern

2015-12-21 Thread 'Terry Brown' via leo-editor
On Mon, 21 Dec 2015 12:47:54 -0500
Jacob Peck  wrote:

> The convention tends to be using @settings trees and the appropriate 
> c.config.getX() methods, but obviously that only works for scripts
> run within Leo.  If you're writing a script for use both within and
> outside of Leo, you might want to go the other way.
> 
> My personal Leo scripts tend to hold their own configuration data in
> a << declarations >> node, as a part of the script tree itself -- I
> rarely use the same script across multiple workbooks.
> 
> But really, it's completely up to you -- Leo is flexible enough to 
> accommodate nearly everyone's individual coding patterns and
> workflows. There's generally no shortage of ways to do things in
> Leo :)

I think all of Jake's points are good answers.  If you're using
@settings nodes, I don't think you'd need to make a configparser
yourself, just have a @settings tree in the outline with nodes like

  @int mything-min-size = 12
  @string mything-encoding-name = utf-8

then read with

  min_size = c.config.getInt('mything-min-size')

etc. - using the first part of the settings names to group your
settings - but as Jake says, everything is flexible, you don't have to
do it that way.

Jake's declarations approach might work better if you want to tweak the
params a lot, seeing full reload is the only reliable way to update
after changing @settings.

Cheers -Terry

> -->Jake
> 
> On 12/21/2015 12:32 PM, Rafi Bin-Nun wrote:
> > Thanks Terry, Let me re-phrase the question in those terms...
> >
> > When running Python scripts from Leo, should Leo build a
> > configparser config file and have the python script read it in with 
> > configparser.read(), or should the Python script pull the 
> > configuration information directly from Leo nodes?
> >
> > Thanks,
> > Rafi
> > -- 
> > 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: Configuration Screipt Pattern

2015-12-21 Thread 'Terry Brown' via leo-editor
On Mon, 21 Dec 2015 07:17:53 -0800 (PST)
Rafi Bin-Nun  wrote:

> What's the pattern for creating Python configuration files in Leo?
> Should Leo create a file which the script then reads or should the
> script try to key off of Leo nodes directly?

You might need to explain the goal a little more.  By Python
configuration script do you mean a piece of valid Python code that
contains configuration info. that something else reads, or something
else, like https://docs.python.org/2/library/configparser.html .ini
files?

Cheers -Terry

> I'm new to Leo, so I'm sorry if I'm asking the obvious. 
> 
> Thanks in advance,
> Rafi
> 

-- 
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: whatever

2015-12-03 Thread 'Terry Brown' via leo-editor
On Thu, 3 Dec 2015 13:17:12 -0800 (PST)
Todd Mars  wrote:

> hi,
> finally upgraded to 5.1, now @clean node works and can output a
> simple text file that reflects the outlline.
> So to make a small font in the body and headlines, I edit personal
> settings file and put in what node?
> thanks
> it would be nice if ctrl- and ctrl+ could make the font sizes bigger
> and smaller like they do in browsers.

Ctrl-mousewheel works in the body.  To make the keys work, add these
key bindings:

zoom-in = Ctrl+=
zoom-out = Ctrl+- 

(again, body only)

To make headline font smaller, select the menu item:

Settings
  Edit settings
Fonts
  Outline pane fonts
Basic outline fonts
  Size

You should end up editing a node in mySettings.leo that looks like

  @string tree-font-size = @font-size

make it look like

  @string tree-font-size = 8px

or something like that.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Push/pop hoist?

2015-12-02 Thread 'Terry Brown' via leo-editor
On Wed, 2 Dec 2015 11:52:20 -0800 (PST)
Phil  wrote:

> > The 'problem' with chapters, if you can call it that, is that they
> > 'feel' more permanent -- you're making a change to the tree
> > structure (with @chapter nodes) to accommodate it -- of course,
> > they're disposable if you wish, just not transparently so.
> >
> > Sure, that's a good point. I think I can work with that behavior,
> > but it 
> would also be nice to have a more "transient" stacking behavior that
> is independent of the outline structure. Maybe if I can find some
> time I'll try to figure out how to do that.  :)

You could look at the bookmarks plugin.  That can save locations, or
even groups of locations - you just have to do the (un)hoisting as a
separate step.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Push/pop hoist?

2015-12-01 Thread 'Terry Brown' via leo-editor
On Tue, 1 Dec 2015 14:16:03 -0800 (PST)
Phil  wrote:

> Is there a command that can push the current (hoisted) root node onto
> a stack, which can later be popped back to the hoisted root position?
> If not, can someone provide some guidance for how I would implement
> this functionality myself in a @button?
> 
> Thanks!
> Phil

Not 100% clear on your goal - basically cut / yank / push a subtree,
which you're identifying by hoisting, to a stack, rather than the
single content clipboard, and the copy / pop it somewhere else later?
I guess I'm confused by the mix of moving subtrees and hoisting.

The quickmove plugin provides a number of ways (including buttons) to
move subtrees to targets.  You could create a node somewhere called
"stack-of-nodes" and set it as a target for "move to first child"
operations using quickmove.  Then you'd have a button to move the
current node / subtree to the first child position of that node, so
your stack would be the children of a node in the tree, which seems
Leonine.

It wouldn't be hard to script a button to move those children back to
the current position - could show some code, but not sure I'm answering
the question?

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Cursor Position on Paste

2015-11-25 Thread 'Terry Brown' via leo-editor
On Wed, 25 Nov 2015 08:22:00 -0800 (PST)
Chris George  wrote:

> Hi John,
> 
> Thanks for all the work. My Python/Qt/OS is the same as your test 
> environment. For me the cursor still *always *goes to the end of the
> string on paste, no matter how I select the string.
> 
> So it must be something in my settings. I pull from git every single
> time I start Leo, it is baked into my start-up script. I will try
> downloading from github and running a vanilla install of Leo and
> report back.

You can do:

HOME=/tmp python launchLeo.py

to get a vanilla Leo environment, if that helps.

Cheers -Terry

> Chris
> 
> On Wednesday, November 25, 2015 at 7:45:58 AM UTC-8, john lunzer
> wrote:
> >
> > I just tested a fresh install on a fresh virtual machine (Linux
> > Mint 17.2 KDE, which is a great Leo test environment). Booted into
> > the Live ISO and didn't download or install anything except for Leo
> > from github.
> >
> > Leo 5.1-final, build 20151122092056, Sun Nov 22 09:20:56 CST 2015
> > Not running from a git repo
> > Python 2.7.6, PyQt version 4.8.6
> >
> > *My changes are working*. My understanding of the desired behavior
> > was that when text was highlighted that if a paste was executed
> > that the cursor would stay either at the beginning or end of the
> > pasted string following a paste corresponding to where the where
> > the cursor was in the original selection. In cases where no text is
> > selected/highlighted the cursor always goes to the end of the
> > pasted string. That was my understanding and what I implemented.
> >
> > If you would like a *second* setting in which the cursor always
> > stays at the beginning of the pasted string whether text was
> > previously selected or not I can also implement that but it will
> > not be default behavior.
> >
> > On Sunday, November 22, 2015 at 10:16:56 AM UTC-5, john lunzer
> > wrote:
> >>
> >> I'm going to install a linux virtual machine on my windows
> >> computer and test this out with a fresh install.
> >>
> >> On Friday, November 20, 2015 at 7:34:00 PM UTC-5, john lunzer
> >> wrote:
> >>>
> >>> Okay, thanks for testing it out. The behavior *does* work for me,
> >>> so I'm not having an issue on my end. I'll try to take a look it
> >>> at as soon as I can. Maybe not this weekend, but I'm off next
> >>> week so should have some time. 
> >>>
> >>> Edward or Terry, if you have any ideas on why it might now be
> >>> working on machines other than my own I would appreciate it. I'm
> >>> thinking it might have something to do with how I do my check:
> >>>
> >>> I'm getting the setting in the LeoFrame constructor with: 
> >>>
> >>> self.cursorStay = c.config.getBool("cursor_stay_on_paste",
> >>> default = True)
> >>>
> >>>
> >>> And my check consists of:
> >>>
> >>> if self.cursorStay and wname.startswith('body')
> >>>
> >>>
> >>> I'm guessing that the constructor is firing properly and setting 
> >>> self.cursorStay otherwise I'd probably be getting an attribute
> >>> error. And since the default is True it should be True. So I
> >>> wonder if my understanding what wname gets set to is causing the
> >>> problem.
> >>>
> >>> On Friday, November 20, 2015 at 6:24:34 PM UTC-5, lewis wrote:
> 
>  I can confirm it makes no difference on a windows machine. The
>  cursor always lands on the right with Global settings and @bool 
>  cursor_stay_on_paste = True in myLeoSettings.leo.
> 
>  Leo Log Window
>  Leo 5.1-final, build 20151120111022, Fri Nov 20 11:10:22 CST 2015
>  Git repo info: branch = master, commit = a9465468020e
>  Python 3.4.3, PyQt version 5.5.1
>  Windows 7 AMD64 (build 6.1.7601) SP1
> 
>  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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Can't run on Mac as different user

2015-11-25 Thread 'Terry Brown' via leo-editor
On Wed, 25 Nov 2015 06:57:54 -0800 (PST)
Largo84  wrote:

> That would be a good idea, but Leo won't start enough to get that 
> information, it fails before any of that information is displayed in
> the terminal log.

Can you execute this in a console:

  python3 -c 'import sys; from PyQt5 import QtCore; print(sys.version,
  QtCore.PYQT_VERSION_STR)'

(all on one line)

e.g. I get

3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] 5.2.1

just the 5.2.1 is the Qt part, the rest is from Python.

Cheers -Terry

> Rob.
> 
> On Monday, November 23, 2015 at 11:15:37 AM UTC-5, Largo84 wrote:
> >
> > Any idea why Leo won't run from a different user account on a Mac?
> > The last three lines in the Terminal log pane are:
> >
> > import leo.plugins.qt_text as qt_text
> >
> >   File "/Users/Shared/leo-editor/leo/plugins/qt_text.py", line 434,
> > in 
> >
> > class LeoLineTextWidget(QtWidgets.QFrame):
> >
> > AttributeError: 'NoneType' object has no attribute 'QFrame'
> >
> >
> > Rob...
> >
> 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Data set on unsupported clipboard mode. QMimeData object will be deleted.

2015-11-24 Thread 'Terry Brown' via leo-editor
On Tue, 24 Nov 2015 10:47:08 -0800 (PST)
Largo84  wrote:

> Hmm, sorry I don't really understand what any of that means, but I'm
> not sure I need to. As a practical matter, should I be concerned
> about losing data or is this simply a change in the way Leo 'behaves'?

No need to be concerned about losing data other than clipboard content,
and even then, I'm guessing you won't see any change - some systems
have two "clipboards", one that you explicitly copy to, and another
which is just the current selection, I think the last selection made in
multi-app. scenarios.  I'd guess that your normal clipboard will be
unaffected, and the second one, which doesn't exist in all systems, is
the one that's bleating.

But Leo will need to be fixed to avoid generating the message.  I'm
guessing QClipboard::supportsSelection() might need to be checked.

Cheers -Terry

> Rob.
> 
> On Tuesday, November 24, 2015 at 10:12:18 AM UTC-5, Largo84 wrote:
> >
> > I don't recall seeing this message in the startup log (terminal
> > window) before today. I just updated to the most current version on
> > GitHub.
> >
> > reading settings in C:\Users\Rob\.leo\workbook.leo
> > Data set on unsupported clipboard mode. QMimeData object will be
> > deleted. cleaning C:\Users\Rob\.leo\spellpyx.txt
> > Data set on unsupported clipboard mode. QMimeData object will be
> > deleted. Data set on unsupported clipboard mode. QMimeData object
> > will be deleted. Data set on unsupported clipboard mode. QMimeData
> > object will be deleted.
> >
> >
> > ...and many more lines just like it after opening a Leo file.
> >
> > Any idea what's causing that and if I should be concerned about it?
> > Rob...
> >
> > Leo Log Window
> > Leo 5.1-final, build 20151120111022, Fri Nov 20 11:10:22 CST 2015
> > Git repo info: branch = master, commit = a9465468020e
> > Python 3.4.3, PyQt version 5.4.1
> > Windows 8 AMD64 (build 6.2.9200) 
> >
> 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Data set on unsupported clipboard mode. QMimeData object will be deleted.

2015-11-24 Thread 'Terry Brown' via leo-editor
On Tue, 24 Nov 2015 07:12:17 -0800 (PST)
Largo84  wrote:

> I don't recall seeing this message in the startup log (terminal
> window) before today. I just updated to the most current version on
> GitHub.

Hmm, this must be

https://github.com/leo-editor/leo-editor/commit/0c89affbb86adf2ad5b828bb8eb6b8c6517cf69d
and
https://github.com/leo-editor/leo-editor/commit/b9f0c578dd9aedf05bdd5fe3962c727f9d4b1f7f

Although I'm not seeing the "unsupported clipboard mode" error I think
a @setting would be good for this behavior, the changes subtly alter
the interaction with the rest of the system in a way I don't prefer -
used to be able to simply select text in another app. and middle button
paste it into Leo, now it seems you have to use Ctrl-C in the other
app. for anything except a very immediate paste.

It looks like the changes set the clipboard content sort of on focus
or on update rather than on a new selection, which is probably not
ideal although I can see why catching selection changes would be
trickier.  So maybe two things here, a preference for the old behavior,
and somehow avoiding the unsupported clipboard mode.

Cheers -Terry

> reading settings in C:\Users\Rob\.leo\workbook.leo
> Data set on unsupported clipboard mode. QMimeData object will be
> deleted. cleaning C:\Users\Rob\.leo\spellpyx.txt
> Data set on unsupported clipboard mode. QMimeData object will be
> deleted. Data set on unsupported clipboard mode. QMimeData object
> will be deleted. Data set on unsupported clipboard mode. QMimeData
> object will be deleted.
> 
> 
> ...and many more lines just like it after opening a Leo file.
> 
> Any idea what's causing that and if I should be concerned about it?
> Rob...
> 
> Leo Log Window
> Leo 5.1-final, build 20151120111022, Fri Nov 20 11:10:22 CST 2015
> Git repo info: branch = master, commit = a9465468020e
> Python 3.4.3, PyQt version 5.4.1
> Windows 8 AMD64 (build 6.2.9200) 
> 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


context aware insert-file-name

2015-11-18 Thread 'Terry Brown' via leo-editor
Hi all,

Made some moderately extensive changes to insert-file-name:

Prompt for a file name, then insert it at the cursor position.
This operation is undoable if done in the body pane.

The initial path is made by concatenating path_for_p() and the selected
text, if there is any, or any path like text immediately preceding the
cursor.

basically the behavior in the second para is new.  path_for_p() is
calculated based on @path and @ nodes, starting with the location
of the .leo file.

No change in unit-test pass rate.

Doesn't work in headlines, didn't before either - I think it's intended
to, not a big deal.

I think it's much more useful, I can type

  d = read.csv("~/n/p

and have it start in ~/n/proj/ instead of ~/.leo

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Introspection for Leo

2015-11-16 Thread 'Terry Brown' via leo-editor
On Mon, 16 Nov 2015 04:46:28 -0800 (PST)
john lunzer  wrote:

> I think one way to make Leo more powerful and easier to learn is to
> further expose Leo to itself.
> 
> I recently was messing around with Terry's introspection script which
> lays outs the guts of an opject in a tree format. I did an
> introspection on g. Think of it as a dir(g) on steroids. What if the
> g subtree was alive? What if a Leo tree could represent live python
> object in a running python program, in this case specifically g in
> Leo itself. You could fully interact and modify these live subtrees.

Sort of related, I use vs-eval / vs-last / vs-last-pretty from the
valuespace plugin, described below.

These three commands are things I added to the valuespace plugin in what
I think was a misguided attempt to avoid creating yet another plugin,
thye're really unrelated to valuespace, except that they execute in the
namespace created by the valuespace plugin, c.vs.  Misguided, because I
think they're very useful and more generally understandable than the
rest of the valuespace plugin, which is clever, but complicated.

Having executed some code with vs-eval, I've used the introspection
script to introspect the results by answering "c.vs" to it's
"Introspect what" question.

>From the docs:

vs-eval

Execute the selected text, if any. Select next line of text.
Tries hard to capture the result of from the last expression in the
selected text:

  import datetime
  today = datetime.date.today()

will capture the value of today even though the last line is a
statement, not an expression. Stores results in c.vs['_last'] for
insertion into body by vs-last or vs-last-pretty. Removes common
indentation (textwrap.dedent()) before executing, allowing execution of
indented code. g, c, and p are available to executing code, assignments
are made in the c.vs namespace and persist for the life of c.

vs-last

Insert the last result from vs-eval. Inserted as a string, so
"1\n2\n3\n4" will cover four lines and insert no quotes, for repr()
style insertion use vs-last-pretty.

vs-last-pretty

Insert the last result from vs-eval. Formatted by pprint.pformat(), so
"1\n2\n3\n4" will appear as '"1\n2\n3\n4"', see all vs-last. 

Evaluating expressions 

All expression are evaluated in a context that predefines
Leo's c, g and p vars.



Cheers -Terry

> I do this manually through the IPython plugin (ILeo). It is a little 
> painful because executing scripts has known issues with output and
> pdb doesn't work right when Leo is in ILeo mode. 
> 
> If this concept could be extended to creating a live tree for any
> running python program it could turn Leo into one of the most
> powerful debugging tools available. 
> 
> I give Smalltalk (Pharo) some credit. The entire environement is
> alive and you can mess with any running object you want assuming you
> know what you're looking for.
> 
> Anyway, just a thought. Maybe it can lead to some exciting ideas for 
> Edward. Gotta get this guy Leo motivated again ;)
> 
> 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Import JSON file as tree

2015-11-15 Thread 'Terry Brown' via leo-editor
On Sat, 14 Nov 2015 18:41:24 -0600
"'Terry Brown' via leo-editor" <leo-editor@googlegroups.com> wrote:

> TL;DR: c == c.p should return False, not raise AttributeError, fixed
> on trunk now.

Although that said, my code should probably use "c is c.p", that would
have avoided the problem, but I think the AttributeError was still
wrong.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Import JSON file as tree

2015-11-14 Thread 'Terry Brown' via leo-editor
On Sat, 14 Nov 2015 08:20:51 -0800 (PST)
john lunzer  wrote:

> I tried to search the forums but the google groups search is the
> worst. 
> 
> Has there been any work done to import JSON files as a Leo tree? 
> 
> My idea is that each node would have a headline and an empty body
> until the JSON structure got down to the deepest level of nesting, in
> which case the last nested level would be the body for the previous
> level as the headline?

If you want to view JSON this Chrome extension is nice:
https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc?hl=en

I have some unshared :-/ code that uses Leo's tree for introspection,
so if it made sense to "instantiate" the json, that approach could be
used.

Cheers -Terry

> Any insights would be appreciated. Or if there are free JSON file
> viewers that support a collapsible and malleable tree view (for
> windows) I guess that would work, but Leo seems uniquely qualified to
> handle this task.
> 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Abbreviations

2015-11-14 Thread 'Terry Brown' via leo-editor
On Sat, 14 Nov 2015 07:48:31 -0600
Kent Tenney  wrote:

> declaring
> @string next-placeholder-abbrev = ,,
> 
> with scripting turned off didn't work for me

Could be a temporal sequencing error, i.e. using features before
they're implemented doesn't always work :-)

I've just pushed with abbreviations on by default, Edward can decide if
that goes too far...

 - you can't type ,, now, it selects the next <|placeholder|> or just
   gets replaced with nothing.  I guess failing to find a placeholder
   should yield ",,", although that would be less convenient for
   placeholder use
 - typing html;; gives an html template with a selected placeholder
 - typing date;; gives {|{x=time.asctime()}|} unless
   @bool scripting-abbreviations = True 
   or
   @bool scripting-at-script-nodes = True 

To type ",," you have to type ", ," and delete the space.  But maybe
that's ok, it's a way to let people find abbreviations :-)

Alternatively, we could have a different default "next placeholder"
abbreviation.  Really, does it even need to be an abbreviation?  If it
was a command, you could bind it to any non-inserting key.

Kent - I went with 
  @string abbreviations-next-placeholder = ,,
for consistency with other settings names.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Import JSON file as tree

2015-11-14 Thread 'Terry Brown' via leo-editor
On Sat, 14 Nov 2015 11:34:52 -0800 (PST)
john lunzer <lun...@gmail.com> wrote:

> I wouldn't mind at least taking a glance at your unused code. I
> really would like a fully collapsible tree and again, Leo seems like
> a natural fit. This wouldn't be much trouble to write myself, however
> if there is some code floating around that I can edit that would be
> nice.

Well that was educational - sure I'll post it, just let me test it,
introspect c... crash... huh?  I'm sure I've introspected c before, so
I don't know what's changed to stop it working.

TL;DR: c == c.p should return False, not raise AttributeError, fixed on
trunk now.

Problem is that the code checks for objects already seen in the tree of
objects, and just links (UNL @bookmark) back up the tree, rather than
letting you endlessly expand a tree in a recursion loop, even though
it's only one level at a time, so not a crash, just a trap for the user.

Why it's changed, I don't know, but now when it does this:

for up in tnd.self_and_parents():
if (hasattr(up.v, '_introspection_target') and
getattr(up.v, '_introspection_target') == o):
break

for c -> c.p, it tries c == c.p, no such operator, so then it tries
c.p == c, because
https://docs.python.org/2/reference/datamodel.html#object.__eq__
and that was not checking that "the other" was also a position.

Anyway, code's at

https://github.com/leo-editor/snippets/blob/master/introspect.py

Cheers -Terry

> On Saturday, November 14, 2015 at 12:01:17 PM UTC-5, Terry Brown
> wrote:
> >
> > On Sat, 14 Nov 2015 08:20:51 -0800 (PST) 
> > john lunzer <lun...@gmail.com > wrote: 
> >
> > > I tried to search the forums but the google groups search is the 
> > > worst. 
> > > 
> > > Has there been any work done to import JSON files as a Leo tree? 
> > > 
> > > My idea is that each node would have a headline and an empty body 
> > > until the JSON structure got down to the deepest level of
> > > nesting, in which case the last nested level would be the body
> > > for the previous level as the headline? 
> >
> > If you want to view JSON this Chrome extension is nice: 
> >
> > https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc?hl=en
> >  
> >
> > I have some unshared :-/ code that uses Leo's tree for
> > introspection, so if it made sense to "instantiate" the json, that
> > approach could be used. 
> >
> > Cheers -Terry 
> >
> > > Any insights would be appreciated. Or if there are free JSON file 
> > > viewers that support a collapsible and malleable tree view (for 
> > > windows) I guess that would work, but Leo seems uniquely
> > > qualified to handle this task. 
> > > 
> >
> 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Abbreviations

2015-11-13 Thread 'Terry Brown' via leo-editor
On Fri, 13 Nov 2015 08:21:47 -0600
Kent Tenney  wrote:

> I have the following abbrev def:
> 
> svg;;=http://www.w3.org/2000/svg;
> \:xmlns:xlink="http://www.w3.org/1999/xlink;
> \:width="<|width|>" height="<|height|>" viewBox="<|viewbox|>"
> \:xml:lang="en">
> \:
> 
> 
> When I type svg;; it appears as desired, with 'width' selected and
> focused I enter a number, type double comma and get
> 
> width="200,," height="<|height|>" viewBox="<|viewbox|>"
> 
> enable-abbreviations and scripting-abbreviations are True

and as John mentioned you have 

  ,,={|{x='__NEXT_PLACEHOLDER'}|}

in the `@data abbreviations` node?

do 

c.frame.log.clearLog()
g.es(c.config.getData('abbreviations'))

to check you're not getting more than one `@data abbreviations` node in
the mix

It's working for me, so if the above doesn't help, you're going to need
to try a vanilla setup and track down what's different.  I assume
you're running a recent build, ,, was broken at one point many months
back.

Cheers -Terry

> Thanks,
> Kent
> 
> Leo 5.1-final, build 20151028094354, Wed Oct 28 09:43:54 CDT 2015
> Git repo info: branch = master, commit = 1f46364de6bc
> Python 2.7.6, PyQt version 4.8.6
> linux2
> 
> 
> 
> On Fri, Nov 13, 2015 at 7:09 AM, john lunzer  wrote:
> > Abbreviations are the cat's pajamas. Definitely a great feature to
> > have. My double comma shortcut is working correctly.
> >
> > Unfortunately abbreviations are notoriously difficult to set up.
> >
> > Two settings need to be present in your myLeoSettings.py under your
> > @settings node:
> >
> > @bool enable-abbreviations = True
> >
> > @bool scripting-abbreviations = True
> >
> >
> > In addition you need a "@data abbreviations" node (this can be
> > found in leo\config\exampleSettings.leo) under your @settings node
> > which contains :
> >
> > # special case, causes core to select next place holder for editing
> > ,,={|{x='__NEXT_PLACEHOLDER'}|}
> >
> >
> > And for the funner more advanced abbreviations you need "@data
> > abbreviations-subst-env" from leoSettings.leo under your @settings
> > node.
> >
> > If ensuring you have those in place doesn't work we need to get
> > Terry involved, but hopefully it shouldn't come to that.
> >
> > On Friday, November 13, 2015 at 7:41:57 AM UTC-5, Kent Tenney wrote:
> >>
> >> Why am I not making more use of these, they look
> >> to be the cat's pajamas.
> >>
> >> Is the double comma capability working for others?
> >>
> >> 
> >> Abbreviations can define templates in which ``<|a-field-name|>``
> >> denotes a field to be filled in::
> >>
> >> input;;= >> \:name="<|name|>"
> >> \:value="" id="<|id|>">\n
> >>
> >> Typing ``,,`` after inserting a template selects the next field.
> >> 
> >>
> >> I find the first field is handled correctly, double comma just
> >> emits the commas.
> >>
> >> Thanks,
> >> Kent
> >
> > --
> > 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 http://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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Abbreviations

2015-11-13 Thread 'Terry Brown' via leo-editor
On Fri, 13 Nov 2015 12:33:11 -0600
Kent Tenney <kten...@gmail.com> wrote:

> Terry's suggestion of substitution only, no code sounds doable.
> Would it be possible to provide next-field by some means
> other than via code-running?

It's mostly that way already, the `,,={|{x='__NEXT_PLACEHOLDER'}|}`
piece is really just a shim to let you choose the abbreviation for
`next placeholder`, can easily be @string next-placeholder-abbrev.

So file an enhancement issue referencing this discussion - I say that
because this is my pseudo last day at my current job (leaving for a
similar job, same location), so I know I'm not going to get to it in
the very short term at least :-)

Cheers -Terry

> That would provide the expected snippet capability, turning on
> generic code-running would be wrapped in a warning.
> 
> On Fri, Nov 13, 2015 at 12:00 PM, john lunzer <lun...@gmail.com>
> wrote:
> > I agree that Leo abbreviations are one of if not the most powerful
> > "snippet" implementations I've ever seen.
> >
> > I also just learned about @outline-data tree-abbreviations which can
> > actually insert whole nodes and subtrees!
> >
> > I've pushed for abbreviations to be more on by default but I backed
> > off with Edward and Terry citing (legitimate) security concerns.
> > With great power comes great responsibility I guess. Hiding that
> > power just a little bit seems... necessary.
> >
> > On Friday, November 13, 2015 at 11:42:00 AM UTC-5, Kent Tenney
> > wrote:
> >>
> >> > and as John mentioned you have
> >>
> >> >  ,,={|{x='__NEXT_PLACEHOLDER'}|}
> >>
> >> > in the `@data abbreviations` node?
> >>
> >> Of course not, I'm an idiot.
> >> Much better now, having followed directions.
> >>
> >> Other editors make a big deal of snippet capability not nearly
> >> as nice as this. Is there a reason it's not available by default?
> >>
> >> Thanks,
> >> Kent
> >>
> >> On Fri, Nov 13, 2015 at 9:55 AM, 'Terry Brown' via leo-editor
> >> <leo-e...@googlegroups.com> wrote:
> >> > On Fri, 13 Nov 2015 08:21:47 -0600
> >> > Kent Tenney <kte...@gmail.com> wrote:
> >> >
> >> >> I have the following abbrev def:
> >> >> 
> >> >> svg;;=http://www.w3.org/2000/svg;
> >> >> \:xmlns:xlink="http://www.w3.org/1999/xlink;
> >> >> \:width="<|width|>" height="<|height|>" viewBox="<|viewbox|>"
> >> >> \:xml:lang="en">
> >> >> \:
> >> >> 
> >> >>
> >> >> When I type svg;; it appears as desired, with 'width' selected
> >> >> and focused I enter a number, type double comma and get
> >> >>
> >> >> width="200,," height="<|height|>" viewBox="<|viewbox|>"
> >> >>
> >> >> enable-abbreviations and scripting-abbreviations are True
> >> >
> >> > and as John mentioned you have
> >> >
> >> >   ,,={|{x='__NEXT_PLACEHOLDER'}|}
> >> >
> >> > in the `@data abbreviations` node?
> >> >
> >> > do
> >> >
> >> > c.frame.log.clearLog()
> >> > g.es(c.config.getData('abbreviations'))
> >> >
> >> > to check you're not getting more than one `@data abbreviations`
> >> > node in the mix
> >> >
> >> > It's working for me, so if the above doesn't help, you're going
> >> > to need to try a vanilla setup and track down what's different.
> >> > I assume you're running a recent build, ,, was broken at one
> >> > point many months back.
> >> >
> >> > Cheers -Terry
> >> >
> >> >> Thanks,
> >> >> Kent
> >> >>
> >> >> Leo 5.1-final, build 20151028094354, Wed Oct 28 09:43:54 CDT
> >> >> 2015 Git repo info: branch = master, commit = 1f46364de6bc
> >> >> Python 2.7.6, PyQt version 4.8.6
> >> >> linux2
> >> >>
> >> >> On Fri, Nov 13, 2015 at 7:09 AM, john lunzer <lun...@gmail.com>
> >> >> wrote:
> >> >> > Abbreviations are the cat's pajamas. Definitely a great
> >> >> > feature to have. My double comma shortcut is working
> >> >> > correctly.
> >> >

Re: My last lecture. Part 1: Why Leo is noteworthy

2015-11-05 Thread 'Terry Brown' via leo-editor
On Thu, 5 Nov 2015 09:50:32 -0800
Don Dwiggins  wrote:

> Well, I wouldn't go as far as Marcel, but there is a tension here 
> between brevity and general comprehensibility.  Ed, you've lived and 
> breathed Leo for years, so those particular single letter names are 
> probably etched in your neural circuitry.  Others, however, might
> have more difficulty learning to ready "Leo-speak" fluently, and the
> single letter names could well create some cognitive interference.
> 
> Personally, I'd be satisfied if I could add, at least for personal
> use, some TLA synonyms.

If c / p / g were called current_outline, position, globals, then most
Leo code would start:

  c, p, g = current_outline, position, globals

inversely, you can start your code:

  outln, pos, globals = c, p, g

if that helps, although it seems it would only be helpful for a short
while.

Cheers -Terry

> On 10/22/15 7:20 AM, Marcel Franke wrote:
> >
> > Edward K. Ream wrote:
> >
> > ​Unconvincing.​
> >
> >
> > What surprise...
> >
> >
> >
> > ​The naming principle I use is this: the more important the
> > name, the shorter it should be.
> >
> > That is obvious, and it is still wrong.
> >
> >
> >
> > If you want your comments to be taken seriously, you should
> > refrain from nit picking.
> >
> >
> > No wonder that Leos codebase is so bad, with that attitude. Well,
> > it needs an expert to make a sparkler.
> >
> > And now I understand why leo after 15 years or so is still just a
> > pebble.
> >
> >
> >
> > I could defend the names I have chosen
> >
> >
> > Funny that you don't even understand the problem; but thinking
> > about, that was to be excepted.
> >
> >
> > But well, thanks anyway, for not much of effort. At least I can now 
> > finally rank Leo and literate programming accordingly.
> >
> >
> >
> > I'm out.
> >
> > So long, and thanks for all the fish.
> >
> >
> >
> > -- 
> > 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 http://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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Possible pylint/goto-global-line bug and lost in Leo's internals

2015-11-05 Thread 'Terry Brown' via leo-editor
On Thu, 5 Nov 2015 10:01:15 -0800 (PST)
john lunzer  wrote:

> Well I figured part of it out, gotoCommands.py is missing from
> LeoPyRef.leo in core classes --> command classes.
> 
> I would make the change to this myself but after I make the changes
> to LeoPyRef.leo my nodes are starting to look funny in the .leo file,
> for example this:

I've seen that kind of change before.  What does g.es(p.v.u) show on
the changed node, or its decedent?  Wondering if it's a particular
plugin unnecessarily leaving greasy fingerprints on things.

Cheers -Terry

>  t="ekr.20150514035236.1">@file ../commands/abbrevCommands.py
> 
> turned into this:
> 
>  descendentVnodeUnknownAttributes="7d710055013071017d7102550b6c696e65594f73657471034b0073732e">@file
>  
> ../commands/abbrevCommands.py
> 
> Not sure what to make of that change but I thought I'd verify what
> that mean before checking it in.
> 
> On Thursday, November 5, 2015 at 12:42:46 PM UTC-5, john lunzer wrote:
> >
> > I've gotten quite lost quite fast while trying to track down a
> > possible bug with pylint and goto-global-line. I can't figure out
> > which is the culprit and I'm struggling to make my way through
> > Leo's source to track it down.
> >
> > I've included my leo file which has a test file in it. After having
> > the outline create the file do right click "Run Pylint" and then
> > get the line number where it complains about "import pudb" and then
> > use that line number in the goto-global-line command. In my most
> > recent version of Leo it brings me to three line above the import
> > line which is exactly the amount of leo directives in that same
> > node. 
> >
> > I've gotten lost because in searching through the source code I
> > appear to be finding calls to functions that don't have definitions
> > or finding definitions which have no calls. For example I appear
> > unable to find the definition of c.gotoCommand.find_script_line
> > using either find-def, quicksearch, or built in find.
> >
> > I would appreciate any help on where I've gone wrong!
> >
> 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Session doesn't recognize mapped network locations on restore

2015-11-05 Thread 'Terry Brown' via leo-editor
On Thu, 5 Nov 2015 17:38:10 -0800 (PST)
Largo84  wrote:

> Haven't seen any replies so I'm wondering if I should post this as a
> bug?
> 
> Rob..

I think it would make sense to add it to the bug tracker.  I vaguely
remember a discussion about this long ago.  Wonder if Python 3's path
handling would help, but that's not really a solution.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: How to position body at beginning of text

2015-10-30 Thread 'Terry Brown' via leo-editor
On Fri, 30 Oct 2015 13:51:03 -0500
Kent Tenney  wrote:

> My script pastes into the node body:
> p.b = some_text
> 
> at which point, the body displays the end of 'some_text',
> I want to be looking at the beginning of the text

c.frame.body.wrapper.setInsertPoint(0)
c.frame.body.wrapper.seeInsertPoint()

maybe?

Cheers -Terry

> I've tried
> c.frame.body.widget.moveCursor(0,0)
> and
> c.frame.body.widget.setFocus(0)
> 
> without success
> 
> Suggestions?
> 
> Thanks,
> Kent
> 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: quicksearch - Nav tab hard crashes Leo

2015-10-28 Thread 'Terry Brown' via leo-editor
On Wed, 28 Oct 2015 06:54:18 -0700 (PDT)
john lunzer  wrote:

> Okay, this was caused by moving QApplication from QtGui in PyQt4 to 
> QtWidgets in PyQt5. Newest commit should fix it, though I can't test
> it myself. Please let me know if this clears things up!

Ha, decided to run py3 / qt5 just to see where things were at, and
found the same bug in the de-clutter code, so fixed that.  I don't see
any issues with 8a0ca9602 for py3 / qt5 Nav except I'm not sure if
keyboard focus is working as it should, seems in py27 / qt 4
hitting enter after typing the search target gives keyboard focus to
the Nav list allowing arrow key navigation, but in py3 / qt5 focus goes
to the body.  Annoying when qt behaviors differ that way.

Cheers -Terry

> On Wednesday, October 28, 2015 at 9:28:38 AM UTC-4, lewis wrote:
> >
> > Hi John,
> >
> > Appreciate the quick response. I just tested again and Leo survives 
> > pressing enter and a list of hits is presented. If I select a hit
> > Leo crashes.
> >
> > ** isPython3: True
> > Leo 5.1-final, build 20151027155247, Tue Oct 27 15:52:47 CDT 2015
> > Git repo info: branch = master, commit = 7037cdd07abf
> > Python 3.4.3, PyQt version 5.5.1
> > Windows 7 AMD64 (build 6.1.7601) SP1
> > reading settings in N:\leo\workbook.leo
> > Traceback (most recent call last):
> >   File "n:\git\leo-editor\leo\plugins\quicksearch.py", line 693, in 
> > onSelectItem
> >
> > modifiers = QtGui.QApplication.keyboardModifiers()
> > AttributeError: 'module' object has no attribute 'QApplication'
> > [end]
> >
> > 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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Added "Show Parents" option to quicksearch

2015-10-27 Thread 'Terry Brown' via leo-editor
On Tue, 27 Oct 2015 12:17:04 -0700 (PDT)
john lunzer  wrote:

> This adds a further level of indentation to the quicksearch results
> and groups all results by their parent node. 

nice - I was already finding the node level grouping useful.

I added some code so Ctrl-click deletes an item and its children, based
on indentation.  This seems useful, because now you know where the hits
are, you may also know you're not interested in them, and you shouldn't
have to scroll down past them to get to the ones you did want.

Unfortunately it's a hidden feature, better would be a close widget for
each item down the right hand side of the list, but I think that would
be quite a bit more complicated, requiring an alternative list item
widget.

Cheers -Terry

> Matches in nodes at
> level 0 are grouped in a custom "Root" parent. "n hits" now
> accurately represents the number of occurrences in both headlines and
> bodies throughout the body. 
> 
> This addition has already proven extremely useful. I'm dealing with a
> lot of subclassing and I get multiple matches from re-implementing
> empty base methods. Now my results are distinguishable and get me to
> where I want to go fast.
> 
> Please let me know if you have any problems. Changes should be fairly
> well contained so I don't expect any issues. 
> 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Added "Show Parents" option to quicksearch

2015-10-27 Thread 'Terry Brown' via leo-editor
On Tue, 27 Oct 2015 16:45:13 -0700 (PDT)
john lunzer <lun...@gmail.com> wrote:

> Thanks for that Terry, I was going to implement something similar and
> may still for the delete key. 

Good idea.  You can refactor the code to reuse my snippet - no need for
two of us to find out that hiding the selected item in the item selected
handler causes infinite recursion - sure, it seems obvious now :-)

Cheers -Terry

> My method for implementing these uses
> event handlers and I can make the event handler specific to a
> specific widget, so in this case a list widget specific event
> handler. But the day was getting long and I decided to commit what I
> had. With the Ctrl+Click I may be too lazy to even implement the
> event handler...
> 
> It doesn't have to be hidden if it's documented! Even the delete key
> would be a hidden feature because I'm sure most people wouldn't even
> think to press it when in the list. 
> 
> On Tuesday, October 27, 2015 at 4:58:33 PM UTC-4, Terry Brown wrote:
> >
> > On Tue, 27 Oct 2015 12:17:04 -0700 (PDT) 
> > john lunzer <lun...@gmail.com > wrote: 
> >
> > > This adds a further level of indentation to the quicksearch
> > > results and groups all results by their parent node. 
> >
> > nice - I was already finding the node level grouping useful. 
> >
> > I added some code so Ctrl-click deletes an item and its children,
> > based on indentation.  This seems useful, because now you know
> > where the hits are, you may also know you're not interested in
> > them, and you shouldn't have to scroll down past them to get to the
> > ones you did want. 
> >
> > Unfortunately it's a hidden feature, better would be a close widget
> > for each item down the right hand side of the list, but I think
> > that would be quite a bit more complicated, requiring an
> > alternative list item widget. 
> >
> > Cheers -Terry 
> >
> > > Matches in nodes at 
> > > level 0 are grouped in a custom "Root" parent. "n hits" now 
> > > accurately represents the number of occurrences in both headlines
> > > and bodies throughout the body. 
> > > 
> > > This addition has already proven extremely useful. I'm dealing
> > > with a lot of subclassing and I get multiple matches from
> > > re-implementing empty base methods. Now my results are
> > > distinguishable and get me to where I want to go fast. 
> > > 
> > > Please let me know if you have any problems. Changes should be
> > > fairly well contained so I don't expect any issues. 
> > > 
> >
> 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Made with Leo

2015-10-20 Thread 'Terry Brown' via leo-editor
This is sort of in response to the Last Lecture thread and why Leo is
noteworthy.

The attached is "made with Leo", although, to be fair, Blender also
contributed :-)

I was working on an org. chart, a chart of the structure of an
organization (so shoot me now, I guess ;-).  Two simple @buttons
plus Leo's tree made what would have been a too much work to bother
with task easy.

I would copy paste the names of all the organizational units into a
node.  The the first @button would remove everything except the
upper case letters, giving me the abbreviations I wanted.  Even if done
with a regex search and replace, it would still have been convenient to
have the button.  It was done with [i for i in p.b is not i.islower()],
which is arguably simpler than a regex.

Then select all / cut / paste-as-headlines to make the modified text
into a set of child nodes.  Repeat for each organizational level.

Then another button converted the tree to a graphviz .dot format for
rendering.  I happened to notice that graphviz can do 3D layout, which
is what inspired the 3D view, that wasn't really part of the task :)

This seems like a good example of Leo as a data explorer / editor.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Making Leo easier to install

2015-10-14 Thread 'Terry Brown' via leo-editor
On Wed, 14 Oct 2015 12:09:23 -0500
Kent Tenney  wrote:

> VirtualBox is an app you download and install,
> then you download the VM.
> 
> VirtualBox runs the VM, offering a desktop which acts like a real
> computer, so it's still 2 step, but easy to do and a fairly common way
> to offer configuration-free evaluation of software.

Hmm, seems like cracking a nut with a sledgehammer for Leo though.  I
can see that approach for software that maybe acts as a web-server
using a database etc., but it's a lot of download for just trying Leo.
OTOH with a fast connection it might be ok for some people.  You should
use a free OS in the VM though, so while introducing people to Ubuntu
that way might be a good trick, it may also be confusing.

But the biggest issue I see is that setting up access from the VM to
the users local files could be tricky, and I assume people would want
that.

> Docker is entirely free, not sure what the subscription refers to. It
> also requires installing executables to run the docker files. A
> multi step process and as I understand it, meant to provide services
> rather than a gui environment.

Right, I don't think Docker is applicable.

Can't remember whether "everything in one folder" was working for
Windows, by everything I mean Python and PyQt as well, thought I had
that working some time ago.  Not sure which Windows to target now, that
was probably Win 7.

Cheers -Terry

> On Wed, Oct 14, 2015 at 11:06 AM, Edward K. Ream
>  wrote:
> > I had an enjoyable conversation with Kent Tenney yesterday on this
> > topic. Here are some notes, with some additional thoughts.
> >
> > tl;dr: Only one-step solutions would seem to be a real improvements.
> > Possibilities include pip install and executable files that create
> > VM's.
> >
> > I welcome any comments.  Installation is really not my field.
> >
> > = Background
> >
> > Leo is already fairly easy to install, which makes significant
> > improvements more challenging. Indeed, the short form of the
> > installation guide is:
> >
> > A. Install Python.
> > B. Install the version of Qt that matches the Python version.
> > C. Install Leo using Leo's single-click installer, or using git
> > clone.
> >
> > = One-step solutions
> >
> > To do significantly better than this would require a one-step
> > solution.
> >
> > There are at least two possibilities:
> >
> > Option 1: a do-everything executable file.
> >
> > In essence, this file would be a VM (Virtual Machine) containing:
> >
> > A. Some version of Python.
> > B. The matching version of Qt.
> > C. All files installed by Leo's installer, including documentation,
> > example files, and the entire installed contents of the
> > leo-editor/leo folder.
> >
> > Yes, this will be a large .exe file, but that can't be helped.
> >
> > PortableApps is a Windows only solution.
> >
> > Option 2: pip install leo-editor full
> >
> > The effect would presumably be similar to option 1.  This would be
> > more convenient for the user (assuming it can be done) provided the
> > user already has pip installed.  Otherwise this is a two-step
> > solution.  On Windows, installing pip is non-trivial.
> >
> > = Other Possibilities
> >
> > Kent mentioned the possibility of creating docker containers. But
> > this would require installing docker, unless I am missing
> > something.  Also, the docker subscription service costs
> > $150/month.  It may be possible to using a free hosting service,
> > but I'm not sure about that.
> >
> > Similarly, VirtualBox can create, (if I understand correctly), self
> > contained VM's.  But like docker, VirtualBox must be installed by
> > the user, making this a two-step solution.
> >
> > On the Mac, Leo could be delivered as a Homebrew formula (assuming
> > we ever figure out how ;-), but again, Homebrew itself must be
> > installed first.
> >
> > = Summary
> >
> > 1. The only true one-step solution is like to be an executable file
> > containing a VM containing everything needed to run Leo.
> > PortableApps is such, but is Windows only.
> >
> > 2. pip install (Linux and maybe Windows) and Homebrew formulas are
> > almost one-step solutions in the sense that both pip and Homebrew
> > are commonly installed.
> >
> > 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 http://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 

Re: Recent small changes to quicksearch plugin

2015-10-07 Thread 'Terry Brown' via leo-editor
On Wed, 7 Oct 2015 10:18:06 -0700 (PDT)
john lunzer  wrote:

> I implemented a filter which removes duplicate headline matches and I
> added a 4-space indent to body matches which makes a huge difference
> visually especially when there are multiple body matches. 

Great idea, looks good.

> I plan* to add a "group by parent" check box which will identify the
> parent of each match and then report matches in with an additional
> indentation under the reported parent node. 

Not 100% sure I follow - would the listed hits be collapsible (or
simply deletable would do) so you could zero in on relevant hits?  Or
maybe collapse / delete would be a handy way of dismissing irrelevant
hits... I guess I'm interpreting your description as a hierarchical
listing?

Cheers -Terry 

> *by plan I mean it might happen in a couple months, hopefully
> sooner :) 
> 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Recent small changes to quicksearch plugin

2015-10-07 Thread 'Terry Brown' via leo-editor
On Wed, 7 Oct 2015 16:25:03 -0700 (PDT)
john lunzer <lun...@gmail.com> wrote:

> I don't think you're misinterpreting. It is a hierarchical listing.
> My thought comes from my own use case where I'm working with many
> subclasses which implement empty base class functions and when I get
> the results I can't tell which hit is hit, if I was able to see the
> parent node then I would be able to tell the hits apart. I think
> being able to delete or collapse these would be a good idea, but
> would require a bit more work than what I had in mind ;) I'll
> consider the design, I think changing it to a tree would be the best
> way to get a collapsible listing. 

Well... best way maybe, but seeing it's a transient search result
and collapsing still leaves a row for the results you weren't
interested in I think delete would be just as good if not better, and if
you're going to do delete... I bet you could do it easily in the
current list approach, just delete list items from here down until you
hit one with equal indentation :-)

Cheers -Terry

> On Wednesday, October 7, 2015 at 4:41:05 PM UTC-4, Terry Brown wrote:
> >
> > On Wed, 7 Oct 2015 10:18:06 -0700 (PDT) 
> > john lunzer <lun...@gmail.com > wrote: 
> >
> > > I implemented a filter which removes duplicate headline matches
> > > and I added a 4-space indent to body matches which makes a huge
> > > difference visually especially when there are multiple body
> > > matches. 
> >
> > Great idea, looks good. 
> >
> > > I plan* to add a "group by parent" check box which will identify
> > > the parent of each match and then report matches in with an
> > > additional indentation under the reported parent node. 
> >
> > Not 100% sure I follow - would the listed hits be collapsible (or 
> > simply deletable would do) so you could zero in on relevant hits?
> > Or maybe collapse / delete would be a handy way of dismissing
> > irrelevant hits... I guess I'm interpreting your description as a
> > hierarchical listing? 
> >
> > Cheers -Terry 
> >
> > > *by plan I mean it might happen in a couple months, hopefully 
> > > sooner :) 
> > > 
> >
> 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Hip replacement

2015-09-30 Thread 'Terry Brown' via leo-editor
I got a text from Edward:

  "Surgery went very well" 

So hopefully the recovery will too. 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Hip will be replaced on Sept 29

2015-09-27 Thread 'Terry Brown' via leo-editor
On Sun, 27 Sep 2015 13:19:35 -0700 (PDT)
"Edward K. Ream"  wrote:

> I've been focusing on the upcoming surgery lately.  It will probably
> be about two weeks before I'll be able to answer email.
> 
> Edward
> 

Best wishes for the op. and a speedy recovery.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Off Topic: productivity software you can't live without

2015-09-23 Thread 'Terry Brown' via leo-editor
It has a learning curve but I'm finding the tiling window manager `i3`
https://i3wm.org/ makes having to think about window placement seem
quaint.  Unlike another tiling window manager, ratpoison, which was too
absolute in it's "don't use the mouse" world view, i3 has more sensible
"use the mouse if you want" behavior, although you end up not using it.

Unfortunately a quick search showed nothing really comparable for
Windows, but maybe I missed one.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: A note to new users

2015-09-22 Thread 'Terry Brown' via leo-editor
On Tue, 22 Sep 2015 07:30:21 -0700 (PDT)
Marcel Franke  wrote:

> > I find Leo's features to be an invaluable tool in my profession that
> > I've struggled to find elsewhere. 
>
> Which one, besides the outline?

For me, one example, editing XML, a simple DB definition.  Editing the
XML using Leo's XML editing "leo2xml", not editing XML directly, which
is not something you should be doing regularly.  So I want the field
I'm editing and all following fields in the table I'm defining to have
their "allow_null" attribute set to "true".  It's so simple to add a
menu entry that does this, that in less time than it would take to fix
one table manually I have a command to do it that's persistent for all
future such editing.

My unstated requirement in the above is being able to write the above
functionality in Python, the language I use for many other tasks, not a
language I only use to modify an editor.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: [again] Leo 5.0-final in MAC lost font control?

2015-09-21 Thread 'Terry Brown' via leo-editor
On Tue, 22 Sep 2015 01:30:18 +0800
"Zoom.Quiet"  wrote:

> the log is :
> Leo Log Window
> Leo 5.0-final, build 20141124101406, Mon Nov 24 10:14:06 CST 2014

Hi - I think font / settings / theme stuff has changed since Leo
5.0-final - is it possible for you to upgrade to the most recent
version: http://leoeditor.com/download.html - that probably won't fix
your problem, but it will make it easier for your problem to be
debugged / supported.

If possible I would recommend the Snapshot version "Latest".

Cheers -Terry

> Not running from a git repo
> Python 2.7.10, PyQt version 4.8.6
> darwin
> setting leoID from os.getenv('USER'): 'zoomq'
> load dir: /opt/bin/Leo5.0-final/leo/core
> global config dir: /opt/bin/Leo5.0-final/leo/config
> home dir: /Users/zoomq
> reading settings in /opt/bin/Leo5.0-final/leo/config/leoSettings.leo
> reading settings in /Users/zoomq/.leo/myLeoSettings.leo
> @openwith lines must start with a tag:
> 'subprocess.Popen',['pythonw','C:/Python24/Lib/idlelib/idle.pyw'],'.py'
> @openwith lines must start with a tag: 'subprocess.Popen','C:/Program
> Files/Microsoft Office/Office/WINWORD.exe',None
> conflicting key bindings in myLeoSettings.leo
>all Ctrl+Shift+Key-0 delete-comments
>all Ctrl+Shift+Key-0 delete-comments
> reading settings in /Users/zoomq/.leo/workbook.leo
> traverse no settings tree for workbook.leo
> reading: /Users/zoomq/.leo/workbook.leo
> 
> 
> font config in
> /Users/zoomq/.leo/myLeoSettings.leo#@settings-->Fonts-->@font body
> text font is
> body_text_font_family = Input
> # YaHei Consolas Hybrid
> # Monaco
> # YaHei Consolas Hybrid
> body_text_font_size = 18
> # 14 & 16 look great
> body_text_font_slant = None
> body_text_font_weight = None
> 
> in/opt/bin/Leo5.0-final/leo/config/leoSettings.leo#
> is:
> 
> @settings-->Appearance (change these first)
> -->Qt Gui settings
> -->Fonts
> -->Basic Fonts (change these first)
> -->@string font-family = Input, M+ 1m,Monoid, Hack,Anonymous Pro
> 
> the system fonts as snap. in atta.
> 
> but reboot Leo or MAC OS X
> the Leo body fonts is not any changed;
> 
> what happy? how to fixed?
> 
> thanx for all .
> 
> 
> On Thu, May 21, 2015 at 9:51 AM, Zoom.Quiet 
> wrote:
> > Hummm
> > myself fixed it;
> > just copy fonts into /Library/Fonts/
> > ;-)
> >
> > 2015-05-19 19:12 GMT+08:00 Zoom.Quiet :
> >> my local env:
> >> - Leo Log Window
> >> Leo 5.0-final, build 20141124101406, Mon Nov 24 10:14:06 CST 2014
> >> Not running from a git repo
> >> Python 2.7.9, PyQt version 4.8.6
> >> darwin
> >>
> >> - MAC OS X 10.10.3 (14D136)
> >> - appended on SSD ,so reinstall OS X, and ln -s old usr env as
> >>
> >> /Users -> /Volumes/Macintosh HD/Users/
> >>
> >> so some odd, such as :
> >>
> >> $ fc-list | grep hei
> >> /Users/zoomq/Library/Fonts/wqy-zenhei.ttc:
> >> 文泉驿点阵正黑,文泉驛點陣正黑,WenQuanYi Zen Hei Sharp:style=Regular
> >> /Users/zoomq/Library/Fonts/wqy-zenhei.ttc:
> >> 文泉驿等宽正黑,文泉驛等寬正黑,WenQuanYi Zen Hei Mono:style=Regular
> >> /Users/zoomq/Library/Fonts/Monaco_Yahei.ttf:
> >> 微软雅黑Monaco,Microsoft
> >> YaHei:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
> >>  /Library/Fonts/Lantinghei.ttc:
> >> 兰亭黑\-简,蘭亭黑\-簡,Lantinghei
> >> SC:style=Heavy,特黑 /Users/zoomq/Library/Fonts/wqy-microhei-lite.ttc:
> >> 文泉驿等宽微米黑,文泉驛等寬微米黑,WenQuanYi Micro Hei Mono
> >> Light:style=Light /Library/Fonts/Lantinghei.ttc: 兰亭黑\-
> >> 繁,蘭亭黑\-繁,Lantinghei
> >> TC:style=Heavy,特黑 /Users/zoomq/Library/Fonts/wqy-microhei.ttc:
> >> 文泉驿微米黑,文泉驛微米黑,WenQuanYi Micro
> >> Hei:style=Regular /Users/zoomq/Library/Fonts/wqy-microhei-lite.ttc:
> >> 文泉驿微米黑,文泉驛微米黑,WenQuanYi Micro Hei
> >> Light:style=Light /Library/Fonts/Lantinghei.ttc: 兰亭黑\-
> >> 繁,蘭亭黑\-繁,Lantinghei
> >> TC:style=Demibold,中黑 /Library/Fonts/Lantinghei.ttc: 兰亭黑\-
> >> 简,蘭亭黑\-簡,Lantinghei
> >> SC:style=Demibold,中黑 /Users/zoomq/Library/Fonts/wqy-microhei.ttc:
> >> 文泉驿等宽微米黑,文泉驛等寬微米黑,WenQuanYi Micro Hei
> >> Mono:style=Regular /Users/zoomq/Library/Fonts/wqy-zenhei.ttc:
> >> 文泉驿正黑,文泉驛正黑,WenQuanYi Zen
> >> Hei:style=Regular /Library/Fonts/Lantinghei.ttc: 兰亭黑\-
> >> 繁,蘭亭黑\-繁,Lantinghei
> >> TC:style=纤黑,纖黑,Extralight /Library/Fonts/Lantinghei.ttc:
> >> 兰亭黑\-简,蘭亭黑\-簡,Lantinghei SC:style=纤黑,纖黑,Extralight
> >>
> >> but in system tools can not see them fonts!
> >>
> >> so i try config fonts in Leo, such as atta. snap,
> >> in:
> >> /opt/bin/Leo5.0-final/leo/config/leoSettings.leo#@settings-->Appearance
> >> (change these first)-->Qt Gui settings-->Fonts-->Basic Fonts
> >> (change these first)
> >>
> >> and:
> >>
> >> /Users/zoomq/.leo/myLeoSettings.leo#@settings-->Fonts
> >>
> >> all can not working
> 
> ...
> 

-- 
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, 

Re: A note to new users

2015-09-21 Thread 'Terry Brown' via leo-editor
On Mon, 21 Sep 2015 14:13:18 -0500
"Edward K. Ream"  wrote:

> On Mon, Sep 21, 2015 at 2:11 AM, Marcel Franke <
> kugelfischtemp...@googlemail.com> wrote:
> 
> >
> > john lunzer wrote:
> >
> > The lack of outlining feels like a handicap at best and trying to
> > program
> >> nearly blind at worst.
> >>
> >
> > Did you try the code-outline-plugins of vim or emacs? For vim it's
> > "tagbar", for emacs i think it was "speedbar".
> >
> 
> ​Thanks for these links. speedbar
> looks interesting.  It would
> certainly be a starting point for a Leonine mode. 

I used Emacs speedbar back when I used to use Emacs.  I can't remember
the complete list of things you could view in it, but the two major
ones were source as a tree with nodes to jump to functions etc... :-)
and the filesystem (activepath.py plugin, in other words).
Perhaps some sort of bookmarks too?  Anyway, unless I'm forgetting
something, I wonder what it has that's not core Leo or covered by
plugins.

Which is not to say there aren't applications or modes of operation in
speedbar that we couldn't use.

Cheers -Terry

> And
> SemanticBovinator 
> looks interesting as an alternative to Leo's importers.  Still there
> would be a *long* way to go to make either vim or emacs a Leonine
> environment.
> 
> 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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Learning from IPython

2015-09-15 Thread 'Terry Brown' via leo-editor
On Tue, 15 Sep 2015 07:53:57 -0700 (PDT)
"Edward K. Ream"  wrote:

> More interestingly Leo could use IPython's scheme of basing code
> completion of live objects, provided users are willing to execute the
> code in an outline.  Yes, this could be dangerous, and people must be
> aware of the dangers.

Leo can already do this after a fasion via my additions[1] to the
valuespace plugin.

e.g.

  csv.

No Completions

  import csv

select that text, and `vs-eval`.

  csv.

Normal completion occurs.

  csv.reader?

Docs. shown in log window.

`vs-eval` selects the next line after executing one selected line, so
it's easy to step through code.  You have to select multi-line blocks
for it though, things like for loops.
vs-last(-pretty) just insert the result of the last vs-eval into the
body.

[1] vs-eval, vs-last, and vs-last-pretty are commands I shoehorned into
valuespace to avoid creating yet another plugin.  The execute /
evaluate in the c.vs namespace created by valuespace.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing visual clutter in Tree

2015-08-31 Thread 'Terry Brown' via leo-editor
On Mon, 31 Aug 2015 08:37:25 -0700 (PDT)
john lunzer <lun...@gmail.com> wrote:

> When I save a Leo outline all of my icons disappear? The next
> headline update will restore them. Anyone seeing similar behavior?

No, although I can see how that could happen.  The visual-declutter
code clears all the icons it inserted based on rules before the save,
so that you're not left with a file riddled with "virtual" icons mixed
with icons you may have added manually yourself and want to keep.  I.e.
if you disable the declutter code, all it's icons should disappear.  You
would think it would need to put them back after the save, but I'm not
seeing them disappear.

Hmm, so based on the code I would expect the problem you report,
because of 
leo-editor/leo/core/LeoPy.leo#Code-->Qt gui-->@file 
../plugins/qt_tree.py-->qtree.Drawing-->qtree.full_redraw & 
helpers-->qtree.clear_visual_icons

But I don't see the problem.  The solution would be to add 
  self.declutter_update = True
to the above clear_visual_icons() - can you try that and see if the
problem goes away?

Cheers -Terry

> On Monday, August 17, 2015 at 3:06:38 PM UTC-4, Terry Brown wrote:
> >
> > On Mon, 17 Aug 2015 05:09:55 -0700 (PDT) 
> > john lunzer <lun...@gmail.com > wrote: 
> >
> > > I've discovered a visual glitch when using the rules for the task 
> > > icons. After the icon has been added by the declutter feature if
> > > I then attempt to edit the headline again by making it shorter 
> > > (backspace or delete) the original headline seems to get "burned
> > > in" 
> >
> > Thought that was going to be a tough one but seemed simple after
> > all, very lightly tested but seems to be fixed (and pushed). 
> >
> > Cheers -Terry 
> >
> > > behind the editable headline box so that the end of the original 
> > > headline still shows. Interestingly if I make a change and then
> > > press Ctrl + z (undo) then everything seems fine and the original
> > > headline is no longer "burned in" in the background. 
> > > 
> > > On Wednesday, August 12, 2015 at 11:56:07 AM UTC-4, john lunzer
> > > wrote: 
> > > > 
> > > > Also, kudos for collapsing leoSettings.leo again before
> > > > pushing, so that 
> > > >> it looks right when opened. 
> > > >> 
> > > > 
> > > > If that happened it was purely by accident :) Though I will 
> > > > certainly remember to do so in the future. 
> > > > 
> > > > On Wednesday, August 12, 2015 at 11:14:07 AM UTC-4, Terry Brown 
> > > > wrote: 
> > > >> 
> > > >> On Wed, 12 Aug 2015 04:57:16 -0700 (PDT) 
> > > >> john lunzer <lun...@gmail.com> wrote: 
> > > >> 
> > > >> > Just pushed @path/active-path icons in the latest commit.
> > > >> > Check the updated tree-declutter-patterns in leoSettings.leo
> > > >> > for the accompanying rules. No need to use them of course
> > > >> > but I think they make a big difference when using
> > > >> > active-path. 
> > > >> 
> > > >> Like the way you handle removed files. 
> > > >> 
> > > >> Also, kudos for collapsing leoSettings.leo again before
> > > >> pushing, so that it looks right when opened. 
> > > >> 
> > > >> Cheers -Terry 
> > > >> 
> > > >> > On Tuesday, August 11, 2015 at 8:18:30 AM UTC-4, john lunzer 
> > > >> > wrote: 
> > > >> > > 
> > > >> > > Terry, the rule for showing the last part of filenames can
> > > >> > > be improved to better support windows users: 
> > > >> > > 
> > > >> > > # show the last part of long filenames 
> > > >> > > 
> > > >> > > RULE ^.{1,1000}([/\\])(.{30}) 
> > > >> > > 
> > > >> > > REPLACE …\1\2 
> > > >> > > 
> > > >> > > 
> > > >> > > The first capture group with faithfully respect the use of 
> > > >> > > backslashes in windows paths. (I like 30 instead of 20, no 
> > > >> > > need to change that though) 
> > > >> > > 
> > > >> > > 
> > > >> > > On Monday, August 10, 2015 at 5:09:42 PM UTC-4, john
> > > >> > > lunzer wrote: 
> > > >> > >> 
> > > >> > >> Thanks

Re: Continued abbreviation woes for new users

2015-08-29 Thread 'Terry Brown' via leo-editor
On Sat, 29 Aug 2015 11:43:24 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 The title of this post plays off past titles by new users. I've just
 had an email exchange with a new user who was thoroughly confused
 with abbreviations. Basically he just wanted to use the hl;;
 abbreviation for inserting the headline text into a body but could
 get them working. This is no surprise as the information regarding
 getting abbreviations working is spread across five different
 locations: 
 
- YouTube
- http://leoeditor.com/abbreviations.html 
- http://leoeditor.com/commands
- leoSettings.leo
- exampleSettings.leo. 
 
 No single location provides all the necessary information to make
 full use of abbreviations. Furthermore it is impossible to get to
 abbreviations.html from the leo search (this bug is documented).

I think there's a fix on the way for searching on http://leoeditor.com/

exampleSettings.leo sounds like a bad place for anything to send up,
seeing I didn't even know it existed.

 My proposal is to enable abbreviations AND scripting-abbreviations by 
 default to help spread their use. They're very useful and very
 powerful. I don't see how they are any more of a security risk that
 Ctrl+B (exec current node). Assuming a malicious contributor was able
 to sneak in a dangerous abbreviation it would be highly unlikely that
 a user would accidentally type in even something as simple as a;; to
 execute it. 
 
 Please let me know your thoughts.

I don't think you're very good at malice :-)  If I wanted someone to
trigger evil code by typing an abbreviation, I'd probably go with
and rather than a;; :-)

So the scenario is getting a .leo file from someone malicious; how
easily can that file do harm?  Well, the code base *tries* to block
the most obvious routes - Ctrl-B I hadn't really thought of but that's
something you have to do consciously, even though realistically just
putting the bad stuff far enough down the page to make it harder to see
is obviously a risk.  But bottom line you deliberately (finger fumbles
aside) executed code from a source your were choosing to trust.

I'd like to hear what Edward thinks.  But the other fix is to make
enabling abbreviations easy to discover and easy to do, with maybe a
warning about the risk thrown in.

There's the Abbrev menu under the Cmds menu and the possibility of
adding things under the Settings menu - the new Edit settings menu
could link to / help manage abbreviation relevant @settings.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Recent commit adds subtree only and node capability to quicksearch plugin

2015-08-27 Thread 'Terry Brown' via leo-editor
On Thu, 27 Aug 2015 09:42:22 -0500
Edward K. Ream edream...@gmail.com wrote:

 On Wed, Aug 26, 2015 at 9:53 AM, john lunzer lun...@gmail.com wrote:
 
  I've done limited testing. This is my first commit that is likely to
  affect many other people's daily flow. Please let me know if I've
  broken anything.
 
 
 ​I don't really care what kind of testing any developer does, as long
 as they make *sure* to run all unit tests within a minute or two of a
 push.  I says this because I often push on Windows and then test on
 my much-faster Linux machine.  If a test fails, I then immediately
 correct the trunk.

I must admit that I don't always run the unit tests because sometimes I
know there's no coverage in the area I'm working.  But when I do, this
is how I do it:

Commit my changes locally, and then do

  rm -rf /tmp/.leo
  HOME=/tmp python launchLeo.py leo/test/unitTest.leo

this runs vanilla Leo without my personal settings etc.

Then I select the node Active Unit Tests and press Alt-4.

Tests run, there's a count of failures in the console when it's done.

Then I close Leo, check out the commit before my changes, usually 
`git checkout HEAD~1` and repeat.

If the count of failures is the same before and after my changes I
assume everything's ok.  Remember to `git checkout master` to get
your changes back.

There seem to be 9-13 failures on my system currently, I don't think
the test environment translates across machines perfectly.  It would be
nice if master typically had zero failures on it so you only needed to
run tests post changes and evaluate new failures, but I think it might
be a lot of work to get zero failures on arbitrary systems.

Cheers -Terry

 Furthermore, not all unit tests necessarily have to pass on all
 platforms. Just make sure that no *new* unit tests fail as the result
 of your new 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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Apply Leo's main stylesheet to plugin window

2015-08-27 Thread 'Terry Brown' via leo-editor
On Thu, 27 Aug 2015 13:05:57 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 I sort of checked this out, enough to think that it might be overkill
 for my plugin. For one under no circumstances would I expect my
 plugin to be put into a pane, it's window is too small for that. 

I don't think there's a lower size limit below which interface
components don't warrant their own pane, it's more a question of
always popup behavior vs. sometimes want it to hang around behavior.
Even then, free_layout supports popup behavior through the Open
window behavior.  You only need to cover the 'minimal' case at the end
of
https://github.com/leo-editor/snippets/blob/master/examples/demo_widget.py,
not the whole palaver shown first.

Having said that, 
(1)
leo-editor/leo/core/LeoPy.leo#Code--Qt gui--@file 
../plugins/nested_splitter.py--class NestedSplitter (QSplitter)--open_window
shows how free layout copies the style, instead of w = self.root you
could do w = c.frame.top or something.

Or based on 
leo-editor/leo/core/LeoPy.leo#Code--Qt gui--@file 
../plugins/qt_gui.py--class StyleSheetManager--ssm.set selected_style_sheet

you could get the sheet from 
(2)
c.styleSheetManager.get_master_widget(c.frame.top).styleSheet()

That's probably the best way.

Cheers -Terry

 So beyond that I was searching through some of Leo's source and I saw
 a pattern that seemed like it might fit the bill:
 
 self.sheet = c.config.getData('qt-gui-plugin-style-sheet')
 
 if self.sheet:
 
 self.sheet = '\n'.join(self.sheet)
 
 self.setStyleSheet(self.sheet)
 
 However... when inspecting the stylesheet I see that the @ colors are
 still there, nothing has been substituted. What am I doing wrong?
 
 On Tuesday, August 25, 2015 at 3:49:35 PM UTC-4, john lunzer wrote:
 
  Sounds like a plan, I'll check it out soon, thanks for the link to
  the demo widget.
 
  On Tuesday, August 25, 2015 at 1:18:30 PM UTC-4, Terry Brown wrote:
 
  On Tue, 25 Aug 2015 10:14:17 -0700 (PDT) 
  john lunzer lun...@gmail.com wrote: 
 
   I'm at the point where I'm trying to convert my quick-replace 
   @command to a plugin and I looked around in the current plugins
   but I couldn't find an example of how I apply Leo's main
   stylesheet to floating QtWidgets. I'm trying to match Leo's look
   and feel. Any guidance would be greatly appreciated. 
 
  I'd aim for free_layout integration. 
 
  https://github.com/leo-editor/snippets/blob/master/examples/demo_widget.py 
 
  then your widget can be mixed into the pane layout in the main
  window or opened in its own window (which supports panes and other
  widgets too).  I think this will handle the stylesheet thing as
  well. 
 
  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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Apply Leo's main stylesheet to plugin window

2015-08-27 Thread 'Terry Brown' via leo-editor
On Thu, 27 Aug 2015 15:38:22 -0500
'Terry Brown' via leo-editor leo-editor@googlegroups.com wrote:

 c.styleSheetManager.get_master_widget(c.frame.top).styleSheet()

Just for completeness, c.config.getData('qt-gui-plugin-style-sheet')
wasn't a bad idea, but it would be something like

c.styleSheetManager.expand_css_constants(c.config.getData('qt-gui-plugin-style-sheet'))
 +
c.styleSheetManager.expand_css_constants(c.config.getData('qt-gui-user-style-sheet'))

Definitely better to grab the existing one.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Apply Leo's main stylesheet to plugin window

2015-08-27 Thread 'Terry Brown' via leo-editor
On Thu, 27 Aug 2015 13:57:08 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 Thanks Terry, I'll check out free_layout in the future but for the
 moment I think this will get me there (I think there will be less 
 redesign/refactoring this way). Thanks for pointing me in the right 
 direction.

Sure - just to be sure we're on the same page, which seems like it
should be a pun in this context but somehow isn't :-)

  c.styleSheetManager.get_master_widget(c.frame.top).styleSheet()

seems like the easiest way.

Cheers -Terry


 On Thursday, August 27, 2015 at 4:40:41 PM UTC-4, Terry Brown wrote:
 
  On Thu, 27 Aug 2015 15:38:22 -0500 
  'Terry Brown' via leo-editor leo-e...@googlegroups.com
  javascript: wrote: 
 
   c.styleSheetManager.get_master_widget(c.frame.top).styleSheet() 
 
  Just for completeness,
  c.config.getData('qt-gui-plugin-style-sheet') wasn't a bad idea,
  but it would be something like 
 
  c.styleSheetManager.expand_css_constants(c.config.getData('qt-gui-plugin-style-sheet'))
   
  + 
  c.styleSheetManager.expand_css_constants(c.config.getData('qt-gui-user-style-sheet'))
   
 
 
  Definitely better to grab the existing one. 
 
  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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Recent commit adds subtree only and node capability to quicksearch plugin

2015-08-26 Thread 'Terry Brown' via leo-editor
On Wed, 26 Aug 2015 08:50:13 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 As C.S Lewis put it, “if you do one good deed your reward usually is
 to be set to do another and harder and better one.” 
 
 I can certainly attempt to extend that dropdown to add in below
 current node or something a little shorter.
 
 For the other functionality what did you have in mind? Were you
 thinking Changed and Timeline buttons over next to the combo box?

Well, I'd be inclined to sneak them into the combo. just to save
space... would mean checking the change event on that combo, but
otherwise similar to buttons.  Unless you think it's confusing vs. what
should happen when search text is entered - I guess when Changed or
Timeline was selected it could just display the relevant list and
then change the combo. back to All.

Cheers -Terry

 On Wednesday, August 26, 2015 at 11:32:28 AM UTC-4, Terry Brown wrote:
 
  On Wed, 26 Aug 2015 07:53:09 -0700 (PDT) 
  john lunzer lun...@gmail.com javascript: wrote: 
 
   I've done limited testing. This is my first commit that is likely
   to affect many other people's daily flow. Please let me know if
   I've broken anything. 
   
   Also comments are welcome on my changes. I had to copy out some
   code out of leo core into one of the quicksearch classes to
   enable subtree and node only searching. It's a little messy... 
   
   Anyway this is a feature I've wanted for quite some time. 
 
  Very nice - I've often found myself wanting subtree only in
  quicksearch. Now that you've got the UI set up, another variation
  would be Following nodes only - hmm, hard to pick a descriptive
  term, but I mean sometimes I've wanted quicksearch to only search
  this node and nodes below it in the outline, i.e what you get
  from calling p.threadNext until p becomes invalid.  That would
  iterate clones multiple times though. 
 
  In fact... now you've extended the interface, I wonder if there's a 
  convenient way to provide access to some of the other things you
  can display in the Nav pane - find-quick-changed and
  find-quick-timeline show nodes that have changed since last save,
  and nodes in most to least recent creation order.  See how you good
  work is rewarded ;-) 
 
  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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: versions, re-install, etc.

2015-08-26 Thread 'Terry Brown' via leo-editor
On Wed, 26 Aug 2015 06:17:19 -0700 (PDT)
Todd Mars tamn...@gmail.com wrote:

 I have some trouble because I had to downgrade py to 2.7 to use npm,
 so: (now I have py33 and py27 on the 'puter)
 1) Is it necessary to uninstall old version of Leo to install new
 version? 2) To run Leo I use cmd and change folder to:
  C:\Python33\Lib\site-packages\Leo-4.11-final
  Then I execute this: \python33\python launchleo.py

I don't see any particular problems with your approach.  I've never
installed to site-packages, when you try the latest version personally
I would either use git or just unpack the plain .zip version
https://github.com/leo-editor/leo-editor/archive/master.zip
somewhere convenient and proceed as above, cd'ing to the folder
containing launchLeo.py

PyQt installations are specific to the Python version you run, so I
have Python 2.7 / PyQt 4.x and Python 3.4 / PyQt 5.x, and there's only
ever been one version of Leo for both 2.x and 3.x

The one place you could hit trouble is with pickled attributes in some
plugin attributes, there was an issue with todo.py and dates for a
while, but I think it's fixed now.

Cheers -Terry

 Is this the best way to do it? (I'm updating an older laptop on my 
 vacation, and will upgrade to latest Leo of course!)
 Thanks plenty!
 Todd
 
 
 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Recent commit adds subtree only and node capability to quicksearch plugin

2015-08-26 Thread 'Terry Brown' via leo-editor
On Wed, 26 Aug 2015 07:53:09 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 I've done limited testing. This is my first commit that is likely to
 affect many other people's daily flow. Please let me know if I've
 broken anything.
 
 Also comments are welcome on my changes. I had to copy out some code
 out of leo core into one of the quicksearch classes to enable subtree
 and node only searching. It's a little messy...
 
 Anyway this is a feature I've wanted for quite some time.

Very nice - I've often found myself wanting subtree only in quicksearch.
Now that you've got the UI set up, another variation would be
Following nodes only - hmm, hard to pick a descriptive term, but I
mean sometimes I've wanted quicksearch to only search this node and
nodes below it in the outline, i.e what you get from calling
p.threadNext until p becomes invalid.  That would iterate clones
multiple times though.

In fact... now you've extended the interface, I wonder if there's a
convenient way to provide access to some of the other things you can
display in the Nav pane - find-quick-changed and find-quick-timeline
show nodes that have changed since last save, and nodes in most to
least recent creation order.  See how you good work is rewarded ;-)

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Apply Leo's main stylesheet to plugin window

2015-08-25 Thread 'Terry Brown' via leo-editor
On Tue, 25 Aug 2015 10:14:17 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 I'm at the point where I'm trying to convert my quick-replace
 @command to a plugin and I looked around in the current plugins but I
 couldn't find an example of how I apply Leo's main stylesheet to
 floating QtWidgets. I'm trying to match Leo's look and feel. Any
 guidance would be greatly appreciated.

I'd aim for free_layout integration.

https://github.com/leo-editor/snippets/blob/master/examples/demo_widget.py

then your widget can be mixed into the pane layout in the main window
or opened in its own window (which supports panes and other widgets
too).  I think this will handle the stylesheet thing as well.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Running a Qt application with Ctrl-B

2015-08-25 Thread 'Terry Brown' via leo-editor
On Tue, 25 Aug 2015 03:26:58 -0700 (PDT)
reinhard.engel...@googlemail.com wrote:

 May be this is a stupid question:
 I'm trying to import a large Qt application into Leo. For testing, I 
 created a script in a single node with the headline '@clean
 QtTest.pyw)' and the following body:
 
 @language python
 @tabwidth -4
 
 import sys
 
 from PyQt5.QtCore import QObject
 from PyQt5.QtWidgets import QApplication, QWidget
 
 class Application(QWidget):
 
 def __init__(self):
 
 QObject.__init__(self)
 self.setGeometry(100, 100, 400, 300)
 self.setWindowTitle('QtTest')
 
 if __name__ == '__main__':
 app = QApplication([])
 form = Application()
 form.show()
 sys.exit(app.exec_())

Leo executes Python code in the interpreter that runs Leo.  Seeing that
interpreter has a QApplication, you can't have another.  Also, if it's
executing the `if __name__ == '__main__':` block, and it seems like it
is, sys.exit() is going to bring everything to an end.

So, to execute from Leo, just do the form = Application(); 
form.show() part, avoid the `app =`  and sys.exit() parts.

Or make a separate script button like:

  import os
  os.system(python /path/to/QtTest.pyw)

(or use subprocess.Popen, but if you just want the app to run to see
the impact of changes, os.system is probably sufficient)

Cheers -Terry

 From the command line, this script runs without problems (using
 'python QtTest.pyw').
 But if I try to execute the script in the node (using Ctrl-B), Leo 
 disappears, the Qt window is opened and immediately closed. I want
 Leo stay visibly in the background and the Qt window in the
 foreground until it is closed explicitly.
 
 What do I miss?
 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: NEW: Edit Settings menu

2015-08-25 Thread 'Terry Brown' via leo-editor
On Tue, 25 Aug 2015 10:18:47 -0700 (PDT)
Edward K. Ream edream...@gmail.com wrote:

 On Tuesday, August 25, 2015 at 9:53:01 AM UTC-5, Edward K. Ream wrote:
 
  ...it's time to declare that configuration setting should never be 
 cached. Instead code should always call c.config.getX.  We shouldn't 
 sacrifice flexibility to save a few millionths of a second here and
 there.
 
 There is an alternative, namely to call x.updateSettings for all
 classes x that have an updateSettings method.  This would re-cache
 settings.  

In the absence of evidence to the contrary (which no one is looking
for ;-) I'm ok with don't cache as a rule, and converting existing
self.foo = c.config.get... lines.

I doubt there's many cases that are causing much friction except
styles, abbreviations, and key-bindings.  I think the last two have
their own methods for run-time changes, but it would be nice if you
only needed to know about settings and Reload settings would deal
with those three.  Note there is no Reload settings just now, it's
Reload styles.

Cheers -Terry

 I'm not sure which is the simplest thing that could possibly work. On
 the one hand, declaring that caching shouldn't happen is a global
 constraint. Otoh, adding updateSettings methods for classes that
 cache settings is more work.  Using updateSettings has the advantage
 that it is explicit, so maybe it's better despite the new
 infrastructure to call all x.updateSettings. It's a close call, imo.
 
 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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: NEW: Edit Settings menu

2015-08-24 Thread 'Terry Brown' via leo-editor
On Mon, 24 Aug 2015 09:21:36 -0500
Edward K. Ream edream...@gmail.com wrote:

[snip]
  Again, wordy, but I think easy enough to understand.
 
 ​I agree.  And even if the user hits cancel, they now have know
 what's available and where.​

Right, I think this menu based setting editing which tells you what
it's doing and why very quickly empowers the user to understand how to
do it themselves.

 Note Reload settings isn't working as effectively as I think it
  should, that may need to be addressed as well.  Unrelated to the new
  code.
 
 ​Reload settings is going to be a project, for several reasons.  Many
 classes cache settings so they don't have to keep calling
 c.config.getX. This is/was purely an abbreviation, but caching a
 setting means that it's impossible to change the setting. Going
 through the code an replacing the abbreviations with dynamic calls
 to c.config.getX isn't rocked science, it's merely tedious and
 perhaps error prone. ​

I was really only referring to Reload settings to see appearance
changes, which I think should work.  I thought it used to work,
although checkout some old revisions didn't hit a point where it did.
Maybe it's just not rebuilding / re-applying the stylesheet when it
should.

Certainly a lot of classes cache settings, I've done it often enough
when I'm concerned that the code is heavily used in UI updates etc. and
self.some_int seems faster than self.c.config.getInt('some_int'),
although in reality the difference may not be important.

Cheers -Terry

  So, this isn't a silver bullet for the newbie setting editing woes,
  but it does eliminate a lot of the Leo specific knowledge required
  (apart from edit a headline).  Also this new approach can be
  developed further based on feedback, just wanted to get what I had
  so far into the main branch for testing etc.
 
 ​I approve.  It's a reasonable middle ground.  Imo, it's better
 than .ini files (not Leonine) or gui-based ways to change settings.
 5 or 10 years ago I played around with such a thing.  It will never
 be a good idea.
 
 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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: NEW: Edit Settings menu

2015-08-24 Thread 'Terry Brown' via leo-editor
On Mon, 24 Aug 2015 09:30:19 -0500
Kent Tenney kten...@gmail.com wrote:

 I'm very late to the appearance party.
 
 The edit settings menu is great, it exposes the workings
 in a way that simplifies while educating. By following the
 links and reading the text I quickly learn how Leo does it.
 
 I loaded the Colors node into myLeoSettings.leo and changed
 the value of
 @color body-bg = white
 to
 @color body-bg = yellow
 
 I saved, revert to saved, no change, closed and re-opened, no change,
 it seems colors are being configured elsewhere ...

One thing I intended but forgot to mention is that Edit settings is
really only guaranteed to work with a fairly vanilla Leo setup,
particularly if you're using any theme or older stylesheet that doesn't
get parameterized by the settings in 
leo/config/leoSettings.leo#@settings--Appearance (change these first)--Qt Gui 
settings
or their local overrides, then it won't have a lot of effect.

So more work is needed to make sure that that distributed themes are
parameterized by those settings, we need to not have the default theme use
body-bg and another theme use body-background for example.  Themes
can use whatever settings and style code they want, but they should use
the same parameters where-ever possible.  It would be possible to add
theme specific entries to the new menu, but lets get themes working
better in general first.

Also the new menu only provides management of the settings in 
leo/config/leoSettings.leo#@settings--Appearance (change these first)--Qt Gui 
settings
I didn't do any checking to see that they're all used in the default
stylesheet that's parameterized with them.  I typically just tested
font size and family, which seemed to work fine as long as you
re-opened an outline.

Cheers -Terry

 I did
 alt-x print-settings
 ...
 [M] bodybg = yellow
 ...
 
 odd, in the settings pane, among the expected listings are a bunch
 like t tx=tbrown.201508217150.66status-border-style/t
 
 
 On Sun, Aug 23, 2015 at 11:50 AM, 'Terry Brown' via leo-editor
 leo-editor@googlegroups.com wrote:
  There's now an Edit settings menu under the main Settings menu.
 
  It's not going to make everyone (anyone?) happy, you still have to
  edit the content of a Leo headline to change font size etc.  The new
  functionality is that it finds the appropriate setting and copies
  it to the appropriate outline for you, so knowing what to look for
  and how to manage it is handled.
 
  Sometimes you'll see this:
 
  The relevant setting, '@bookmarks_base_color', is using the
  value of a more general setting, '@text-foreground'.  Would you
  like to edit the more specific setting, '@bookmarks_base_color', or
  the more general setting, '@text-foreground'?  The more general
  setting may alter appearance / behavior in more places, which may
  or may not be what you prefer.
 
  Edit specific   Edit general   Cancel
 
  Wordy, but I think easy enough to follow.  I guess everything after
  the last comma could be deleted :-)
 
  If the setting is in leoSettings.leo, you see:
 
  The setting '@body-font-family' is in the Leo global
  configuration file 'leoSettings.leo' and should probably be copied
  to 'myLeoSettings.leo' before editing.
  It may make more sense to copy a group or category of settings.
 
  Please enter 1, 2, 3, or 4:
  1. copy the one setting, '@body-font-family'
  2. copy the setting group, 'Body font' (Recommended)
  3. copy the setting whole category, 'Fonts'
  4. edit the setting in 'leoSettings.leo' anyway
 
  Again, wordy, but I think easy enough to understand.
 
  (Having to enter a number to pick an option is clunky, a
   gui-independent 'pick item from list widget' can be added to Leo, I
   just didn't want to mix that task into the current task.)
 
  Note Reload settings isn't working as effectively as I think it
  should, that may need to be addressed as well.  Unrelated to the new
  code.
 
  So, this isn't a silver bullet for the newbie setting editing woes,
  but it does eliminate a lot of the Leo specific knowledge required
  (apart from edit a headline).  Also this new approach can be
  developed further based on feedback, just wanted to get what I had
  so far into the main branch for testing etc.
 
  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
  http://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

Re: NEW: Edit Settings menu

2015-08-24 Thread 'Terry Brown' via leo-editor
On Mon, 24 Aug 2015 08:56:40 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 On Monday, August 24, 2015 at 10:21:37 AM UTC-4, Edward K. Ream wrote:
 
  Note Reload settings isn't working as effectively as I think it
  should, that may need to be addressed as well.  Unrelated to the
  new code.
 
  ​Reload settings is going to be a project, for several reasons.
  Many classes cache settings so they don't have to keep calling
  c.config.getX. This is/was purely an abbreviation, but caching a
  setting means that it's impossible to change the setting. Going
  through the code an replacing the abbreviations with dynamic
  calls to c.config.getX isn't rocked science, it's merely tedious
  and perhaps error prone.
 
 I realize I'm only one voice and my situation may be unique, but the
 lack of being able to reload settings is pretty troublesome for me. I
 do a great deal of my work over slow SVN and I often have to open up
 codebases of hundreds of files. You can imagine that I don't alter
 settings as often as I want to, it often takes me a good 7-10 minutes
 to reopen my outlines to load all of the files. If this could be
 done, however slowly it would likely benefit more than just myself. 

Which settings do you want to by re-loadable?  If they're appearance
related, I think that should work, but currently needs fixing.  Other
misc. things like 'graph-manual-layout' can certainly be addressed
based on what's annoying people :)

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


NEW: Edit Settings menu

2015-08-23 Thread 'Terry Brown' via leo-editor
There's now an Edit settings menu under the main Settings menu.

It's not going to make everyone (anyone?) happy, you still have to edit
the content of a Leo headline to change font size etc.  The new
functionality is that it finds the appropriate setting and copies it to
the appropriate outline for you, so knowing what to look for and how to
manage it is handled.

Sometimes you'll see this:

The relevant setting, '@bookmarks_base_color', is using the value of
a more general setting, '@text-foreground'.  Would you like to edit
the more specific setting, '@bookmarks_base_color', or the more
general setting, '@text-foreground'?  The more general setting may
alter appearance / behavior in more places, which may or may not be
what you prefer.

Edit specific   Edit general   Cancel

Wordy, but I think easy enough to follow.  I guess everything after the
last comma could be deleted :-)

If the setting is in leoSettings.leo, you see:

The setting '@body-font-family' is in the Leo global configuration
file 'leoSettings.leo' and should probably be copied to
'myLeoSettings.leo' before editing.
It may make more sense to copy a group or category of settings.

Please enter 1, 2, 3, or 4:
1. copy the one setting, '@body-font-family'
2. copy the setting group, 'Body font' (Recommended)
3. copy the setting whole category, 'Fonts'
4. edit the setting in 'leoSettings.leo' anyway

Again, wordy, but I think easy enough to understand.

(Having to enter a number to pick an option is clunky, a
 gui-independent 'pick item from list widget' can be added to Leo, I
 just didn't want to mix that task into the current task.)

Note Reload settings isn't working as effectively as I think it
should, that may need to be addressed as well.  Unrelated to the new
code.

So, this isn't a silver bullet for the newbie setting editing woes, but
it does eliminate a lot of the Leo specific knowledge required (apart
from edit a headline).  Also this new approach can be developed
further based on feedback, just wanted to get what I had so far into
the main branch for testing etc.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Increasing the instant appeal of Leo

2015-08-23 Thread 'Terry Brown' via leo-editor
On Sun, 23 Aug 2015 15:51:23 +0300
Ville M. Vainio vivai...@gmail.com wrote:

Ville's still around, good to know ;-)

 2. .ini or .json based configuration (instead of .leo format), again
 like in Sublime Text or VSCode. Current system requires too much Leo
 buy-in already

As it happens I have some almost ready to test code to make Leo
settings editing easier.  It does what we've discussed before, provides
a plain text multi-level menu to locate settings, then handles copying
them from leoSettings.leo to myLeoSettings.leo etc.

I can't see how editing .json (in what?) is easier than editing Leo
outlines in Leo.  .ini might be more familiar, but it feels like a cop
out to say Leo's great at managing hierarchical information, but you
have to use .ini files for this relatively simple case.

 3. See if we could make tabs for node editors (richt click on node -
 open as tab). This is in line with how people use e.g. browsers these
 days. Like stickynote but for tabs, that is

+10 on this, I've been saying for years we want body panes to be well
behaved QWidgets we can stick anywhere.  Now that I finally have the
settings editor helper menu almost done, perhaps this will be my next
focus.  It's not really the stick anywhere part, it's the handling of
multiple body editors that could be expanded.
 
 4. see if we could replace minibuffer with ctrl+shift+p like thing
 from sublime/atom/vscode. Much more impressive and modern.

Probably need more info. beyond the different key binding here ;-)
 
 5. likewise, ctrl+p for quick finding nodes based on fuzzy matching
 on headlines (like subliwe fuzzy matches file names on ctrl+p)

Seems it shouldn't be hard to add fuzzy matching to the Nav pane
(quicksearch plugin).

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Increasing the instant appeal of Leo

2015-08-23 Thread 'Terry Brown' via leo-editor
On Sun, 23 Aug 2015 13:50:14 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

  4. see if we could replace minibuffer with ctrl+shift+p like thing
  from sublime/atom/vscode. Much more impressive and modern.
 
 To terry, this is how sublime works. I agree that the pop-up style is
 more modern but to a greater point, the minibuffer 99% of the time
 is just taking up screen real estate and not doing anything. There is
 not a lot of reason to have it there on the screen unless somebody
 wants it there on the screen

So the easy way is just to style the parent widget hidden when it
doesn't have focus... but then it would bump the layout whenever it was
un-hidden.  Might be worth testing that, I'd like that approach if it
wasn't too disruptive.  If it is too disruptive, then pop-up would make
sense, just have to make sure you get all the special Leo-ness in the
editing of the line (completion etc.).

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Does @clean go too far?

2015-08-21 Thread 'Terry Brown' via leo-editor
On Fri, 21 Aug 2015 10:43:49 -0500
Edward K. Ream edream...@gmail.com wrote:

 On Thu, Aug 20, 2015 at 6:00 AM, Geoff Evans gtevan...@nl.rogers.com
 wrote:
 
  It seems to me that the file produced by an @clean node is not only
  clean but sterile.
 
 
 ​There was a suggestion for @nosent files to generate sentinels
 corresponding to​
 
 ​headlines.
 
 In principle, this could be done with @clean or @shadow, as discussed
 briefly recently.  

There are also the @auto-specialization importer / exporters.

E.g. .../leo/plugins/importers/ctext.py

Just now it seems there might be a regression there, it's failing with 

Traceback (most recent call last):
  File 
/mnt/usr1/usr1/home/tbrown/t/Package/leo/git/leo-editor/leo/core/leoAtFile.py,
 line 3298, in writer_for_at_auto_cb
return aClass(at.c).write(root, forceSentinels=forceSentinels)
TypeError: write() got an unexpected keyword argument 'forceSentinels'

which I didn't immediately find (i.e. didn't find the
offending .write() yet.).

But @auto-ctext is an example of basically a headline driven tree
importer / exporter.

Cheers -Terry

 Not sure whether this can be done easily enough to
 be worth doing.  It's not something that would add a great deal to
 Leo in any case: if you are using Leo the sentinels don't matter.
 
 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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Leo's future

2015-08-18 Thread 'Terry Brown' via leo-editor
On Tue, 18 Aug 2015 10:39:45 -0700 (PDT)
holgersc...@googlemail.com wrote:

 Hi Edward,
 
 I don't know how often this has been asked:
 What if options would not be set via head or body of a node but be 
 attributes of this node?

I think what you're suggesting would be, in Leo terminology, putting
the directives for things like rst processing into the oddly names
unknownAttributes, or v.u (a.k.a. p.v.u) dictionary for storing
arbitrary key/values pairs on a particular node but not in the headline
or body text.

The attrib_edit plugin lets you store node specific attributes this
way, in fact three ways, but one way is in the p.v.u dictionary.  It's
used by the xml_edit plugin.  attrib_edit adds a pane (or tab in the
log pane) displaying each nodes attributes.  Not that it doesn't
display everything in p.v.u, just things identified as attributes.

So technically Leo already has the machinery for what you're suggesting.

But directives have always been represented as text in the headline or
body.  In some ways the recent declutter work is a way of maintaining
that long established pattern but not having it taking up screen space
when you don't need to see it.

To do what you're suggesting and maintain backwards compatibility I
could see some sort of DirectivesManager class which provides
information on the directives specified for a particular node, fetching
them from either head / body @text or p.v.u.  So sub-systems (like rst
handling) upgraded to use it could work either way.

But there would be a lot of codebase wide changes, and it needs more
design thought.  It's possible and not unreasonable, but not trivial.

My response above is about an alternative handling of the
representation of directives for example for rst.

Some of your other comments seem to describe role specific node viewing
and editing.  Really there's quite a lot of the going on in Leo
already.  The todo plugin is an obvious example, but bookmarks,
active_path, graph view, view-rendered etc. are all variations on this
theme.

Cheers -Terry

 Of course not Class attributes but attributes of specific instances
 to keep everything smaller.
 
 Why I'm asking:
 
 Today I tried to integrate my code nodes into my yet to be written 
 bachelor-thesis. 
 And I found out: 
 1) how shortsighted I am (unfortunately a often returning insight)
 2) how to do it
 
 Besides being superhappy now I still wonder about the way to set the 
 options.
 
 One benefit would be 
 (aside from having a cleaner tree and using title and body for what
 they are, that is title and body)  
 that one could imagine other viewers of the codebase.
 
 For example one could have Nodes for developers or versions or
 dates..
 
 A viewer that would help with project development would then
 associate developers and their written code.
 A viewer that would help with project management would organize tasks
 or calendars or dates or whatnot.
 A viewer that would help with file management would show directories
 and files (and maybe lines or shapes or sounds ) as nodes 
  
 What do you think ?
 
 Have viewers that can not be sure that a certain attribute even exist
 but try nevertheless? 
 
 Stupid and useless or worth it ?
 
 Greetings,
 
 Holger
 
 Am Mittwoch, 29. Juli 2015 15:07:44 UTC+2 schrieb Edward K. Ream:
 
  In my mind, all essential aspects of Leo are complete.  Sure, there
  will always be improvements to be made, and I intend to keep making
  them, but now that that we have @clean the most important work is
  complete.
 
  Imo, Leo is good enough as it is.  What's not so good is outreach
  to the rest of the world.  Marketing, if you will.
 
  An excellent suggestion is to reach out to magazine editors, get
  them excited, and have them write or commission articles about
  Leo.  I think this is a great idea, but we haven't made much
  progress on this front.
 
  Recently I've been thinking about creating true Leo modes for
  emacs and vim.  This would be a lot of work.  In essence, this
  would create Emacs and Vim guis.  All other code must remain the
  same, and the gui must (mostly) be written in Python, not elisp or
  vim script.
 
  Your comments, please.
 
  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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: xkcd: Bwahahaha.

2015-08-17 Thread 'Terry Brown' via leo-editor
On Sun, 16 Aug 2015 13:18:23 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 I understand their general purpose but not why that xkcd strip is
 funny. What are people using them for, why post your public key? I've
 encountered public/private key use for encryption a couple times, and
 it wasn't funny. 

Hi John,

You post your public key so that anyone can use it to send you
encrypted messages that no one but you can read, without even having to
make other contact first.  To me the strip is mildly amusing because no
one ever does that, you're basically saying to the world here, send me
a secret message, and the answer is, unsurprisingly, crickets chirping.

If you post your private key instead, you're changing the message to
the world to here, steal my identity, and I guess it's cynically
amusing to suggest that that message would generate much more attention.

But I didn't think it was once of xkcd's most amusing.
https://xkcd.com/353/ and https://xkcd.com/1205/ are a couple of my
favorites, although they're not really funny, exactly, either.

Cheers -Terry

 On Sunday, August 16, 2015 at 11:16:58 AM UTC-4, Jacob Peck wrote:
 
  On 8/16/2015 11:11 AM, Edward K. Ream wrote:
 
  On Sat, Aug 15, 2015 at 7:52 PM, john lunzer lun...@gmail.com 
  javascript: wrote:
 
  I don't get it (even after doing research), I'm definitely not
  cool enough for the internet, but xkcd often makes me feel like an
  inferior life form.
 
 
  ​Private keys must remain private. Otherwise, anyone could read
  what you have encrypted.
 
  Or, worse, anyone could encrypt or sign something and have it
  appear to all the world that you did it (thus the hover text).
  Private key = identity in many cases.
  --Jake
 
  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+...@googlegroups.com javascript:.
  To post to this group, send email to leo-e...@googlegroups.com 
  javascript:.
  Visit this group at http://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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing visual clutter in Tree

2015-08-12 Thread 'Terry Brown' via leo-editor
On Wed, 12 Aug 2015 04:57:16 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 Just pushed @path/active-path icons in the latest commit. Check the
 updated tree-declutter-patterns in leoSettings.leo for the
 accompanying rules. No need to use them of course but I think they
 make a big difference when using active-path.

Like the way you handle removed files.

Also, kudos for collapsing leoSettings.leo again before pushing, so
that it looks right when opened.

Cheers -Terry

 On Tuesday, August 11, 2015 at 8:18:30 AM UTC-4, john lunzer wrote:
 
  Terry, the rule for showing the last part of filenames can be
  improved to better support windows users:
 
  # show the last part of long filenames
 
  RULE ^.{1,1000}([/\\])(.{30})
 
  REPLACE …\1\2
 
 
  The first capture group with faithfully respect the use of
  backslashes in windows paths. (I like 30 instead of 20, no need to
  change that though) 
 
 
  On Monday, August 10, 2015 at 5:09:42 PM UTC-4, john lunzer wrote:
 
  Thanks for the pixel buffer! I've found a pixel buffer of 7 to be
  good. 
 
  Anyway I found an instance in which the headline/icons won't
  update. On the use of edit-headline-long. If you press cancel
  nothing will happen, but if you hit enter then the headline will
  go back to normal and never update until the next update event
  (doesn't need to be the same headline).
 
  On Monday, August 10, 2015 at 10:55:21 AM UTC-4, Terry Brown wrote:
 
  On Mon, 10 Aug 2015 04:43:50 -0700 (PDT) 
  john lunzer lun...@gmail.com wrote: 
 
   Terry, I've noticed that the Icons butt right up against the
   status boxes. Is there any way to add a pixel or two (whichever
   looks best) of buffer between them? 
 
  I've just pushed the addition of a setting 
@int tree-icon-separation = 1 
  which controls icon separation in pixels. 
 
  I also just pushed a fix to a hard crash of Leo when declutter is 
  active and you find two successive search hits in headlines, I
  think what was happening was (quoting commit): 
 
When search results are found in headlines headkey2 fires 
(on the second search hit in a headline), and full_redraw() 
for declutter takes the headline out of edit mode, and Leo
  crashes, probably because the find code didn't expect to leave
  edit mode.  So don't update when a QLineEdit has focus 
 
  I guess I'm not sure if it's the find code or just the editing
  code in general, the fix should handle all cases. 
 
  Cheers -Terry 
 
   On Sunday, August 9, 2015 at 8:28:52 AM UTC-4, john lunzer
   wrote: 

Just delightful. Leo feels immensely more personalized and
dynamic with the declutter feature (as if it already didn't
feel that way). Let's not forget to get this into the
documentation eventually. 

On Saturday, August 8, 2015 at 10:02:48 PM UTC-4, Terry Brown
wrote: 

On Sat, 8 Aug 2015 17:09:56 -0700 (PDT) 
john lunzer lun...@gmail.com wrote: 

 I've actually been thinking about this for a long time,
 but I've wanted to implement parts of the to-do plugin on
 purely text based input. 
 
 So a task that wasn't done would start with [ ] 
 A task that was finished would be [*] 
 and a task that was cancelled would be [x] 
 
 Can I access the task icons in the same way that you're
 access the icons currently with declutter? 

Sure, so the rules would be: 

RULE ^\[ ] (.*) 
REPLACE \1 
ICON cleo/chkboxblk.png 
RULE ^\[\*] (.*) 
REPLACE \1 
ICON cleo/chkblk.png 
RULE ^\[[xX]] (.*) 
REPLACE \1 
ICON cleo/xblk.png 

`cleo` was the name of the plugin that preceeded `todo`, if
you didn't know. 

Also I just updated the rules in leoSettings.py, they do the
same thing, I just eliminated an editing artifact.  They
were like 

RULE ^@(clean) (.*) 
REPLACE \2 

and are now like 

RULE ^@clean (.*) 
REPLACE \1 

Cheers -Terry 

 On Saturday, August 8, 2015 at 1:52:20 PM UTC-4, Terry
 Brown wrote: 
  
  On Sat, 8 Aug 2015 10:45:37 -0700 (PDT) 
  john lunzer lun...@gmail.com javascript: wrote: 
  
   Not sure if you had come across this but different
   rules can co-exist. For example along with all the
   @file type directives I have .py files specifically
   bolded and both the rule for adding the icon and the
   rule for bolding co-exist without issue. This just
   keeps getting better! I assume there could be some
   issues if the rules affected the same style aspects. 
  
  The rules are just applied in sequence.  Only gotcha is
  that if the first rule replaces `@clean ` with something
  else, subsequent rules that match `@clean ` won't fire -
  but I can't see when that would be a problem, and you
  can control the order. 
  
  Cheers -Terry 
  
   On Saturday, August 8, 2015 at 1:39:03 PM UTC-4, john
   lunzer wrote

icons and paths (related to declutter)

2015-08-10 Thread 'Terry Brown' via leo-editor
Icon paths are handled specially by Leo to accommodate themes.

So, rather than 

  ICON Tango/16x16/places/folder_inv.png

you would just say

  ICON Tango/16x16/places/folder.png

and Leo will check first

  .../leo/themes/theme_name/Icons/Tango/16x16/places/folder.png
(and some other places themes might be) and then
  .../leo/Icons/Tango/16x16/places/folder.png

For simplicity and rather than creating a sparse Tango/16x16/ directory
layout in themes/theme_name/Icons I'd just copy the regular Tango
icon to .../leo/Icons/file_icons/ and the inverse version to
.../leo/themes/theme_name/Icons/file_icons/

Of course this assumes a one to one mapping between themes and icons,
it gets more complicated when we have several different sets of icons
to choose from, thanks Andrea :-).  We could perhaps put them in
.../leo/Icons/file_icons/v[1-6] and then people can just add v3 etc. before
references to file icons in the declutter rules.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing visual clutter in Tree

2015-08-10 Thread 'Terry Brown' via leo-editor
On Mon, 10 Aug 2015 04:43:50 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 Terry, I've noticed that the Icons butt right up against the status
 boxes. Is there any way to add a pixel or two (whichever looks best)
 of buffer between them?

I've just pushed the addition of a setting 
  @int tree-icon-separation = 1
which controls icon separation in pixels.

I also just pushed a fix to a hard crash of Leo when declutter is
active and you find two successive search hits in headlines, I think
what was happening was (quoting commit):

  When search results are found in headlines headkey2 fires
  (on the second search hit in a headline), and full_redraw()
  for declutter takes the headline out of edit mode, and Leo crashes,
  probably because the find code didn't expect to leave edit
  mode.  So don't update when a QLineEdit has focus

I guess I'm not sure if it's the find code or just the editing code in
general, the fix should handle all cases.

Cheers -Terry

 On Sunday, August 9, 2015 at 8:28:52 AM UTC-4, john lunzer wrote:
 
  Just delightful. Leo feels immensely more personalized and dynamic
  with the declutter feature (as if it already didn't feel that way).
  Let's not forget to get this into the documentation eventually.
 
  On Saturday, August 8, 2015 at 10:02:48 PM UTC-4, Terry Brown wrote:
 
  On Sat, 8 Aug 2015 17:09:56 -0700 (PDT) 
  john lunzer lun...@gmail.com wrote: 
 
   I've actually been thinking about this for a long time, but I've 
   wanted to implement parts of the to-do plugin on purely text
   based input. 
   
   So a task that wasn't done would start with [ ] 
   A task that was finished would be [*] 
   and a task that was cancelled would be [x] 
   
   Can I access the task icons in the same way that you're access
   the icons currently with declutter? 
 
  Sure, so the rules would be: 
 
  RULE ^\[ ] (.*) 
  REPLACE \1 
  ICON cleo/chkboxblk.png 
  RULE ^\[\*] (.*) 
  REPLACE \1 
  ICON cleo/chkblk.png 
  RULE ^\[[xX]] (.*) 
  REPLACE \1 
  ICON cleo/xblk.png 
 
  `cleo` was the name of the plugin that preceeded `todo`, if you
  didn't know. 
 
  Also I just updated the rules in leoSettings.py, they do the same 
  thing, I just eliminated an editing artifact.  They were like 
 
  RULE ^@(clean) (.*) 
  REPLACE \2 
 
  and are now like 
 
  RULE ^@clean (.*) 
  REPLACE \1 
 
  Cheers -Terry 
 
   On Saturday, August 8, 2015 at 1:52:20 PM UTC-4, Terry Brown
   wrote: 

On Sat, 8 Aug 2015 10:45:37 -0700 (PDT) 
john lunzer lun...@gmail.com javascript: wrote: 

 Not sure if you had come across this but different rules can 
 co-exist. For example along with all the @file type
 directives I have .py files specifically bolded and both the
 rule for adding the icon and the rule for bolding co-exist
 without issue. This just keeps getting better! I assume
 there could be some issues if the rules affected the same
 style aspects. 

The rules are just applied in sequence.  Only gotcha is that
if the first rule replaces `@clean ` with something else,
subsequent rules that match `@clean ` won't fire - but I can't
see when that would be a problem, and you can control the
order. 

Cheers -Terry 

 On Saturday, August 8, 2015 at 1:39:03 PM UTC-4, john lunzer 
 wrote: 
  
  Just pulled the most recent changes. Auto-update works
  great and the new icons look good. I'll be certain to let
  you know if I come across any issues. 
  
  On Saturday, August 8, 2015 at 1:06:57 PM UTC-4, john
  lunzer wrote: 
  
  Awesome, thanks for the quick updates, I'll check them
  out soon (at the latest on Monday). 
  
  On Saturday, August 8, 2015 at 12:44:44 PM UTC-4, Terry
  Brown wrote: 
  
  Also just pushed some icons for different @file types,
  with support for the leo_dark_0 theme.  See updated
  rules in leo/config/leoSettings.leo#@settings--Tree
  operation--@data tree-declutter-patterns 
  
  Cheers -Terry 
  
  On Sat, 8 Aug 2015 08:59:35 -0500 
  'Terry Brown' via leo-editor
  leo-e...@googlegroups.com wrote: 
  
   On Fri, 7 Aug 2015 14:15:01 -0700 (PDT) 
   john lunzer lun...@gmail.com wrote: 
   
One is that the conversions do not seem to take
place until a certain action occurs in the tree. I
can always get the conversions to happen from
expanding a node (but not contracting a node). It
also seems like sometimes the tree scrolls to a
center a specific node after some conversions. 
   
   I think these issues are fixed in the latest push.  It
   was tricky to get the update to work, it's done on
   idle so you're outside any redraw loop. 
   
   Cheers -Terry 
   
  
  
 

   
 
 
 

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To unsubscribe from this group

Re: Reducing visual clutter in Tree

2015-08-08 Thread 'Terry Brown' via leo-editor
On Fri, 7 Aug 2015 14:15:01 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 One is that the conversions do not seem to take place until a certain
 action occurs in the tree. I can always get the conversions to happen
 from expanding a node (but not contracting a node). It also seems
 like sometimes the tree scrolls to a center a specific node after
 some conversions.

I think these issues are fixed in the latest push.  It was tricky to
get the update to work, it's done on idle so you're outside any redraw
loop.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing visual clutter in Tree

2015-08-08 Thread 'Terry Brown' via leo-editor
Also just pushed some icons for different @file types, with support
for the leo_dark_0 theme.  See updated rules in
leo/config/leoSettings.leo#@settings--Tree operation--@data 
tree-declutter-patterns

Cheers -Terry

On Sat, 8 Aug 2015 08:59:35 -0500
'Terry Brown' via leo-editor leo-editor@googlegroups.com wrote:

 On Fri, 7 Aug 2015 14:15:01 -0700 (PDT)
 john lunzer lun...@gmail.com wrote:
 
  One is that the conversions do not seem to take place until a
  certain action occurs in the tree. I can always get the conversions
  to happen from expanding a node (but not contracting a node). It
  also seems like sometimes the tree scrolls to a center a specific
  node after some conversions.
 
 I think these issues are fixed in the latest push.  It was tricky to
 get the update to work, it's done on idle so you're outside any redraw
 loop.
 
 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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing visual clutter in Tree

2015-08-08 Thread 'Terry Brown' via leo-editor
On Sat, 8 Aug 2015 10:45:37 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 Not sure if you had come across this but different rules can
 co-exist. For example along with all the @file type directives I
 have .py files specifically bolded and both the rule for adding the
 icon and the rule for bolding co-exist without issue. This just keeps
 getting better! I assume there could be some issues if the rules
 affected the same style aspects.

The rules are just applied in sequence.  Only gotcha is that if the
first rule replaces `@clean ` with something else, subsequent rules
that match `@clean ` won't fire - but I can't see when that would be a
problem, and you can control the order.

Cheers -Terry

 On Saturday, August 8, 2015 at 1:39:03 PM UTC-4, john lunzer wrote:
 
  Just pulled the most recent changes. Auto-update works great and
  the new icons look good. I'll be certain to let you know if I come
  across any issues.
 
  On Saturday, August 8, 2015 at 1:06:57 PM UTC-4, john lunzer wrote:
 
  Awesome, thanks for the quick updates, I'll check them out soon
  (at the latest on Monday).
 
  On Saturday, August 8, 2015 at 12:44:44 PM UTC-4, Terry Brown
  wrote:
 
  Also just pushed some icons for different @file types, with
  support for the leo_dark_0 theme.  See updated rules in 
  leo/config/leoSettings.leo#@settings--Tree operation--@data 
  tree-declutter-patterns 
 
  Cheers -Terry 
 
  On Sat, 8 Aug 2015 08:59:35 -0500 
  'Terry Brown' via leo-editor leo-e...@googlegroups.com wrote: 
 
   On Fri, 7 Aug 2015 14:15:01 -0700 (PDT) 
   john lunzer lun...@gmail.com wrote: 
   
One is that the conversions do not seem to take place until a 
certain action occurs in the tree. I can always get the
conversions to happen from expanding a node (but not
contracting a node). It also seems like sometimes the tree
scrolls to a center a specific node after some conversions. 
   
   I think these issues are fixed in the latest push.  It was
   tricky to get the update to work, it's done on idle so you're
   outside any redraw loop. 
   
   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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing visual clutter in Tree

2015-08-08 Thread 'Terry Brown' via leo-editor
On Sat, 8 Aug 2015 17:09:56 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 I've actually been thinking about this for a long time, but I've
 wanted to implement parts of the to-do plugin on purely text based
 input.
 
 So a task that wasn't done would start with [ ]
 A task that was finished would be [*]
 and a task that was cancelled would be [x]
 
 Can I access the task icons in the same way that you're access the
 icons currently with declutter?

Sure, so the rules would be:

RULE ^\[ ] (.*)
REPLACE \1
ICON cleo/chkboxblk.png
RULE ^\[\*] (.*)
REPLACE \1
ICON cleo/chkblk.png
RULE ^\[[xX]] (.*)
REPLACE \1
ICON cleo/xblk.png

`cleo` was the name of the plugin that preceeded `todo`, if you didn't
know.

Also I just updated the rules in leoSettings.py, they do the same
thing, I just eliminated an editing artifact.  They were like

RULE ^@(clean) (.*)
REPLACE \2

and are now like

RULE ^@clean (.*)
REPLACE \1

Cheers -Terry

 On Saturday, August 8, 2015 at 1:52:20 PM UTC-4, Terry Brown wrote:
 
  On Sat, 8 Aug 2015 10:45:37 -0700 (PDT) 
  john lunzer lun...@gmail.com javascript: wrote: 
 
   Not sure if you had come across this but different rules can 
   co-exist. For example along with all the @file type directives I 
   have .py files specifically bolded and both the rule for adding
   the icon and the rule for bolding co-exist without issue. This
   just keeps getting better! I assume there could be some issues if
   the rules affected the same style aspects. 
 
  The rules are just applied in sequence.  Only gotcha is that if the 
  first rule replaces `@clean ` with something else, subsequent rules 
  that match `@clean ` won't fire - but I can't see when that would
  be a problem, and you can control the order. 
 
  Cheers -Terry 
 
   On Saturday, August 8, 2015 at 1:39:03 PM UTC-4, john lunzer
   wrote: 

Just pulled the most recent changes. Auto-update works great
and the new icons look good. I'll be certain to let you know if
I come across any issues. 

On Saturday, August 8, 2015 at 1:06:57 PM UTC-4, john lunzer
wrote: 

Awesome, thanks for the quick updates, I'll check them out
soon (at the latest on Monday). 

On Saturday, August 8, 2015 at 12:44:44 PM UTC-4, Terry Brown 
wrote: 

Also just pushed some icons for different @file types, with 
support for the leo_dark_0 theme.  See updated rules in 
leo/config/leoSettings.leo#@settings--Tree operation--@data 
tree-declutter-patterns 

Cheers -Terry 

On Sat, 8 Aug 2015 08:59:35 -0500 
'Terry Brown' via leo-editor leo-e...@googlegroups.com
wrote: 

 On Fri, 7 Aug 2015 14:15:01 -0700 (PDT) 
 john lunzer lun...@gmail.com wrote: 
 
  One is that the conversions do not seem to take place
  until a certain action occurs in the tree. I can always
  get the conversions to happen from expanding a node (but
  not contracting a node). It also seems like sometimes the
  tree scrolls to a center a specific node after some
  conversions. 
 
 I think these issues are fixed in the latest push.  It was 
 tricky to get the update to work, it's done on idle so
 you're outside any redraw loop. 
 
 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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing visual clutter in Tree

2015-08-07 Thread 'Terry Brown' via leo-editor
On Fri, 7 Aug 2015 14:15:01 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 between nodes. See attached image for a simple example. I've already
 tested it on some of my exceptionally larger .leo files and the
 removal of @clean plus the highlighting of class nodes is simply
 amazing. I am grateful for your work Terry. 

Neat, I hadn't thought of highlighting that sort of thing.

 I'm having a few issues. One is that the conversions do not seem to
 take place until a certain action occurs in the tree. I can always
 get the conversions to happen from expanding a node (but not
 contracting a node). It also seems like sometimes the tree scrolls to
 a center a specific node after some conversions. 

Not sure about the scrolling, but yep, there's no forced update, and I
haven't played with it long enough to decide if that's annoying.  When
you've just edited @clean /some/path/here/then/foo.txt do you want it
to immediately become ✎ …/foo.txt?  OTOH I haven't seen any issues
with speed yet, so probably no big deal to force an update.
 
 Additionally and this is purely a curiosity, if this feature remained
 the way it is I'd be perfectly happy, would it be possible (and 
 straightforward) to implement selected node foreground and background 
 colors, it's slightly disorienting to lose the foreground color when
 the node is highlighted. 

This is where it gets tricky.  I wasn't going to do the FG/BG/FONT
stuff originally, I was going to let you set a style_class attribute
on the widget so that:

  QTreeWidget[style_class~='clean_node'] {
  background-color: @solarized-red;
  }

would let you do any kind of styling you wanted.  But QTreeWidgetItem
is part of a generic model view controller such that it's the same
QTreeWidgetItem used for all nodes, it's only the data that changes.
It seems there must be an underlying real per-node widget that you
could style, but I'm not seeing how you get at it.

So I think the answer is there isn't a specific QTreeWidgetItem for
which to set the :selected style.  But I'm not 100% sure on this.

 I had some crashing as well but I can't reproduce it now. I'll wait
 until it happens again before I post my stack trace unless you're
 really curious. Bravo again!

For sure send any reproducible stack traces.

I'm glad you prodded me into finally trying this, the idea's come up
more than once over several years.

Cheers -Terry

 On Friday, August 7, 2015 at 3:47:47 PM UTC-4, Terry Brown wrote:
 
  p.s. here's a real life example of with and without the change 
  (attached images). 
 
  So in this case it's the show end of path part that's
  contributing more than the make @clean into an icon part,
  although in an active_path directory tree where you only have
  directory names and file names and not long paths, the latter would
  be a big improvement, IMO, 
 
  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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing visual clutter in Tree

2015-08-07 Thread 'Terry Brown' via leo-editor
On Fri, 7 Aug 2015 21:10:31 -0500
'Terry Brown' via leo-editor leo-editor@googlegroups.com wrote:

  It also seems like sometimes the tree scrolls to
  a center a specific node after some conversions.   
 
 Not sure about the scrolling,

I think I see that, but I don't this it needs a declutter matching
node.  With A with child B expanded at 1/4 down tree, edit B, then move
left to contract A, then move right again to expand A re-revealing B -
tree scrolls to center on B.  So I don't think that's new, if that's
what you were referring to.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing visual clutter in Tree

2015-08-07 Thread 'Terry Brown' via leo-editor
On Thu, 6 Aug 2015 17:28:13 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 This would be glorious. I also thought there might be a relatively
 simple way of simply changing the appearance and I also thought that
 using icons might be part of the answer! I'm super interested to see
 what you come up with!

Ok, funny, I have proof of concept in my working version of Leo, so
trying to do some other work my tree looks like the attached, the 12 
is just an illusion, it's not there when you edit the headlines.  It
was simpler to add than to remove text for editing.

Cheers -Terry

 On Thursday, August 6, 2015 at 4:04:12 PM UTC-4, Terry Brown wrote:
 
  On Thu, 6 Aug 2015 12:25:40 -0700 (PDT) 
  john lunzer lun...@gmail.com javascript: wrote: 
 
   Directives in node headers cause a great deal of visual clutter, 
   making it more difficult to navigate expansive trees filled
   primarily with @clean/@file/@edit nodes. 
 
  I agree completely, rather than seeing: 
 
  @clean /home/tbrown/projects/pyth| 
  @edit /home/tbrown/misc/maps_and_| 
  @nosent /home/tbrown/projects/rec| 
 
  I'd like to see 
 
  퓒 …/somecode.py 
  퓔 …/file.js 
  퓝 …/someelse.txt 
 
  i.e. icons for the directive and path hiding / compression. 
  Maybe even the …/ is too much :-) 
 
  I think this can be done without changing Leo internals or adding 
  aliases like @c for @clean etc.  Basically you'd see the regular
  text when you edit a node headline, and the succinct version
  otherwise. 
 
  In the past I've said I'm tired of hearing myself say I'll try
  things like this and then not getting to them... I think now I'm
  getting to the point of saying I'm tired of hearing myself say I'm
  tired of hearing myself say... :-) 
 
  But I think if this can be done it has to be by just changing the 
  appearance of the nodes when they're not being edited, and having
  the user edit the whole regular `@clean /home/tbrown/projects/...`
  text. Otherwise the changes to Leo internals would be a huge task. 
 
  So, I'll try and have a quick hack along those lines. 
 
  Cheers -Terry 
 
   I suggest creating aliases for the directives @clean/@file/@edit 
   which would obviously be @c/@f/@e . 
   
   I think you can tell just by comparing the two on one line just
   how much single letter aliases cuts down on visual clutter. 
   
   I know @c is in use already but as per the documentation that
   usage is for body only and this would be for headline only. 
   
   Please let me know what you think of this proposal. I think this 
   enhancement would truly change the ease by which directive heavy 
   trees, making Leo much more visually appealing. 
   
 
 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing visual clutter in Tree

2015-08-07 Thread 'Terry Brown' via leo-editor
On Fri, 7 Aug 2015 08:38:37 -0500
'Terry Brown' via leo-editor leo-editor@googlegroups.com wrote:

 Ok, funny, I have proof of concept in my working version of Leo, so
 trying to do some other work my tree looks like the attached, the 12
  is just an illusion, it's not there when you edit the headlines.  It
 was simpler to add than to remove text for editing.

* for testing, not editing, I meant.

 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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing visual clutter in Tree

2015-08-07 Thread 'Terry Brown' via leo-editor
p.s. here's a real life example of with and without the change
(attached images).

So in this case it's the show end of path part that's contributing
more than the make @clean into an icon part, although in an
active_path directory tree where you only have directory names and file
names and not long paths, the latter would be a big improvement, IMO,

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing visual clutter in Tree

2015-08-07 Thread 'Terry Brown' via leo-editor
On Thu, 6 Aug 2015 12:25:40 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 Directives in node headers cause a great deal of visual clutter,
 making it more difficult to navigate expansive trees filled primarily
 with @clean/@file/@edit nodes.

Ok, I've pushed what I've got.  I checked the unit tests and they
seemed unchanged.  It seems to work in py3 as well as py2.

Edward, I made two commits, you can see the combined changes here:
https://github.com/leo-editor/leo-editor/compare/00cdd48...8808ae3
the changes are confined to qt_tree.py (and leoSettings.leo) and aside
from the new code itself, are very clearly walled off from default
behavior by 
self.use_declutter = c.config.getBool('tree-declutter', default=False)

To make it work, copy @data tree-declutter-patterns and 
@bool tree-declutter = False from leoSettings.leo to your personal
settings and change False to True.  Examples below, docs. in the 
@data tree-declutter-patterns node.

I did find that there are two distinct pathways in the code for editing
a node headline.  Double-click, and with 
@bool single_click_auto_edits_headline = True, single-click on a
selected node do one thing, and `edit-headline` does another - i.e.
they seem to use different code to construct headline editing widgets,
it would be good at some time to unify them.  Because my hooks were so
small, I just applied them to both pathways.

So now we just need 16x16 pixel icons which clearly communicate the
difference between @edit, @auto, @clean, @file, and and @nosent :-)
The example code just replaces @clean with an icon.

  # if the node name starts with 'peacock node DEMO', make a mess of it
  RULE ^(peacock node DEMO)
  REPLACE LOOK: \1
  ICON Tango/16x16/emotes/face-grin.png
  ICON Tango/16x16/emotes/face-wink.png
  FG @solarized-magenta
  BG white
  FONT Times
  PX 40
  ITALIC 1
  WEIGHT Bold
  
  # remove @clean and use an icon
  RULE ^@clean (.*)
  REPLACE \1
  ICON Tango/16x16/mimetypes/ascii.png
  
  # show the last part of long filenames
  RULE ^.{1,1000}/(.{20})
  REPLACE …/\1
  
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing visual clutter in Tree

2015-08-07 Thread 'Terry Brown' via leo-editor
On Fri, 7 Aug 2015 14:43:52 -0500
Edward K. Ream edream...@gmail.com wrote:

 ​Thanks for this.  When I ran the unit tests I got the following
 (unrelated) complaint about the recently-changed valuespace plugin:

Thanks for the reminder, fixed and pushed.

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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Reducing visual clutter in Tree

2015-08-06 Thread 'Terry Brown' via leo-editor
On Thu, 6 Aug 2015 12:25:40 -0700 (PDT)
john lunzer lun...@gmail.com wrote:

 Directives in node headers cause a great deal of visual clutter,
 making it more difficult to navigate expansive trees filled primarily
 with @clean/@file/@edit nodes.

I agree completely, rather than seeing:

@clean /home/tbrown/projects/pyth|
@edit /home/tbrown/misc/maps_and_|
@nosent /home/tbrown/projects/rec|

I'd like to see

퓒 …/somecode.py
퓔 …/file.js
퓝 …/someelse.txt

i.e. icons for the directive and path hiding / compression.
Maybe even the …/ is too much :-)

I think this can be done without changing Leo internals or adding
aliases like @c for @clean etc.  Basically you'd see the regular text
when you edit a node headline, and the succinct version otherwise.

In the past I've said I'm tired of hearing myself say I'll try things
like this and then not getting to them... I think now I'm getting to
the point of saying I'm tired of hearing myself say I'm tired of
hearing myself say... :-)

But I think if this can be done it has to be by just changing the
appearance of the nodes when they're not being edited, and having the
user edit the whole regular `@clean /home/tbrown/projects/...` text.
Otherwise the changes to Leo internals would be a huge task.

So, I'll try and have a quick hack along those lines.

Cheers -Terry

 I suggest creating aliases for the directives @clean/@file/@edit
 which would obviously be @c/@f/@e .
 
 I think you can tell just by comparing the two on one line just how
 much single letter aliases cuts down on visual clutter.
 
 I know @c is in use already but as per the documentation that usage
 is for body only and this would be for headline only.
 
 Please let me know what you think of this proposal. I think this 
 enhancement would truly change the ease by which directive heavy
 trees, making Leo much more visually appealing.
 

-- 
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


<    4   5   6   7   8   9   10   11   12   13   >