> a) is the strength of Leo is also a weakness. In Emacs since the text is not
> structured every buffer is also an editor. I can easily dump program output
> into a buffer and do post processing or impromptu search. In Leo the outline
> is the central focus. For example I don't know how to search for things in
> the log pane if that capability does exist.
In Leo, every *node* is equivalent to an Emacs buffer. Just dump
something into a new node, and search that node. You can copy text
from the log pane using Ctrl-V.
> b) is the lack of an inferior python (or other language) processes to enable
> REPL development. Scripting is nice but I don't really want to run real code
> in my editor python, with name pollution and real possibilities of
> occasional crashes.
There is no name pollution in a Leo script, unless you go out of your
way to pollute Leo, by assigning to an attribute of c, g or p.
Python crashes in Leo scripts have absolutely no effect on Leo itself.
Leo could use better support for running scripts in a separate
process. This would eliminate the need to use Python's subprocess
module in the Leo script. Usually, this is *not* what you want, but
it is sometimes useful.
> As I learn more about Leo my approach will surely evolve along with Leo.
Yes it will. For instance, you'll fall in love with Leo scripting :-)
Edward
Of course you can! That's what Leo's Ctrl-B (execute-script) does.
On Tue, Oct 2, 2012 at 12:44 PM, F.S. <speec...@gmail.com> wrote:
> However in
> Emacs it is easy to attach arbitrary action to any text through buttons that
> can be placed anywhere in any buffer.
That's what Leo's script buttons do. A script button script could act
on the entire file (as in Emacs) or on the presently selected node
(typical) or on a found set of nodes, say all the nodes with
@something in the headline.
So if you *only* consider nodes to be equivalent to emacs buffers,
@button scripts are just as powerful as emacs buttons. But in
addition, @button scripts have full, easy access to all aspects of
Leo's outline structure. Thus, Leo scripts can easily do things that
would be extremely laborious in emacs.
> * Yes that does mess up the namespace that may have to be taken care of
> later but it is well worth the effort.
Executing scripts is safe. For details, look at the code in c.executeScript.
On Tue, Oct 2, 2012 at 5:06 PM, F.S. <speec...@gmail.com> wrote:
> What I was referring to was that when we eval everything at the top level of course we break all the module restrictions.
I have no idea what you are worried about.
Some updates on the work flow. I have been moving between Leo and Emacs and I am quite happy with the results, although there are some glitches too.I am now using Leo as the project manager and the primary source code editor to write new code and/or refactor existing code. I had some third party software that I wanted to prune down the features and use on a server. Some files should be copied from the original, some files are majorly pruned to cut down references to unused features and remain as skeletons just to keep things happy and a few needed to be rewritten to fit the server side. It is pretty simple to keep a separate list of each and manage copying, updating etc all from within Leo. I can probably do the same if I had enough sophistication with version control software, but I suspect that I suffered much less frustration by using Leo (and shutil.copy2) to manage the flow.
It is a powerful combo to document meta information: source code management info and script, reasons for doing things, alternatives that failed or should be tried etc, all in the same outline with the code base, knowing that I will have a much easier time if in the future I need to revisit the code and choices made.For code completion Codewise was kind of disappointing. Maybe it is something about how my tags are set up. I can see why it is not turned on as default. I am sure it is great (indispensable) if I want to hack Leo. For now I am just surviving on dabbrev, which thankfully fits the need well enough.I also recently learned about the Emacs Occur mode. If any Emacs user here hasn't tried it you've got to give it a try. Do M-X occur, for Python code then give it the pattern "def \|class " (note the space after def and class keywords) and you get an Occur mode window that is eerily similar to Leo! You can navigate around your source code window by clicking on the highlighted links in the Occur mode window. This definitely fits well with one's use pattern of Leo.Switching between two editors definitely has its own risks. I thought I was careful but still there were one or two things that slipped through.
Bugs I must have fixed -- since my REPL session was happy -- but only in my Emacs, were then stomped by my Leo editing session. I was probably keeping the same REPL session for too long, only incrementally evaling new codes as they were created or fixed. A restart quickly showed that mistakes were made, thankfully all easy to fix. I should probably also give (global-auto-revert-mode t) a try.It is probably not too hard to create an Emacs mode for Leo? With Leo's core outlining and Python scripting capability integrated with Emacs power in basic editing and countless modes. One can always dream, right?
On Monday, October 1, 2012 3:50:05 PM UTC-7, F.S. wrote:As I learn more about Leo my approach will surely evolve along with Leo.
--You received this message because you are subscribed to the Google Groups "leo-editor" group.To view this discussion on the web visit https://groups.google.com/d/msg/leo-editor/-/awl88Bnn8IUJ.
To post to this group, send email to leo-e...@googlegroups.com.
To unsubscribe from this group, send email to leo-editor+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
On Tue, Oct 9, 2012 at 7:50 PM, F.S. <speec...@gmail.com> wrote:
> It is probably not too hard to create an Emacs mode for Leo? With Leo's core outlining and Python scripting capability integrated with Emacs power in basic editing and countless modes.
Are you familiar with the "Leo and Emacs" chapter?
http://webpages.charter.net/edreamleo/emacs.html
This makes Leo outlines accessible from emacs.
Furthermore, much of Leo could be considered an emacs mode: I (or
others) have moved ideas from Emacs to Leo. Dynamic abbreviations are
only the latest in a long line of improvements inspired by emacs.
But you might have been asking whether it would be possible to do a
"Leo" mode in elisp within emacs itself. That would be a *big*
project. The major tasks:
-**Important**: I would be happy if some power emacs and Leo user
Imo, the only way to support a significant code base is to care enough
about it to use it every day.
Edward