Re: OT

2014-08-04 Thread Fidel N
I loved this, thanks for the link Kent

On Monday, August 4, 2014 3:39:03 PM UTC+2, Kent Tenney wrote:
>
> http://radar.oreilly.com/2014/08/programming-in-concert-mode.html 
>
> live coding of music with narration, quite remarkable. 
>
> Answers the question 
> 'What's all this excitement around functional programming?' 
>
> Is that Lighttable he's on? 
>

-- 
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 quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread 'Terry Brown' via leo-editor
On Mon, 04 Aug 2014 13:59:38 -0400
Jacob Peck  wrote:

> I just added a minimal tag browser UI.

Very cool.

And of course you can move it out of the tabs window with the
free-layout options on the pane divider context menus.

Very minor - if, for some odd reason, you have two nodes with the same
name but different tag sets, it lists both of them, but doesn't show the
different tag sets when you click on the different nodes.

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: Vim emulation: ready for testing!

2014-08-04 Thread Edward K. Ream
On Mon, Aug 4, 2014 at 10:04 PM, Edward K. Ream  wrote:

> P.P.S. At present, vim mode's colon command is exactly equivalent to
> Alt-X: it does *not* put a colon in the minibuffer.

Fixed at rev 55f2004...Here is the checkin log:

QQQ
The vim colon command now enters a colon into the minibuffer.
It's not "protected", meaning that you can backspace over it.
QQQ

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: Vim emulation: ready for testing!

2014-08-04 Thread Edward K. Ream
On Mon, Aug 4, 2014 at 7:24 AM, Jacob Peck  wrote:
> And these!

Leo now supports 7 new colon commands. The code for all these commands
is straightforward.  Please let me know if they don't work as you
expect.

Here is the checkin log for rev 6b21c05...

QQQ
Added the following colon commands.
(At present, you must type the colon explicitly):
  :e! Revert all changes to a .leo file, prompting if there have been changes.
  :q Quit, prompting for saves.
  :qa Quit only if there are no unsaved changes.
  :w Save the .leo file.
  :wa Save all changed  .leo files.
  :wq Save all open files and exit.
  :xa Save all open files and exit.
QQQ

All these commands are defined using @g.command at the top level of
leoVim.py. They are available regardless of vim mode.  It would be
possible to define them only if vim mode is in effect, but I see no
reason not to make them available always.

Edward

P.S. The :xa and :wq commands are identical.  Does anyone know why
there are two commands?

P.P.S. At present, vim mode's colon command is exactly equivalent to
Alt-X: it does *not* put a colon in the minibuffer.  I'll fix this
asap, but for now you must type the colon again to enter a vim-like
command in the minibuffer.

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: Terry, what's the recommended way to change border colors

2014-08-04 Thread 'Terry Brown' via leo-editor
On Mon, 4 Aug 2014 17:56:34 -0500
"Edward K. Ream"  wrote:

> By analogy, I tried the following, with no joy, but the background is
> pink.
> 
> QTextEdit#richTextEdit [vim_state ~= "vim_normal"] {
>   border: solid 3px red;
> }
> QTextEdit#richTextEdit [vim_state ~= "vim_insert"] {
>   border: solid 3px blue;
> }
> QTextEdit#richTextEdit [vim_state ~= "vim_visual"] {
>   border: solid 3px yellow;
> }

I'd try it without the spaces before the '['.

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 quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread Kent Tenney
Huh, productive day :)

Classic understatement [-:



On Mon, Aug 4, 2014 at 7:14 PM, gatesphere  wrote:
> On 8/4/2014 4:15 PM, dufriz wrote:
>>
>> I can't believe it. What's next?
>
> Now the UI displays the tags for the currently selected node, and those tags
> act as selectors for displaying all nodes with that tag.
>
> The only things left are:
>
>   - UI for adding tags to nodes
>   - UI for removing tags from nodes
>
> Huh, productive day :)
> -->Jake
>
>
> --
> 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: A quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread gatesphere

On 8/4/2014 4:15 PM, dufriz wrote:

I can't believe it. What's next?
Now the UI displays the tags for the currently selected node, and those 
tags act as selectors for displaying all nodes with that tag.


The only things left are:

  - UI for adding tags to nodes
  - UI for removing tags from nodes

Huh, productive day :)
-->Jake

--
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: Vim emulation: ready for testing!

2014-08-04 Thread Zoltan Benedek
Excellent work, Edward,

I'll definitely test vim-mode in the coming days.

On Sunday, August 3, 2014 1:43:12 PM UTC+3, Edward K. Ream wrote:
>
> There has been spectacular progress in the last four days. The first 
> recent commit, e7efb78..., was only three days ago, on July 31!
>
> It may actually be possible to use vim mode for actual work, although I 
> would not recommend do so yet.
>
> To enable vim mode, just set @bool vim-mode = True in the @settings tree 
> for a test .leo file.  Please report any real problems immediately. 
>
> Vim mode now demonstrates all important features of vim:
>
> - The status line showing accumulating commands and shows what the dot is.
> - All simple motion commands work, h,j,k,l.  At present, plain arrow keys 
> are equivalents.
> - The dd and d{motion} commands work.
> - All insert modes work: a,A,i,o,O.
> - Repeat counts work with all of the above commands: 3dd, 3d2j, 5j, 
> 5itest, etc.
> - Visual mode works:  v{motions}v or v{motions}escape work, but not the 
> follow-on commands such as v{motions}d.
> - All changes persist made in a node persist when changing nodes, and all 
> changes are undoable, with either u & Ctrl-R or Leo's traditional undo 
> bindings, Ctrl-Z and Shift-Ctrl-Z.
> - The : command enters the minibuffer, exactly as Alt-X does.  minibuffer 
> commands do not affect the dot.
> - The dot command passes *simple* tests.  I would be wary of this command 
> for now ;-)
>
> Even better, vim mode uses Leo's existing code base in many ways:
>
> - Return in headlines and in outline panes work as always.
>
> - Ctrl-g is handled outside of vim mode: it is still the "universal escape 
> code".  It resets vim emulation to normal mode.
>
> - insert-mode just passes keys to Leo's existing code.  This means that 
> insert mode supports syntax coloring, abbreviations, auto-indentation and 
> *all* key-related settings.  All without *any* code in leoVim.py!
>
> - Except for Ctrl-R, *all* of Leo's non-plain key bindings work *within* 
> vim mode just as they always have.  In particular, you can save work with 
> Ctrl-S without changing vim's state ;-)
>
> - Many other subtle integrations between Leo and vim-mode "just work".  
> This is truly unexpected, and means that vim emulation will be much 
> smoother than I ever dreamed would be possible.
>
> Much work remains to be done.  Many vim commands remain to be implemented. 
> If you want to lobby for a particular vim feature, feel free to do so.
>
> Edward
>
> P.S. The code continues to get simpler while it gets more powerful.  This 
> is an extremely good sign.  When I woke this morning I saw how to make the 
> code even more straightforward.  I'll describe the new approach in a 
> separate ENB post.
>
> 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: Terry, what's the recommended way to change border colors

2014-08-04 Thread Edward K. Ream
On Mon, Aug 4, 2014 at 5:56 PM, Edward K. Ream  wrote:

> This works:
>
> QTextEdit#richTextEdit {
> background-color: pink;
> }
>
> By analogy, I tried the following, with no joy, but the background is pink.
[snip]

Wow.  The styling is so complicated.

I found the following settings in myLeoSettings.leo:

@string focused-border-style = solid
@string focused-border-width = 5px
@string focused-border-focus-color = blue
@string focused-border-unfocus-color = white

Changing them shows that they are active.

Perhaps these are conflicting with the dynamic stylesheets?  I
disabled them, and now a 1px red border appears.  But the vim borders
never kick in.

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: Terry, what's the recommended way to change border colors

