On Sat, 27 Apr 2013 17:44:13 -0700 (PDT)
wgw <[email protected]> wrote:

> Xiki.org gives a demo of a "wiki" shell for command execution. Leo should 
> be able to do the same thing (and more!), in the sense that leoscreen, for 
> example, has two way communication with the command line. I suppose a 
> "Lxiki" is really just a question of setting up the right shortcuts (like a 
> shift-ctrl-b that would run highlighted python code from the command 
> line... with a tmp file?).
> 
> Just an idea for the Leo melting pot. 

In addition to the outline as a active data document functions of
Ville's value-space plugin, I recently added some simple ;-) commands:

Alt+A vs-eval
Alt+S vs-last
Alt+D vs-last-pretty
(my key bindings)

vs-eval evaluates the selected python in the c.vs namespace.  It makes
an effort to workout what the output should be, and puts it in the
log.  It captures print output to the log too.  It selects the next
line, ready for execution.

vs-last inserts the last result into the body, and vs-last-pretty
does the same, but using pprint formatting.

Ctrl-B also runs the script in the body, but not in a persistent
namespace, running only the selected text doesn't seem to be working,
and it doesn't work so hard to work out the output.

I guess leoscreen would do the same things as the vs-* commands if you
used it against a python shell.  The inspiration for the vs-* commands
was wanting Leo to tell you what 3.57 * 365 / 12 was without a lot of
effort, but of course you can define functions etc. etc.

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to