2014-08-04 Thread Edward K. Ream
On Mon, Aug 4, 2014 at 5:50 PM, Edward K. Ream  wrote:

> Hmm.  I replaced the stylesheets that you suggested with just:
>
> QTextEdit {
> background-color: red;
> }
>
> This affects the background of the log pane, but not the body pane.

This works:

QTextEdit#richTextEdit {
background-color: pink;
}

By analogy, I tried the following, with no joy, but the background is pink.

QTextEdit#richTextEdit [vim_state ~= "vim_normal"] {
  border: solid 3px red;
}
QTextEdit#richTextEdit [vim_state ~= "vim_insert"] {
  border: solid 3px blue;
}
QTextEdit#richTextEdit [vim_state ~= "vim_visual"] {
  border: solid 3px yellow;
}

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: Terry, what's the recommended way to change border colors

2014-08-04 Thread Edward K. Ream
On Mon, Aug 4, 2014 at 4:42 PM, Edward K. Ream  wrote:

> On Mon, Aug 4, 2014 at 4:29 PM, 'Terry Brown' via leo-editor

>> I'd do this:
>>
>> w = widget.to.be.styled()
> [snip]
>
> Thanks!  I'll try this soon.

Not working yet.  I added the stylesheets you suggested to @data
qt-gui-user-style-sheet in myLeoSettings.leo.

I attempt to set the 'vim_state' property in a method called vc.set_border:

if isinstance(w,QtWidgets.QTextEdit):
selector = 'vim_%s' % (vc.state)
val = w.setProperty('vim_state',selector)
g.trace(vc.state,selector,w,val)
w.style().unpolish(w)
w.style().polish(w)

w.setProperty is returning False in a method called vc.set_border.
But that probably doesn't matter.  See the P.S. Here is a partial
trace:

set_border visual vim_visual (LeoQTextBrowser) 25896 False

Hmm.  I replaced the stylesheets that you suggested with just:

QTextEdit {
background-color: red;
}

This affects the background of the log pane, but not the body pane.  Any ideas?

Edward

P.S. w.setProperty returning False doesn't seem to matter.  From
http://qt-project.org/doc/qt-4.8/properties.html#qt-s-property-system

QQQ
If the value is not compatible with the property's type, the property
is not changed, and false is returned.

But if the property with the given name doesn't exist in the QObject
(i.e., if it wasn't declared with Q_PROPERTY(), a new property with
the given name and value is automatically added to the QObject, but
false is still returned.

This means that a return of false can't be used to determine whether a
particular property was actually set, unless you know in advance that
the property already exists in the QObject.
QQQ

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: Terry, what's the recommended way to change border colors

2014-08-04 Thread Edward K. Ream
On Mon, Aug 4, 2014 at 4:29 PM, 'Terry Brown' via leo-editor
 wrote:

>> How would you recommend doing [colored borders] with stylesheets?
>
> I'd do this:
>
> w = widget.to.be.styled()
[snip]

Thanks!  I'll try this soon. For me, it would be a better indication
of mode than different cursors, and would have zero impact on Leo's
core, unlike futzing with the insertion point.

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: Terry, what's the recommended way to change border colors

2014-08-04 Thread 'Terry Brown' via leo-editor
On Mon, 4 Aug 2014 11:15:45 -0700 (PDT)
"Edward K. Ream"  wrote:

> Ideally, I'd like vim-mode to put a red border around headline or
> body text widgets when in normal mode, and a blue border around the
> widgets when in insert mode.  And maybe another color for visual mode.
> 
> How would you recommend doing with stylesheets?

I'd do this:

w = widget.to.be.styled()

# and then one of
w.setProperty('vim_state', 'vim_visual')
w.setProperty('vim_state', 'vim_normal')
w.setProperty('vim_state', 'vim_insert')
w.setProperty('vim_state', None)  # leaving vim mode

# and then
w.style().unpolish(w)
w.style().polish(w)

and the, in the style sheet:

QTextEdit[vim_state ~= 'vim_normal'] {
  border: solid 3px red;
}
QTextEdit[vim_state ~= 'vim_insert'] {
  border: solid 3px blue;
}

so how vim states are indicated is completely under user control in the
style sheet, either

  @data qt-gui-plugin-style-sheet

or

  @data qt-gui-user-style-sheet

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 quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread Jacob Peck


On 8/4/2014 4:15 PM, dufriz wrote:

I can't believe it. What's next?

Hopefully, adding and removing tags without writing scripts :p

THANKS again, Jake.

No problem :)

--
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 quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread dufriz
On Mon, Aug 4, 2014 at 8:59 PM, Jacob Peck  wrote:

> There is now a browser UI for this plugin.  It supports searching only, at
> the moment.  It allows for fancy complex queries based on set algebra to
> filter on multiple criteria, for example:
>
> foo&bar|baz&hot|cold-water^fire
>
> This would filter as follows:
>
>   - Find nodes with the tag 'foo'
>   - From that set, take only the nodes also tagged 'bar'
>   - Add to that set any node with the tag 'baz'
>   - From that set, take only the nodes also tagged 'hot'
>   - Add to that set any node with the tag 'cold'
>   - Shrink that set down by removing any node with the tag 'water'
>   - Finally, return only the nodes in either that set, or the set of nodes
> tagged 'fire', but NOT those in both sets
>
> The search works left-to-right, but that's all that is needed for most
> things.  The search box is pre-populated with all tags currently in the
> outline, and within a session remembers your previous searches, to prevent
> having to type them multiple times if it's a common thing.
>
> Also, these tags can be long strings -- there's nothing preventing that.
>  They might get a bit tedious to type though...  Tab completion seems to
> work in some cases, but not others.  No clue why.
>
> -->Jake
>
>
Wow! Within a few hours we went from no tag support at all, to having a
browser UI that "allows for fancy complex queries based on set algebra to
filter on multiple criteria"!!!
I can't believe it. What's next?
THANKS again, Jake.

-- 
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 quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread Jacob Peck
There is now a browser UI for this plugin.  It supports searching only, 
at the moment.  It allows for fancy complex queries based on set algebra 
to filter on multiple criteria, for example:


foo&bar|baz&hot|cold-water^fire

This would filter as follows:

  - Find nodes with the tag 'foo'
  - From that set, take only the nodes also tagged 'bar'
  - Add to that set any node with the tag 'baz'
  - From that set, take only the nodes also tagged 'hot'
  - Add to that set any node with the tag 'cold'
  - Shrink that set down by removing any node with the tag 'water'
  - Finally, return only the nodes in either that set, or the set of 
nodes tagged 'fire', but NOT those in both sets


The search works left-to-right, but that's all that is needed for most 
things.  The search box is pre-populated with all tags currently in the 
outline, and within a session remembers your previous searches, to 
prevent having to type them multiple times if it's a common thing.


Also, these tags can be long strings -- there's nothing preventing 
that.  They might get a bit tedious to type though...  Tab completion 
seems to work in some cases, but not others.  No clue why.


-->Jake

--
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 quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread Jacob Peck
Correction: All vnodes have a v.u, which creates v.unknownAttributes on 
demand, if it doesn't exist already.  Fixed in the latest commit.


Good to know, for future reference...

-->Jake

On 8/4/2014 3:41 PM, Jacob Peck wrote:

Umm... what?  All vnodes have an unknownAttributes attribute!

I have no clue what's going on here...

-->Jake

On 8/4/2014 3:30 PM, Kent Tenney wrote:

AttributeError: 'VNode' object has no attribute 'unknownAttributes'




--
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 quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread Jacob Peck

Umm... what?  All vnodes have an unknownAttributes attribute!

I have no clue what's going on here...

-->Jake

On 8/4/2014 3:30 PM, Kent Tenney wrote:

AttributeError: 'VNode' object has no attribute 'unknownAttributes'


--
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 quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread Kent Tenney
with nodetags.py active I get the following on Leo startup:

hook failed: after-create-leo-frame, , leo.plugins.nodetags Traceback
(most recent call last): File
"/var/fetching/leo-editor/leo/core/leoPlugins.py", line 357, in
callTagHandler result = handler(tag,keywords) File
"/var/fetching/leo-editor/leo/plugins/nodetags.py", line 83, in
onCreate theTagController = TagController(c) File
"/var/fetching/leo-editor/leo/plugins/nodetags.py", line 94, in
__init__ self.initialize_taglist() File
"/var/fetching/leo-editor/leo/plugins/nodetags.py", line 103, in
initialize_taglist for tag in self.get_tags(p): File
"/var/fetching/leo-editor/leo/plugins/nodetags.py", line 133, in
get_tags tags = p.v.unknownAttributes.get(self.TAG_LIST_KEY, set([]))
AttributeError: 'VNode' object has no attribute 'unknownAttributes'

On Mon, Aug 4, 2014 at 1:03 PM, Jacob Peck  wrote:
> You'd need the latest version of Leo, from github:
>
> https://github.com/leo-editor/leo-editor/archive/master.zip
>
>
> On 8/4/2014 1:29 PM, duf...@gmail.com wrote:
>
> Jake, could you please provide the link for downloading nodetags.py?
> I googled "commit b9a764c59de263fbdb47969f1d318759b955c442" but got no
> luck...
>
>
> --
> 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.

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


Terry, what's the recommended way to change border colors

2014-08-04 Thread Edward K. Ream
Ideally, I'd like vim-mode to put a red border around headline or body text 
widgets when in normal mode, and a blue border around the widgets when in 
insert mode.  And maybe another color for visual mode.

How would you recommend doing with stylesheets?

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: A quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread Jacob Peck

You'd need the latest version of Leo, from github:

https://github.com/leo-editor/leo-editor/archive/master.zip

On 8/4/2014 1:29 PM, duf...@gmail.com wrote:

Jake, could you please provide the link for downloading nodetags.py?
I googled "commit b9a764c59de263fbdb47969f1d318759b955c442" but got no 
luck...



--
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: A quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread Jacob Peck
I just added a minimal tag browser UI.  Still need to use the API to 
add/remove tags.  I have an idea for a more fully-featured UI I'd like 
to hack together.  In theory, it wouldn't care whether or not the tags 
were short or long, as it'd all be done in a tab in the log pane, much 
like the 'nav' tab.


-->Jake

On 8/4/2014 1:29 PM, 'Terry Brown' via leo-editor wrote:

On Mon, 04 Aug 2014 11:53:07 -0400
Jacob Peck  wrote:


Regarding tags, I hacked the nodetags.py plugin together, available
at commit b9a764c59de263fbdb47969f1d318759b955c442.

Nice.

Interface wise, what do people think about short and long names for
tags?  Even as I ask, I suspect that's more burden that people will
want.  Some visual interface options would work with 'spr', but not
"St-Petersburg-Russia".

This thread that Dufriz (thanks) dug up:
https://groups.google.com/forum/#!searchin/leo-editor/tags/leo-editor/PH0XoWg-b0k/J6_LwIzMx-gJ
covers some of the interface options.  The more I think about Ville's
new column in the tree display idea the less I'm sure I see the use
case, even though it seemed interesting at first ;-)

With a UI more like bookmarks.py (see first post in thread), longer tag
names are probably not an issue.

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: Vim emulation: ready for testing!

2014-08-04 Thread Edward K. Ream
On Mon, Aug 4, 2014 at 12:38 PM, Edward K. Ream  wrote:

> There is an itty-bitty problem with the jj abbreviation.  It seems
> impossible to type anything after a j :-)  I'm on it.

I found this because I started to eat my own dog food.  Naturally, I
had to disable vim-mode again, but I expect to be using vim-mode
regularly very soon.  That will shake out lots of bugs quickly.

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: Vim emulation: ready for testing!

2014-08-04 Thread Edward K. Ream
On Mon, Aug 4, 2014 at 11:29 AM, Edward K. Ream  wrote:

There is an itty-bitty problem with the jj abbreviation.  It seems
impossible to type anything after a j :-)  I'm on it.

> I probably won't get to searching today--this is now on the list.

I'll start with :wq

There is a surprising amount of infrastructure needed behind the
scenes to make this work.  Stuff like :r etc. will be straightforward
once that scaffolding is in place.

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: A quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread 'Terry Brown' via leo-editor
On Mon, 04 Aug 2014 11:53:07 -0400
Jacob Peck  wrote:

> Regarding tags, I hacked the nodetags.py plugin together, available
> at commit b9a764c59de263fbdb47969f1d318759b955c442.

Nice.

Interface wise, what do people think about short and long names for
tags?  Even as I ask, I suspect that's more burden that people will
want.  Some visual interface options would work with 'spr', but not
"St-Petersburg-Russia".

This thread that Dufriz (thanks) dug up:
https://groups.google.com/forum/#!searchin/leo-editor/tags/leo-editor/PH0XoWg-b0k/J6_LwIzMx-gJ
covers some of the interface options.  The more I think about Ville's
new column in the tree display idea the less I'm sure I see the use
case, even though it seemed interesting at first ;-)

With a UI more like bookmarks.py (see first post in thread), longer tag
names are probably not an issue.

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 quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread dufriz
Jake, could you please provide the link for downloading nodetags.py?
I googled "commit b9a764c59de263fbdb47969f1d318759b955c442" but got no 
luck...


-- 
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 quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread Jacob Peck
Oh, sorry!  You either need to add 'nodetags.py' to your 
@enabled-plugins node in myLeoSettings.leo, or set 
'@scripting-at-plugin-nodes = True' in myLeoSettings.leo.


-->Jake

On 8/4/2014 1:11 PM, duf...@gmail.com wrote:



On Monday, 4 August 2014 16:53:11 UTC+1, Jacob Peck wrote:

Regarding tags, I hacked the nodetags.py plugin together,
available at
commit b9a764c59de263fbdb47969f1d318759b955c442.

Attached is a test leo file for playing with it.

This is only an API for tags, but I feel like it should simplify the
process and allow someone to focus on the important bits, i.e. UI
hooks,
rather than low-level details. Also, it's usable now for scripts.

Here is the docstring:

Leo.plugins.nodetags

Provides an API for manipulating and querying textual tags on nodes

By Jacob M. Peck

This plugin registers a controller object to c.theTagController,
which
provides the following API:

tc = c.theTagController

tc.get_all_tags() # return a list of all tags used in the current
outline, automatically updated to be consistent

tc.get_tagged_nodes('foo') # return a list of positions tagged 'foo'

tc.get_tags(p) # return a list of tags applied to the node at
position
p; returns [] if node has no tags

tc.add_tag(p, 'bar') # add the tag 'bar' to the node at position p

tc.remove_tag(p, 'baz') # remove the tag 'baz' from p if it is in the
tag list
Internally, tags are stored in
p.v.unknownAttributes[‘__node_tags’] as a
set.

-->Jake



Thanks a LOT, Jake, for your work.

I have tried it, but obviously I am missing  something, because when I 
clicked on the add-tage button to add a tag to a node, I get the 
following error messages:


'@script-button-button-btn-bg' from style-sheet comment definition, 
please use regular @string / @color type @settings.

Abbreviations off
reading: C:\Users\User01\Desktop\tagtest.leo
exception executing script
AttributeError: 'Commands' object has no attribute 'theTagController'

  line 9:
* line 10: tc = c.theTagController
  line 11: tag = ''.join(random.choice(string.ascii_uppercase) for _ 
in range(8))

  line 12:

BTW, I also tried the other buttons, and they all give error messages.
I am running Python 3.3 under Windows 8.1.


--
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: using leo to organize and manage my digital library composed of videos, audio, pdf, etc.

2014-08-04 Thread dufriz
On Monday, 4 August 2014 17:57:25 UTC+1, Chris George wrote:
>
> Tagging would likely allow me to migrate entirely to Leo.
>

In my case, I resisted turning to other software for a long time, hoping 
for a Leo-only solution (because only Leo lets you have full control and 
flexibility over your data).
Now it seems that it is coming true! 


-- 
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 quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread dufriz


On Monday, 4 August 2014 16:53:11 UTC+1, Jacob Peck wrote:
>
> Regarding tags, I hacked the nodetags.py plugin together, available at 
> commit b9a764c59de263fbdb47969f1d318759b955c442. 
>
> Attached is a test leo file for playing with it. 
>
> This is only an API for tags, but I feel like it should simplify the 
> process and allow someone to focus on the important bits, i.e. UI hooks, 
> rather than low-level details. Also, it's usable now for scripts. 
>
> Here is the docstring: 
>
> Leo.plugins.nodetags 
>
> Provides an API for manipulating and querying textual tags on nodes 
>
> By Jacob M. Peck 
>
> This plugin registers a controller object to c.theTagController, which 
> provides the following API: 
>
> tc = c.theTagController 
>
> tc.get_all_tags() # return a list of all tags used in the current 
> outline, automatically updated to be consistent 
>
> tc.get_tagged_nodes('foo') # return a list of positions tagged 'foo' 
>
> tc.get_tags(p) # return a list of tags applied to the node at position 
> p; returns [] if node has no tags 
>
> tc.add_tag(p, 'bar') # add the tag 'bar' to the node at position p 
>
> tc.remove_tag(p, 'baz') # remove the tag 'baz' from p if it is in the 
> tag list 
> Internally, tags are stored in p.v.unknownAttributes[‘__node_tags’] as a 
> set. 
>
> -->Jake 
>


Thanks a LOT, Jake, for your work.

I have tried it, but obviously I am missing  something, because when I 
clicked on the add-tage button to add a tag to a node, I get the following 
error messages:

'@script-button-button-btn-bg' from style-sheet comment definition, please 
use regular @string / @color type @settings.
Abbreviations off
reading: C:\Users\User01\Desktop\tagtest.leo
exception executing script
AttributeError: 'Commands' object has no attribute 'theTagController'

  line 9: 
* line 10: tc = c.theTagController
  line 11: tag = ''.join(random.choice(string.ascii_uppercase) for _ in 
range(8))
  line 12:

BTW, I also tried the other buttons, and they all give error messages.
I am running Python 3.3 under Windows 8.1.


-- 
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: using leo to organize and manage my digital library composed of videos, audio, pdf, etc.

2014-08-04 Thread Chris George
It is simple and to the point. 

The only other relevant feature is how it creates links out of tags in text 
which take you to a tag search result. I find myself browsing and wandering 
through subjects and bits and pieces that provide all sorts of interesting 
ideas via cross-pollination.

Chris

On Monday, August 4, 2014 9:59:50 AM UTC-7, Jacob Peck wrote:
>
>  There's now a quick and dirty tagging API to use, if you're feeling brave 
> and don't mind writing scripts/buttons for now:
>
> https://groups.google.com/forum/#!topic/leo-editor/HHleO2R2UPY
>
> But... it really needs a nice UI to shine.  PiggyDB's UI looks promising!
> -->Jake
>
>
> On 8/4/2014 12:57 PM, Chris George wrote:
>  
> I will pipe up for tagging. 
>
>  I use Leo for outlining and writing. I use an app called piggydb for idea 
> management . Tagging would likely allow me to 
> migrate entirely to Leo.
>
>  Chris  
>
> On Monday, August 4, 2014 8:07:30 AM UTC-7, duf...@gmail.com wrote: 
>>
>>
>> https://groups.google.com/forum/#!searchin/leo-editor/tags/leo-editor/52AILH7dheo/2AyOEo-qgIcJ
>>
>> https://groups.google.com/forum/#!searchin/leo-editor/tags/leo-editor/4CeJ-ITrvWo/hJCr2mOLrfAJ
>>
>>
>>
>>   -- 
> 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 .
> To post to this group, send email to leo-e...@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: using leo to organize and manage my digital library composed of videos, audio, pdf, etc.

2014-08-04 Thread Jacob Peck
There's now a quick and dirty tagging API to use, if you're feeling 
brave and don't mind writing scripts/buttons for now:


https://groups.google.com/forum/#!topic/leo-editor/HHleO2R2UPY

But... it really needs a nice UI to shine.  PiggyDB's UI looks promising!
-->Jake


On 8/4/2014 12:57 PM, Chris George wrote:

I will pipe up for tagging.

I use Leo for outlining and writing. I use an app called piggydb for 
idea management . Tagging would likely allow me 
to migrate entirely to Leo.


Chris

On Monday, August 4, 2014 8:07:30 AM UTC-7, duf...@gmail.com wrote:


https://groups.google.com/forum/#!searchin/leo-editor/tags/leo-editor/52AILH7dheo/2AyOEo-qgIcJ



https://groups.google.com/forum/#!searchin/leo-editor/tags/leo-editor/4CeJ-ITrvWo/hJCr2mOLrfAJ





--
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: using leo to organize and manage my digital library composed of videos, audio, pdf, etc.

2014-08-04 Thread Chris George
I will pipe up for tagging.

I use Leo for outlining and writing. I use an app called piggydb for idea 
management . Tagging would likely allow me to migrate 
entirely to Leo.

Chris  

On Monday, August 4, 2014 8:07:30 AM UTC-7, duf...@gmail.com wrote:
>
>
> https://groups.google.com/forum/#!searchin/leo-editor/tags/leo-editor/52AILH7dheo/2AyOEo-qgIcJ
>
> https://groups.google.com/forum/#!searchin/leo-editor/tags/leo-editor/4CeJ-ITrvWo/hJCr2mOLrfAJ
>
>
>
>

-- 
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: Vim emulation: ready for testing!

2014-08-04 Thread Edward K. Ream
On Monday, August 4, 2014 10:55:04 AM UTC-5, Kent Tenney wrote:

the '/' command for searching forward, '?' for searching backwards 
>
> followed by 'n' for next match 
> - probably my #1 fav 
>

I probably won't get to searching today--this is now on the list.

vim mode now seems ready for me to start eating my own dog food.  This will 
likely reveal several rough edges.  When those have been smoothed, I'll 
resume adding commands.

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: Vim emulation: ready for testing!

2014-08-04 Thread Edward K. Ream

On Monday, August 4, 2014 10:29:40 AM UTC-5, Edward K. Ream wrote:

> Bring it on, indeed.

Rev c0781f2... supports the jj abbreviation in insert mode.  In insert mode 
*only*, jj ends insert mode (setting the dot) and enters normal mode.

This is something that quickly becomes second nature.

Edward

P.S. It would be trivial to support the following setting:

@string vim-insert-mode-escape = jj

But I won't do that unless somebody truly wants it.

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: Vim emulation: ready for testing!

2014-08-04 Thread Kent Tenney
On Mon, Aug 4, 2014 at 10:29 AM, Edward K. Ream  wrote:
> On Sunday, August 3, 2014 12:18:11 PM UTC-5, Kent Tenney wrote:
>
>> Wow, I was regretting raining on your parade, but you're sounding totally
>> like 'bring it on!'
>
> Leo now supports gg and G, in both normal and visual modes.  gg works
> exactly like in vim: it puts the cursor on the first non-blank character of
> the first line of the buffer (node).
>
> The code is a clean as can be.  The gg and G commands are essentially thin
> wrappers on Leo's code.  That will be true for essentially all new vim
> commands.  Bring it on, indeed.

the '/' command for searching forward, '?' for searching backwards

followed by 'n' for next match
- probably my #1 fav

'/' seems to have become canonical for basic search, even Firefox
opens a search in page box when '/' is typed

>
> Edward
>
> P.S. For now, all vim commands will work only on the presently selected
> node.  That may change later, but it requires careful thought, and perhaps
> extension of vim's standard commands.
>
> 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.

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


A quick-and-dirty tag API can now be had with the nodetags.py plugin

2014-08-04 Thread Jacob Peck
Regarding tags, I hacked the nodetags.py plugin together, available at 
commit b9a764c59de263fbdb47969f1d318759b955c442.


Attached is a test leo file for playing with it.

This is only an API for tags, but I feel like it should simplify the 
process and allow someone to focus on the important bits, i.e. UI hooks, 
rather than low-level details. Also, it's usable now for scripts.


Here is the docstring:

Leo.plugins.nodetags

Provides an API for manipulating and querying textual tags on nodes

By Jacob M. Peck

This plugin registers a controller object to c.theTagController, which 
provides the following API:


tc = c.theTagController

tc.get_all_tags() # return a list of all tags used in the current 
outline, automatically updated to be consistent


tc.get_tagged_nodes('foo') # return a list of positions tagged 'foo'

tc.get_tags(p) # return a list of tags applied to the node at position 
p; returns [] if node has no tags


tc.add_tag(p, 'bar') # add the tag 'bar' to the node at position p

tc.remove_tag(p, 'baz') # remove the tag 'baz' from p if it is in the 
tag list
Internally, tags are stored in p.v.unknownAttributes['__node_tags'] as a 
set.


-->Jake

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



http://www.leo-editor.org/2011/leo"; >


	
	




@settings
@plugin nodetags

@button add-tag
@button rm-tag
@button list-tags
@button add-tag-test
@button get-tagged-nodes-test
@button list-all-tags
Tag test nodes
node 1
node 2
node 3





@language python

''' add a random tag to the selected node '''

import string, random
import random

tc = c.theTagController
tag = ''.join(random.choice(string.ascii_uppercase) for _ in range(8))


g.es('tags before: ', tc.get_tags(p))
tc.add_tag(p, tag)
g.es('tags after: ', tc.get_tags(p))


@language python

''' remove the first tag on the node '''

import random

tc = c.theTagController
tag = tc.get_tags(p)[0]

g.es('tags before: ', tc.get_tags(p))
tc.remove_tag(p, tag)
g.es('tags after: ', tc.get_tags(p))


@language python

''' list all tags on the selected node '''

tc = c.theTagController
g.es('tags: ', tc.get_tags(p))


@language python

''' add the tag "test" to the node '''

tc = c.theTagController
tag = 'test'

g.es('tags before: ', tc.get_tags(p))
tc.add_tag(p, tag)
g.es('tags after: ', tc.get_tags(p))

@language python

''' get all nodes tagged "test" '''

tc = c.theTagController
tag = 'test'

nodelist = tc.get_tagged_nodes(tag)
nodelist = [n.h for n in nodelist]
g.es('nodes tagged "test": ', nodelist)

@language python

''' list all tags in the current outline '''

tc = c.theTagController
g.es('All tags in this outline: ', tc.get_all_tags())








Re: Vim emulation: ready for testing!

2014-08-04 Thread Edward K. Ream
On Sunday, August 3, 2014 12:18:11 PM UTC-5, Kent Tenney wrote:

> Wow, I was regretting raining on your parade, but you're sounding totally 
like 'bring it on!'

Leo now supports gg and G, in both normal and visual modes.  gg works 
exactly like in vim: it puts the cursor on the first non-blank character of 
the first line of the buffer (node).

The code is a clean as can be.  The gg and G commands are essentially thin 
wrappers on Leo's code.  That will be true for essentially all new vim 
commands.  Bring it on, indeed.

Edward

P.S. For now, all vim commands will work only on the presently selected 
node.  That may change later, but it requires careful thought, and perhaps 
extension of vim's standard commands.

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: using leo to organize and manage my digital library composed of videos, audio, pdf, etc.

2014-08-04 Thread dufriz
https://groups.google.com/forum/#!searchin/leo-editor/tags/leo-editor/52AILH7dheo/2AyOEo-qgIcJ
https://groups.google.com/forum/#!searchin/leo-editor/tags/leo-editor/4CeJ-ITrvWo/hJCr2mOLrfAJ



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


debugging Leo with git bisect

2014-08-04 Thread 'Terry Brown' via leo-editor
git bisect is great for finding the revision that broke something, but
there's an odd Leo specific issue to work around.  For a month or more
in early 2014 there are Leo commits that abort if .../.git/HEAD doesn't
contain a space.  It's usually "ref: refs/heads/master" but while using
git bisect it's something like 8e35e492a3c1367d8441cb15b0468bfc78033580
The problem is that Leo's sniffing in the .git folder to report its
version number, git recreates everything as it was "back then",
*except* the content of .git.

The workaround is to export Leo for testing, something like:

...
git archive HEAD | tar -x -C ~/r && python ~/r/launchLeo.py ~/r/test.leo 
git bisect bad
git archive HEAD | tar -x -C ~/r && python ~/r/launchLeo.py ~/r/test.leo 
git bisect good
git archive HEAD | tar -x -C ~/r && python ~/r/launchLeo.py ~/r/test.leo 
git bisect bad

Normally this would just be

python launchLeo.py ~/r/test.leo 
git bisect bad
python launchLeo.py ~/r/test.leo 
git bisect good
python launchLeo.py ~/r/test.leo 
git bisect bad

but the export to a temp. dir with no .git at all avoids the problem.

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: using leo to organize and manage my digital library composed of videos, audio, pdf, etc.

2014-08-04 Thread dufriz
Sure, Terry.

https://groups.google.com/forum/#!searchin/leo-editor/tags/leo-editor/52AILH7dheo/2AyOEo-qgIcJ
https://groups.google.com/forum/#!searchin/leo-editor/tags/leo-editor/aXOxkhDqBxw/hG9pG2xRQ2cJ
https://groups.google.com/forum/#!searchin/leo-editor/tags/leo-editor/jq8TtuvaD80/QmpE3iQAweEJ
https://groups.google.com/forum/#!searchin/leo-editor/tags/leo-editor/PH0XoWg-b0k/J6_LwIzMx-gJ

There may be some more. I am continuing the search...
(Note: in some of the threads tagging is only mentioned, not much discussed)

-- 
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: using leo to organize and manage my digital library composed of videos, audio, pdf, etc.

2014-08-04 Thread 'Terry Brown' via leo-editor
On Mon, 4 Aug 2014 07:40:38 -0700 (PDT)
duf...@gmail.com wrote:

> I am glad I am not the only one who finds tags essential.
> 
> I REALLY wish tags are implemented soon. If someone else is
> interested in them, please chime in.

Hi Dufriz, could you do me a favor and dig up the old threads
discussing tags?  Thanks.

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: using leo to organize and manage my digital library composed of videos, audio, pdf, etc.

2014-08-04 Thread 'Terry Brown' via leo-editor
On Mon, 4 Aug 2014 09:39:33 -0500
Kent Tenney  wrote:

> from active_path About
> "If a node is named @path  , the content (file and
> folder names) of the folder and the children of that node will
> synchronized whenever you double-click the node's status-iconbox."
> 
> I'm not seeing this currently, I'm using 'set to absolute recursive',
> which prepends
> @auto and provides fully qualified path, then doing 'Refresh from
> disk'
> 
> I seem to remember different behaviour ...

Coincidentally I've just pinned down
8e35e492a3c1367d8441cb15b0468bfc78033580 as the rev. breaking
double-click, probably not hard to fix, possibly just a re-naming.

Cheers -Terry

> On Mon, Aug 4, 2014 at 9:12 AM, 'Terry Brown' via leo-editor
>  wrote:
> > On Mon, 4 Aug 2014 07:01:17 -0700 (PDT)
> > duf...@gmail.com wrote:
> >
> >> (I hope you don't mind that fact that I am resuscitating a 4-year
> >> old thread.)
> >>
> >> I was going to write a post exactly like the OP of this thread,
> >> when I discovered that this question had already been asked in this
> >> thread, so here I am jumping in.
> >>
> >> Basically, I have precisely the same needs as the OP: organizing
> >> the files in my digital library (text, pdf, doc, pics, anything)
> >> and make them accessible through Leo, which would allow me to have
> >> clones and hence multiple data views. After this, Leo would be
> >> about the only way for me to access those files.
> >
> > I wonder how close you'd get with active_path.py, if you use its
> > "recursively make paths absolute" to allow them to be moved around
> > freely... no, that's not doing quite the right thing.
> >
> > Hmm, I think there are a bunch of things Leo does which are close to
> > what you're looking for but nothing that quite fits.
> >
> > Cheers -Terry
> >
> >> Initially I was thinking of using Leo for tagging, but it seems
> >> that Leo does not support tagging yet (too bad!).
> >> So I am asking you advice on how I could go about it.
> >>
> >> Since I am looking forward to a Leo-only solution, I am not
> >> planning to resort to any external program (unlike the OP).
> >>
> >> Could someone please give me some directions on how to have Leo
> >> make an outline containing the listing of whole directories (along
> >> with their subdirectories), so that each node is a file? Creating
> >> @url nodes would only be the first step, because next I would want
> >> to create views which allow me to group and display various files
> >> together, from across different directories. This functionality is
> >> commonly called "virtual folders" on some systems. Basically, each
> >> such folder would be the equivalent of a listing of all the files
> >> that are tagged with a given keyword. Can I do all this in Leo,
> >> despite the fact that Leo does not have proper tagging?
> >> Could I also have virtual folders on demand (i.e. by user input,
> >> not pre-defined) which give me the listing of files that are
> >> shared by two or more directories? (This would be equivalent to
> >> narrowing down the search by specifying more than one tag).
> >>
> >> Lastly, can I arrange such virtual folders in a hierarchy?
> >>
> >> Any advice or comment is gladly welcome, especially from those who
> >> have already done something similar.
> >>
> >> dufriz
> >>
> >
> > --
> > 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: using leo to organize and manage my digital library composed of videos, audio, pdf, etc.

2014-08-04 Thread dufriz
I am glad I am not the only one who finds tags essential.

I REALLY wish tags are implemented soon. If someone else is interested in 
them, please chime in.


-- 
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: using leo to organize and manage my digital library composed of videos, audio, pdf, etc.

2014-08-04 Thread Kent Tenney
from active_path About
"If a node is named @path  , the content (file and folder names)
of the folder and the children of that node will synchronized whenever you
double-click the node's status-iconbox."

I'm not seeing this currently, I'm using 'set to absolute recursive',
which prepends
@auto and provides fully qualified path, then doing 'Refresh from disk'

I seem to remember different behaviour ...

On Mon, Aug 4, 2014 at 9:12 AM, 'Terry Brown' via leo-editor
 wrote:
> On Mon, 4 Aug 2014 07:01:17 -0700 (PDT)
> duf...@gmail.com wrote:
>
>> (I hope you don't mind that fact that I am resuscitating a 4-year old
>> thread.)
>>
>> I was going to write a post exactly like the OP of this thread, when
>> I discovered that this question had already been asked in this
>> thread, so here I am jumping in.
>>
>> Basically, I have precisely the same needs as the OP: organizing the
>> files in my digital library (text, pdf, doc, pics, anything) and make
>> them accessible through Leo, which would allow me to have clones and
>> hence multiple data views. After this, Leo would be about the only
>> way for me to access those files.
>
> I wonder how close you'd get with active_path.py, if you use its
> "recursively make paths absolute" to allow them to be moved around
> freely... no, that's not doing quite the right thing.
>
> Hmm, I think there are a bunch of things Leo does which are close to
> what you're looking for but nothing that quite fits.
>
> Cheers -Terry
>
>> Initially I was thinking of using Leo for tagging, but it seems that
>> Leo does not support tagging yet (too bad!).
>> So I am asking you advice on how I could go about it.
>>
>> Since I am looking forward to a Leo-only solution, I am not planning
>> to resort to any external program (unlike the OP).
>>
>> Could someone please give me some directions on how to have Leo make
>> an outline containing the listing of whole directories (along with
>> their subdirectories), so that each node is a file? Creating @url
>> nodes would only be the first step, because next I would want to
>> create views which allow me to group and display various files
>> together, from across different directories. This functionality is
>> commonly called "virtual folders" on some systems. Basically, each
>> such folder would be the equivalent of a listing of all the files
>> that are tagged with a given keyword. Can I do all this in Leo,
>> despite the fact that Leo does not have proper tagging?
>> Could I also have virtual folders on demand (i.e. by user input, not
>> pre-defined) which give me the listing of files that are shared by
>> two or more directories? (This would be equivalent to narrowing down
>> the search by specifying more than one tag).
>>
>> Lastly, can I arrange such virtual folders in a hierarchy?
>>
>> Any advice or comment is gladly welcome, especially from those who
>> have already done something similar.
>>
>> dufriz
>>
>
> --
> 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: using leo to organize and manage my digital library composed of videos, audio, pdf, etc.

2014-08-04 Thread Jacob Peck
Tagging support would be ideal, that's for sure.  Once that is 
implemented, the rest would be a series of trivial scripts, I feel.


I think this should be a push for a node-tagging plugin ;)

The real question is the same as always -- how to do UI for tags?

I feel like an 'invisible' tagging system could be hacked together 
pretty quickly, with a UI (read: log pane tab) for displaying tagged 
nodes, and managing tags.  In fact, I could probably hack something 
together in a few days for that.  I don't know if I'll get around to it, 
but it looks like fun, and I've been meaning to find a toy to work on...

-->Jake

On 8/4/2014 10:20 AM, duf...@gmail.com wrote:

Thanks, Terry. Prompt reply as usual, and to the point.

So, now I am left asking the crucial question (keeping my fingers 
crossed): any chance that you or someone else may work on this in the 
near future?
Don't you think that this is a functionality that deserves being 
implemented?

--
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: using leo to organize and manage my digital library composed of videos, audio, pdf, etc.

2014-08-04 Thread dufriz
Thanks, Terry. Prompt reply as usual, and to the point.

So, now I am left asking the crucial question (keeping my fingers crossed): 
any chance that you or someone else may work on this in the near future?
Don't you think that this is a functionality that deserves being 
implemented?

-- 
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: using leo to organize and manage my digital library composed of videos, audio, pdf, etc.

2014-08-04 Thread 'Terry Brown' via leo-editor
On Mon, 4 Aug 2014 07:01:17 -0700 (PDT)
duf...@gmail.com wrote:

> (I hope you don't mind that fact that I am resuscitating a 4-year old 
> thread.)
> 
> I was going to write a post exactly like the OP of this thread, when
> I discovered that this question had already been asked in this
> thread, so here I am jumping in.
> 
> Basically, I have precisely the same needs as the OP: organizing the
> files in my digital library (text, pdf, doc, pics, anything) and make
> them accessible through Leo, which would allow me to have clones and
> hence multiple data views. After this, Leo would be about the only
> way for me to access those files.

I wonder how close you'd get with active_path.py, if you use its
"recursively make paths absolute" to allow them to be moved around
freely... no, that's not doing quite the right thing.

Hmm, I think there are a bunch of things Leo does which are close to
what you're looking for but nothing that quite fits.

Cheers -Terry

> Initially I was thinking of using Leo for tagging, but it seems that
> Leo does not support tagging yet (too bad!).
> So I am asking you advice on how I could go about it.
> 
> Since I am looking forward to a Leo-only solution, I am not planning
> to resort to any external program (unlike the OP).
> 
> Could someone please give me some directions on how to have Leo make
> an outline containing the listing of whole directories (along with
> their subdirectories), so that each node is a file? Creating @url
> nodes would only be the first step, because next I would want to
> create views which allow me to group and display various files
> together, from across different directories. This functionality is
> commonly called "virtual folders" on some systems. Basically, each
> such folder would be the equivalent of a listing of all the files
> that are tagged with a given keyword. Can I do all this in Leo,
> despite the fact that Leo does not have proper tagging?
> Could I also have virtual folders on demand (i.e. by user input, not 
> pre-defined) which give me the listing of files that are shared by
> two or more directories? (This would be equivalent to narrowing down
> the search by specifying more than one tag).
> 
> Lastly, can I arrange such virtual folders in a hierarchy?
> 
> Any advice or comment is gladly welcome, especially from those who
> have already done something similar.
> 
> dufriz
> 

-- 
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: using leo to organize and manage my digital library composed of videos, audio, pdf, etc.

2014-08-04 Thread dufriz
(I hope you don't mind that fact that I am resuscitating a 4-year old 
thread.)

I was going to write a post exactly like the OP of this thread, when I 
discovered that this question had already been asked in this thread, so 
here I am jumping in.

Basically, I have precisely the same needs as the OP: organizing the files 
in my digital library (text, pdf, doc, pics, anything) and make them 
accessible through Leo, which would allow me to have clones and hence 
multiple data views. After this, Leo would be about the only way for me to 
access those files.

Initially I was thinking of using Leo for tagging, but it seems that Leo 
does not support tagging yet (too bad!).
So I am asking you advice on how I could go about it.

Since I am looking forward to a Leo-only solution, I am not planning to 
resort to any external program (unlike the OP).

Could someone please give me some directions on how to have Leo make an 
outline containing the listing of whole directories (along with their 
subdirectories), so that each node is a file? Creating @url nodes would 
only be the first step, because next I would want to create views which 
allow me to group and display various files together, from across different 
directories. This functionality is commonly called "virtual folders" on 
some systems. Basically, each such folder would be the equivalent of a 
listing of all the files that are tagged with a given keyword.
Can I do all this in Leo, despite the fact that Leo does not have proper 
tagging?
Could I also have virtual folders on demand (i.e. by user input, not 
pre-defined) which give me the listing of files that are shared by two or 
more directories? (This would be equivalent to narrowing down the search by 
specifying more than one tag).

Lastly, can I arrange such virtual folders in a hierarchy?

Any advice or comment is gladly welcome, especially from those who have 
already done something similar.

dufriz

-- 
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: Vim emulation: ready for testing!

2014-08-04 Thread Jacob Peck


On 8/4/2014 9:45 AM, Edward K. Ream wrote:

On Mon, Aug 4, 2014 at 7:37 AM, Jacob Peck  wrote:

On 8/4/2014 8:33 AM, Edward K. Ream wrote:

BTW, I have just verified that you can indent/unindent selected lines
(insert mode *only*) using tab/shift-tab.

Perhaps in vim, but I live in vi (sans 'm').  Solaris doesn't seem to have
entered this decade :p

I was talking about Leo's vim-mode.  In Leo's vim-insert mode,
everything works *exactly* as in Leo's traditional body pane, with the
addition that the vim dot is updated, so the 5i
inserts 5 copies.

Edward

Whoops!  Fair enough :)

--
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: Vim emulation: ready for testing!

2014-08-04 Thread Edward K. Ream
On Mon, Aug 4, 2014 at 7:37 AM, Jacob Peck  wrote:
>
> On 8/4/2014 8:33 AM, Edward K. Ream wrote:
>>
>> BTW, I have just verified that you can indent/unindent selected lines
>> (insert mode *only*) using tab/shift-tab.
>
> Perhaps in vim, but I live in vi (sans 'm').  Solaris doesn't seem to have
> entered this decade :p

I was talking about Leo's vim-mode.  In Leo's vim-insert mode,
everything works *exactly* as in Leo's traditional body pane, with the
addition that the vim dot is updated, so the 5i
inserts 5 copies.

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.


OT

2014-08-04 Thread Kent Tenney
http://radar.oreilly.com/2014/08/programming-in-concert-mode.html

live coding of music with narration, quite remarkable.

Answers the question
'What's all this excitement around functional programming?'

Is that Lighttable he's on?

-- 
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: Vim emulation: ready for testing!

2014-08-04 Thread Jacob Peck


On 8/4/2014 8:33 AM, Edward K. Ream wrote:
BTW, I have just verified that you can indent/unindent selected lines 
(insert mode *only*) using tab/shift-tab.
Perhaps in vim, but I live in vi (sans 'm').  Solaris doesn't seem to 
have entered this decade :p


-->Jake

--
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: Vim emulation: ready for testing!

2014-08-04 Thread Edward K. Ream
On Monday, August 4, 2014 7:24:38 AM UTC-5, Jacob Peck wrote:

> And these! 
>
> :e! 
> revert all changes since the current file was loaded (i.e. reload from 
> disk) 
> In a Leo context, this would probably make more sense on an @ node. 
>
> :wq 
> Save and exit.  I use this one all the time ;) 
>
> :1,$ s/^/  /g 
>  From line 1 to EOF ($), replace the beginning of the line (^) with two 
> spaces (  ), globally (keep applying as many times as possible) 
> A quick vim-like way to do indents on a range of characters.  I also use 
> this one frequently...
>

Thanks for these suggestions.  They are on the list to do immediately.

BTW, I have just verified that you can indent/unindent selected lines 
(insert mode *only*) using tab/shift-tab.

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: Vim emulation: ready for testing!

2014-08-04 Thread Edward K. Ream
On Monday, August 4, 2014 4:52:58 AM UTC-5, Edward K. Ream wrote:

> There has been spectacular progress in the last four days.

Rev b78f1ba... simplifies the vim-mode init logic, as described here: 
https://groups.google.com/d/msg/leo-editor/SVmxgvcQbqY/iRycTO1QG8kJ

The code passes hand tests--there are no unit tests yet.  Please report any 
problems immediately.

The all-important scanning code is now complete.  It should be a solid 
platform on which to add more vim commands.

The next tasks:

1. Write a Theory of Vim Emulation, based on recent ENB posts.  About an 
hour.

2. Start implementing Kent's requests for new vim commands, especially 
g and :

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: Vim emulation: ready for testing!

2014-08-04 Thread Jacob Peck


On 8/3/2014 1:17 PM, Kent Tenney wrote:

gg and G for jumping to beginning and end of file.

:r filename
put contents of filename at cursor position

:!shell command

:e directory name
presents list of files in the directory, selecting and  opens a file

:tabnew filename
opens filename in a new tab


And these!

:e!
revert all changes since the current file was loaded (i.e. reload from disk)
In a Leo context, this would probably make more sense on an @ node.

:wq
Save and exit.  I use this one all the time ;)

:1,$ s/^/  /g
From line 1 to EOF ($), replace the beginning of the line (^) with two 
spaces (  ), globally (keep applying as many times as possible)
A quick vim-like way to do indents on a range of characters.  I also use 
this one frequently...


Nice work so far.  I'll have to give it a go soon.  I live in vi on the 
command line -- as a Solaris + AIX sysadmin, it's all we have... (well, 
that, and Leo's sftp plugin :p)

-->Jake

--
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: ENB: collapsing complexity in vim mode

2014-08-04 Thread Edward K. Ream
On Sunday, August 3, 2014 1:29:19 PM UTC-5, Edward K. Ream wrote:

>> ...keep revising code until it *obviously* is the simplest code possible.

>To make this scheme work, all key handlers must end in an acceptance 
method: vc.accept, vc.delegate or vc.ignore.

> As a result, [the new] key handlers [will] know nothing about state 
handlers and vice versa!

As discussed in another thread, rev ebacdc1... puts this scheme into 
practice.

Here, I'll discuss these changes in detail, including complications that I 
discovered yesterday and further simplifications that I'll make today.

1. In general, ending each command handler with an acceptance method has 
been a great success.  Acceptance methods clearly indicate what should 
happen when a command handler ends.

Acceptance handlers hide the existence of the vc.next_func and 
vc.return_value ivars from all command handlers.  This makes each command 
handler much cleaner in appearance. Furthermore, it is now possible to 
tweak  acceptance methods without changing command handlers in any way.

In other words, even though the acceptance methods follow the principle, 
"explicit is better than implicit", they *also* hide implementation details 
in a most useful way.  It's the best of both "implicit" and "explicit".

2. Besides the **direct** acceptance methods, vc.accept, vc.delegate or 
vc.ignore, vc.done & vc.quit, command handlers can also end with 
**indirect** acceptance methods: vc.begin_insert_mode, vc.begin_motion, 
vc.end_insert_mode, and vc.vim_digits.  Indirect acceptance methods 
(eventually!) call direct acceptance methods.

**Important**: command handlers can use different acceptance methods 
(direct or indirect) in different branches of their code, provided that all 
branches end in a call to exactly one acceptance method.  In practice, 
checking this requirement is easy.  Furthermore, the checking code in 
vc.do_state will warn if this requirement has not been met.

3. I did get one surprise: vc.do_inner_motion can't just call 
vc.do_state(motion_dispatch_d,'motion') because vc.do_inner_motion must 
call the after-motion callback, vc.motion_func.  No big deal, except...

4. At present, vc.done calls vc.reinit_ivars, and that caused problems for 
vc.do_inner_motion because vc.reinit_ivars wiped out the ivars needed when 
calling the motion callback, including vc.motion_func itself!

The temporary hack was simply to save/restore the needed ivars in 
vc.do_inner_motion.  Happily, this morning I saw a cleaner, more explicit 
way to init ivars if and when needed. This will simplify the init code, and 
more importantly, clarify exactly what is happening and why.

To recap: the problem is that vc.reinit_ivars clears too many ivars.  
Furthermore, the dot ivars are handled as special cases.  The solution is 
to define the following methods:

- vc.init_dot_vars()
- vc.init_motion_vars()
- vc.init_state_vars()
- vc.init_persistent_vars()

Doh!  We have now clearly grouped *all* ivars into *disjoint* classes.  We 
can now define the following:

def init_all_ivars(vc):
'''Init all vim-mode ivars.  Called only from the ctor.'''
vc.init_dot_vars()
vc.init_motion_vars()
vc.init_state_vars()
vc.init_persistent_vars()

def init_ivars_after_quit(vc):
'''Init vim-mode ivars after the keyboard-quit command.'''
vc.init_motion_vars()
vc.init_state_vars()

def init_ivars_after_done(vc):
'''Init vim-mode ivars when a command completes.'''
if not vc.in_motion:
vc.init_motion_ivars()
vc.init_state_ivars()

**Important**: it would be very bad design to call vc.init_ivars_after_quit 
inside vc.init_ivars_after_done just because (for now!) the effect would be 
the same.  Glen Meyers calls reusing common code "code-level" binding.  It 
can cause all kinds of problems.

Instead, we want what Meyers calls "functional" binding.  The (proper) code 
shown above makes vc.init_after_quit and vc.init_after_done independent of 
each other, regardless of what happens in future.

So this is good.  We have now created a higher-level grouping of ivars that 
makes clear what is intended.  This scheme is simple and flexible: new 
(disjoint!) groups of ivars can be created at any time. The new scheme is 
yet another example of using abstraction as a design and coding tool.

= Conclusions

Leo's vim code is now spectacularly different, both visually and 
functionally, from the real vim's code. Wherever possible, Leo uses methods 
to hide the blah, blah, blah of implementation details.  Imo, the result is 
*far* better design and code than vim's.

Imo, if vim were recreated today from scratch, it would be reasonable to 
use Leo's vim-mode code as a starting point.

Edward

P.S.  To emphasize what I said before in another post: Python encourages 
simplifications that are, in practice, denied to C programmers.  Leo's 
dispatch dicts for vim mode are an example.  Creating such dicts is 
difficult in plain C, and non-trivial in C++.

Re: Python-related questions

2014-08-04 Thread dufriz
On Sunday, 3 August 2014 18:05:37 UTC+1, Terry wrote:
>
> On Sun, 3 Aug 2014 04:54:36 -0700 (PDT) 
> duf...@gmail.com  wrote: 
>
> > On Sunday, 3 August 2014 02:17:02 UTC+1, Terry wrote: 
> > > 
> > > Not sure, but maybe C:\PythonXY\pythonw.exe instead of 
> > > C:\PythonXY\python.exe 
> > > 
> > > Cheers -Terry 
> > > 
> > 
> > Thanks, Terry. I did what you suggested. I have renamed launchLeo.py 
> > to launchLeo.pyw, and now it is loaded by python.exe (I assume). 
> > Only, there seems to be some problem. 
>
> Looks like Leo assumes sys.stdout or sys.stderr is not None, which is 
> probably a bug. 
>
> https://github.com/leo-editor/leo-editor/issues/25 
>
> may be related. 
>
> Cheers -Terry 
>
>
Any solution to this? 

-- 
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: Vim emulation: ready for testing!

2014-08-04 Thread Edward K. Ream
On Sunday, August 3, 2014 5:43:12 AM UTC-5, Edward K. Ream wrote:

> There has been spectacular progress in the last four days.

And yesterday there was excellent progress behind the scenes.  Rev 
ebacdc1... simplifies the entire scanning logic. These changes will surely 
speed development considerably. I'll discuss the changes in the ongoing ENB 
post about vim mode.  

Those playing with vim mode should notice only the following changes.  
Please let me know immediately if any command stops working ;-)

Functional changes:

- As in the real vim, the selection created by visual mode is cleared if 
you use another v to end visual mode.
- The vim dot command appears to work for all commands.

Cosmetic changes:

- Space, return and escape characters are now shown when showing the dot.

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: Vim emulation: ready for testing!

2014-08-04 Thread Edward K. Ream
On Sunday, August 3, 2014 12:55:02 PM UTC-5, Edward K. Ream wrote:

> Right now : is an exact synonym for Alt-x.  Not exactly sure how to 
integrate these colon-forms with Leo...

This will likely work:

- The vim : command pre-loads a colon into the minibuffer.
- leoVim.py defines commands (using @.command) whose names start with colon.

That might be enough, all by itself.  Ok, let's see...

Well, 5 minutes wasn't enough to find a way to force k.fullCommand to stuff 
an colon into the minibuffer.  So that's a little project.

But, Doh, let's see what happens when I define a command whose name starts 
with a colon, and then I type : in the minibuffer.

Still no joy.  Perhaps the colon got munged away.

Anyway, it *will* soon be possible to support commands whose names start 
with colon.

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.


@language factor @comment !_

2014-08-04 Thread Georg Simon
In Factor line comments start with an exclamation point followed by a space.
But the @language directive leads to lines like

!@+leo-ver=5-thin

instead of

! @+leo-ver=5-thin

For now I added the following line after the @language directive:

@comment !_

I think the correct solution is a modified leo/modes/factor.py
but I don't know how.

- Georg

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


Autocompleting dictionaries keys

2014-08-04 Thread Fidel N
Hi:
This is a feature request that I thought could be very nice.
The idea is that, when using Leo autocomplete, if the user reaches a 
dictionary, leo could offer autocomplete with its keys.

so if we want to reach, for instance, the hooks dictionary, we do:

g.app.pluginsController.handlers

Then, when we do the [, leo could suggest the keys already wrapped in 
colons.

Does something like this (for easing the dict navigation) exist already?


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