Thanks for the update. As it happens, My personal I-need-this-in-an
editor list overlaps Robin's write a bit, so this post has re-ignited my
interest in Leo. I just went an poked at Leo's web site a bit, and did
not find the answer (quickly!) to these questions:
OS-X support?
- native-ish key bindings (for the biggies, anyway - cut, copy,
paste, etc.).
- Set up to run as a *.app -- drag and drop file son it, etc.
Language support: what kinds of text files are supported out of the box?
- C/ C++ ?
- LaTeX ?
- HTML/ XML ?
- CSV (or tab-delimited) ?
- plain old text, with spell checking and stuff like that.
Other questions:
Why so long with the interactive search -- that is THE FEATURE that I
NEED in an editor -- it is really remarkable how much more efficient it
is than having to decide how much a search term I need to type, and then
search for it!
Interesting about the wx front-end -- frankly, I don't think I care --
I'm a wx guy, but if I have a good editor, I can't really imagine I'd
need to be writing custom GUI code for it, so I don't really care what
toolkit it uses -- as long as it runs on all three platforms I need.
Python scripting I do want -- so I am looking for an editor scriptable
in Python
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
I use incremental search as basically my main means of navigating
through a large file of code. Basically when I want to go somewhere
in the code I try to recall a short, fairly uncommon string of letters
that was associated with that place. Like maybe I recall that I used
the word "inaccurate" in a comment in the function I'm looking for,
I'll just start searching for "inac" and since I already picked it to
be a not-so-common word, usually by the 4th or 5th character I've
arrived where I want to be. The word could also be a variable name or
part of the function name.
Re: leo fulfilling Robin's dream (a dream which I share)
[Disclaimer: my knowlege of Leo come only from going through a few of
the tutorials just now]
It seems to me that Leo kind of oversteps the bounds, going from being
an editor to being a different way to work. More like a text file
IDE. That's fine but I think (for better or worse) what most people
want something that is essentially just an editor. It seems Leo wants
me to turn every little editing task into some kind of
hierarchy-building exercise. I have to admit I've never liked any of
the "code folding" or "outline view" modes in any product I've ever
used. I don't find them even remotely compelling. I'd rather just
have things presented simply, with a good way to navigate around
(read, powerful search). It's kind of the same philosophy as you see
in Sherlock and other desktop search paradigms these days. I don't
want to spend time managing or navigating hierarchies. I just want to
be able to jump directly to what I need by typing a few letters. I'm
sure there are great benefits to the Leo approach but, not being a fan
of outlines, these things don't jump out at me.
I also really don't like the idea of my directories becoming littered
with .leo files all over the place. Or the idea of my files
themselves becoming littered with funky comments that only Leo
understands. I think that just won't fly in an environment where you
work on code with other people.
Looking forward to your response.
--bb
I would have to agree. I simply wouldn't use any tool that did either of
those things.
Can't all the .leo files live in one place per project project?
Ali
Ali
I'm in the middle, sometimes I want 'chunking', sometimes 'slurping'
(slurp = @auto node where the body holds the entire file, no auto
hierarchalization.
I think Leo needs 3 things to minimize dissonance in the newcomer experience:
- @auto <file>
in place
- rock solid vim.py
I'm still having trouble
- chunk / slurp toggling in the core
'click here' to toggle between flat file and hierarchal experience.
Moving from vim* to Leo is then seamless, Leo manages your source files,
you drop into vim and back effortlessly, Leo doesn't impose chunking files,
but offers it.
Then a 5 minute screencast demoing this setup and showing the creation
of a few buttons ... the world will be Leo's oyster.
*your editor's name here
Thanks,
Kent
[snip]
> I'm glad you said this, because it gives me a chance to repeat the
> essential statement of my first post:
>
> To displace Emacs, an editor must offer much *more* than Emacs.
>
> To say this another way, Robin's post makes no sense if all we want
> is:
>
> a) an Editor and
> b) an Editor with all and only Emacs's features!
>
> Do you see? Nobody in their right mind is going to spend years *just*
> duplicating Emacs. Emacs is *already* an open source project.
Over the years (and in particular since Scintilla was made available
in various programming languages via wrappers), I've seen a lot of
editors spring up with different features, designs, goals, etc. More
than a few of them state that one of their goals is to "replace X",
where X = Emacs, Vim, Eclipse, and any one of a number of other
editors, tools, etc.
Every editor has their unique features and designs that gives each one
of them an edge in one way or another. But not all of them can
replace Emacs ;) . Then again...I'm not sure that it really makes
sense to replace Emacs or Vim (WRT major functionalities); the
console-centric nature of both of them has invaded even their "GUI"
variants, and the various clones suffer (IMO) from the same
limitations that the original Emacs and Vim.
To really change programming, and really start replacing the "old
standards" without cloning them, I think, requires thinking
substantially different from what the mainstream has thought "right"
before. The browser in "Code Browser"
(http://code-browser.sourceforge.net/images/code-browser-pane.png) is
awesome, as is the general source navigation demo
(http://code-browser.sourceforge.net/demo.html). The multi-editing
capabilities of SubEthaEdit
(http://www.codingmonkeys.de/subethaedit/collaborate.html) blow me
away every time (I've been waiting for wxPython to wrap the
multi-indicator build of Scintilla for over a year so that I can
implement it myself :P ).
I do think that Leo does things differently from other editors that
came before and exist currently, so in that sense, *I* think that
Edward's doing a great job. The real question is whether Edward can
get people who write and love their own editors to drop them in favor
of Leo ;) .
Just my 2 cents.
- Josiah
I do think that Leo does things differently from other editors that
came before and exist currently, so in that sense, *I* think that
Edward's doing a great job.
The real question is whether Edward can get people who write and love their own editors to drop them in favor of Leo ;)
> Please let me know how the new isearch commands work for you. It
> should be easy to add features, but the commands work pretty much as
> in Emacs.
I'm not sure how to get a working copy of Leo's trunk. Do you put
snapshots anywhere?
> People who haven't used Leo typically misjudge what is important in
> Leo. That's because Leo changes how people work. More about this in
> the next section.
All these answers are encouraging. I think the issue I have now might
be like the one the poster below suggests. You have various tutorials
about the many advanced and unique features of Leo, but do you have a
basic tutorial anywhere explaining how you just open edit a file?
Like what M-x help-with-tutorial does in Emacs. I just fired up Leo
and got stuck on how to open a source file, when Open... seems to only
open .leo files.
>> It seems to me that Leo kind of oversteps the bounds, going from being
>> an editor to being a different way to work. More like a text file
>> IDE. That's fine but I think (for better or worse) what most people
>> want something that is essentially just an editor.
>
> I'm glad you said this, because it gives me a chance to repeat the
> essential statement of my first post:
>
> To displace Emacs, an editor must offer much *more* than Emacs.
>
> To say this another way, Robin's post makes no sense if all we want
> is:
>
> a) an Editor and
> b) an Editor with all and only Emacs's features!
>
> Do you see? Nobody in their right mind is going to spend years *just*
> duplicating Emacs. Emacs is *already* an open source project.
Well, there's Cody Precord, working on Editra. For some people,
having an Emacs-like editor that's not tied to Lisp is motivation
enough.
>> It seems Leo wants me to turn every little editing task into some kind of
>> hierarchy-building exercise.
>
> Leo doesn't "want" you to do anything in particular, and neither do
> I. Leo provides a set of new tools, not available anywhere else, and
> not even "conceivable" in Emacs. What you do with Leo is up to do.
> You certainly do not have to create hierarchies if you don't want
> them.
Sounds good, but some tutorials on how to use Leo to just go about
your business as usual would be helpful.
>> I have to admit I've never liked any of the "code folding" or "outline view" modes in any product I've ever used. I don't find them even remotely compelling.
>
> Again, I'm glad you said this. The problem with all other outliners is
> that they have no memory, so the outline gets in the way rather than
> helps. Leo outlines have "state" in two senses. The first (small)
> sense is that it remembers where you left off before. Even this
> trivial memory is a big advance over typical class browsers.
>
> The second (large) sense in which Leo has a memory is that Leo
> remembers how *you* organized your data. And there is no single
> "right way" for *you* to organize your data. You can embed
> arbitrarily many of *your* views of the data into a single outline.
>
> I think you will find that what you can do with Leo outlines goes way
> beyond any kind of outline mode you have ever used. In particular,
> you will find that nothing in Emacs comes close to matching what you
> can do with Leo outlines.
>
> So *of course* you don't see the value of Leo outlines. Yet.
>
>> I'd rather just have things presented simply, with a good way to navigate around
>> (read, powerful search).
>
> Leo has powerful search, but searching flat text does not give you a
> rich dom (document object model). From a theoretical point of view,
> Leo's dom is the essential difference between Leo and any other
> editor.
Ok, but it should degrade gracefully to a 1-node dom being equivalent
to "plain old text file", right? I think making this kind of thing
work transparently is pretty important to getting newbies to not
uninstall Leo the minute they find they can't open a text file. There
are dozens of editors out there that are happy to open a text file
with Ctrl-O and let you edit it. Leo seems to require something else
non-obvious for this simple task, so it makes the road unnecessarily
bumpy.
>> It's kind of the same philosophy as you see in Sherlock and other desktop search
>> paradigms these days. I don't want to spend time managing or navigating hierarchies.
>
> You might change your mind after you have tried Leo.
I think both can be useful. iTunes has both hierarchical organization
and fast search.
>> Looking forward to your response.
>
> And now you have it. I'm looking forward to your comments after you
> use Leo for more than a few minutes :-)
I'm now looking for the "Using leo as an editor" section of the
beginner's guide. There's a section on "using leo as an outliner"
right near the beginning, but no section about using leo as an editor.
What's the minimal number of steps required for an absolute newbie to
open up grocery-list.txt and add "milk"?
I think if you can soften the transition a bit from regular editor to
the leo way, you can probably convince a few more people. I think
this is probably what Kent Tenny is talking about with his slurping
@autos comment below, but I don't know what it means to slurp an @auto
well enough to be sure.
--bb
There are several ways Leo can be used to edit files.
they are nodes with headlines like:
@shadow myfile.txt
@nosent /etc/hosts
@thin leoCode.py
...
Each offers a compelling combination of features.
an @auto node
@auto launchpad/project/dvcscode.py
does not add any Leo 'sentinels' (comments which are Leo organizers)
to the file dvcscode.py
When Leo is opened it reads dvcscode.py and, by default, 'chunks' it
into nodes, a hierarchy of declarations, classes, methods, functions.
The term 'slurp' describes behaviour which would place the entire dvcscode.py
file into one node, thus presenting a traditional view of the file.
So, a slurped @auto is most like the editing experience folks are used to.
If the vim plugin is enabled, double clicking the node icon loads the contents
into vim: edit, save, exit, the node contents are changed.
So, slurped @auto with the vim plugin, very unobtrusively adds convenience
to the editing experience if you're a vimmer. (there's an iceberg
below this tip)
Thanks,
Kent
>
> --bb
>
I'm not sure how to get a working copy of Leo's trunk. Do you put
snapshots anywhere?
All these answers are encouraging. I think the issue I have now might
be like the one the poster below suggests. You have various tutorials
about the many advanced and unique features of Leo, but do you have a
basic tutorial anywhere explaining how you just open edit a file?
> From a theoretical point of view, Leo's dom is the essential difference between Leo and any other editor.Ok, but it should degrade gracefully to a 1-node dom being equivalent
to "plain old text file", right? I think making this kind of thing
work transparently is pretty important to getting newbies to not
uninstall Leo the minute they find they can't open a text file. There
are dozens of editors out there that are happy to open a text file
with Ctrl-O and let you edit it. Leo seems to require something else
non-obvious for this simple task, so it makes the road unnecessarily
bumpy.
I think if you can soften the transition a bit from regular editor to
the leo way, you can probably convince a few more people.
Thanks. That's only so much help, though, when I'm still stuck on how
to open a file. :-)
> Your question illustrates why newbies are so important to Leo. I hadn't
> realized that there is no obvious link to this page. I'll put a link to it
> on Leo's home page and in Leo's FAQ.
>
> However, if at all possible, I recommend using bzr to get the latest version
> of Leo. In the long run, this is much more convenient than getting
> snapshots. Furthermore, bzr is a superb tool, well worth learning in its
> own right. Leo has benefited greatly from bzr branches created by
> developers. And you will need to use bzr if you intend to extend Leo.
>
> For instructions about bzr, see the first entry in Leo's FAQ:
>
> http://webpages.charter.net/edreamleo/FAQ.html#how-do-i-use-bzr-to-get-the-latest-sources-from-leo-s-launchpad-site
Thanks for the link. I'm using mercurial regularly and I hear it's
pretty much the same thing as bzr. And since there seems to be no
clear winner in the fight to become the world's dominant dvcs, I might
as well have bzr handy too.
>> All these answers are encouraging. I think the issue I have now might
>> be like the one the poster below suggests. You have various tutorials
>> about the many advanced and unique features of Leo, but do you have a
>> basic tutorial anywhere explaining how you just open edit a file?
>
> Good point. Improving Leo's tutorial is becoming urgent.
>
> I'd like to rewrite all of Leo's introductory docs using a "story-based"
> approach inspired by the book "Ideas that stick". Using Leo to "just open
> and edit a file" would be one of the very first stories.
Don't know that book, but the idea sounds good.
> So we have a good collaboration going already. You've highlighted several
> things that will confuse newbies.
I'm glad that you're taking these comments as constructive criticisms
rather than getting defensive about it.
>> I think if you can soften the transition a bit from regular editor to
>> the leo way, you can probably convince a few more people.
>
> I agree completely. I'll see what I can do in the next three days...
Great. I have some old code (that I wrote once upon a time) that I'll
be going through soon, and it seems like an ideal chance to put leo's
annotation skills to the test.
--bb
First:
It mostly works, which is a real testament to Python and tkInter
--pretty cool!
>> OS-X support?
>> - native-ish key bindings (for the biggies, anyway - cut, copy,
>
> You can choose bindings as you wish in myLeoSettings.leo.
I'll have to mess with that, but out of the box, only ctrl works. Even
though there are bindings listed in the menus for alt and alt+shift,
they don't work.
I'm surprised that TK didn't make more of of them work by default -- oh
well.
>> - Set up to run as a *.app -- drag and drop file son it, etc.
>
> OS-X support isn't the best.
It wouldn't be too hard to add that if I (or someone else with a Mac )
choose to -- and there are also some layout issues it would be nice to
fix -- buttons too close together, etc.
>> Language support: what kinds of text files are supported out of the box?
> Leo supports syntax coloring for all languages supported by jEdit,
Good start -- but syntax coloring is only a start. Is there any other
support?
>> Why so long with the interactive search --
You've go that now, but it either is broken, or there was a
misunderstanding of what it means -- it seems to just search one letter
-- that's not what we (or at least, I) want. We want to be able to type
s many letters as we need to get to what we're looking for:
type a "t" get the first "t", then type an "h", get the first "th", type
an "e", get the first "the", etc...
In the middle of that, you should be able to type <enter> or the
I-search keystroke and get the next occurrence of that string.
Firefox has a pretty good one, if you want an example.
Other notes:
I could easily just open a file -- no problem there any more.
Indenting:
Almost no editors get this right. It's critical for Python, but good to
have for any programming language. (X)Emacs gets it right, and Peppy
gets it right -- those are the only two I know of. Here's what I mean by
"right"
* The <tab> key means "indent this line as it should be"
- if you are at the beginning of a blank the line, it puts the cursor
at the right indent level, whatever that is.
- if you are in the middle of the line, it indents that line to where
it should be
* if the <backspace> key is pressed in the indentation space, it means:
reduce the indentation level by one.
Whether an indentation level is a tab or n spaces should be set-able
depending on the type of file and/or personal preference.
There is one trick for Python: there are often multiple indentation
levels that are "right", depending on what the programmer wants:
if something:
some code
if SomethingElse:
some more code
so, what is the "right" indentation level for the next line? Peppy, and
I'm pretty sure emacs, would put it two levels in. If you don't want
that, you hit <backspace> once or twice as need be.
I find this method works very well, and I'm amazed by how much I miss it
when I use any other editor.
I got the latest Leo from bzr, and tried it out on OS-X
I'll have to mess with that, but out of the box, only ctrl works. Even though there are bindings listed in the menus for alt and alt+shift, they don't work.
I'm surprised that TK didn't make more of of them work by default -- oh well.
syntax coloring is only a start. Is there any other support?
You've go [isearch] now, but it either is broken, or there was a misunderstanding of what it means
Almost no editors get [indenting] right.
Whether an indentation level is a tab or n spaces should be set-able depending on the type of file and/or personal preference.
I have no idea -- I've never used PyQT.
> The bindings work on Ubuntu and Windows, but not necessarily on MacOS
> because of different key names and usages. Have you tried setting:
>
> @bool swap_mac_keys = True
OK I've tried this, and it works OK.
However, to do it, I went to the help menu, and selected "Open
LeoSetting.leo"
which gave me a nice tree of settings, but I couldn't find
"swap_mac_keys". I poked around, and didn't find it, I did a search for
"swap" and didn't find it. In fact, what I did do is open the file in
another editor, search for "swap", change it save it and re-start leo.
I don't know if that's 'cause i just don't know how to use leo -- but
it's really making think that this is a major leap from plain old text
file editing!
> I'll be happy to add a node/tree for Mac-centric bindings if you
> contribute it.
we'll see -- I need to convince my self that this outlining way of
working is worth it...But it's nice to know that Mac support is probably
only as far away as a Mac user willing to help a bit.
> syntax coloring is only a start. Is there any other support?
>
> What support would you like?
well, at least good indenting, etc, and hopefully a way to runt eh code,
or built it or whatever. Also assorted shortcuts, I write LaTeX a fair
bit, and it's nice to have help with that.
> It works using the qt gui. There are focus problems with the tk gui
> that cause the minibuffer to reset to a single character. I had
> forgotten about this in the recent flurry of activity. I'll declare
> this a 3-day bug.
fair enough.
> Almost no editors get [indenting] right.
>
>
> Debatable. I prefer the present way with auto-indent following a colon.
Have you ever tried it the way I suggest? Probably not -- not many
editors do it.
> We never argue about preferences in Leo, so I'll add the operation you
> describe as option. Another 3-day bug.
Give it a try then, I think you'll be surprised at how much nicer it is!
> Whether an indentation level is a tab or n spaces should be set-able
> depending on the type of file and/or personal preference.
>
>
> It is.
>
> @tabwidth 8 # hard tabs, 8 characters wide.
> @tabwidth -4 # tab with 4 spaces.
that looks to be leo-wide -- what if you want different setting for
different kinds of files? That's another emacs-ism I really like -- the
idea of major-modes and minor modes. Major modes, in particular make it
easy to have the editor behave quite differently depending on what kind
of file you are editing.
> There doesn't seem to be a setting that sets default tab width. It
> appears hard-code at -4.
So what does @tabwidth set?
By the way, a couple TK on OS_C notes:
moving the sashes between windows is really "flashy" -- a bit hard to
describe.
The tree is all messed up while scrolling.
Also, some weirdnesses with line numbers. I'm editing a python file.
There is a syntax error on a line.
In the editing window, it's line 21
when I run it from leo, the error is reported as being at line 24
when I run it from the command line, it's reported as line 19
This is all quite confusing.
One other thing, for a newbie:
I opened a python file, edited it, saved it, and now I have no idea how
to get the edited version! It saved a workbook.leo file, but didn't
touch the python file.
It seems you can't quite use leo as "just a text editor" out of the box.
Still on the fence here.....
Just out of curiosity -- Edward and any other Leo users out there. Do
you actually use Leo for small editing tasks like Christopher
described? Say you need to edit your bazaar.conf file, a simple .ini
file with two lines in it. Is Leo the tool you reach for in that
case? Or do you keep another more basic editor on hand for those
things. Emacs is generally my first choice, even for tiny edits like
that.
--bb
I don't 'reach for' Leo, I 'work from' Leo
I open a Leo file which organizes my stuff
~/work/project/start.leo
(the Leo standard is a file named ~/.leo/workbook.leo)
bazaar.conf is available as
@auto ~/.bazaar/bazaar.conf
which is a child of a top level node named 'configure'
which aggregates configuration files::
configure
@auto ~/bazaar/.bazaar.conf
@auto conf.py
@auto ~/.bashrc
@auto ~/.bzrignore
...
editing the contents of an @auto node and saving the .leo file
changes the file on the filesystem.
> Or do you keep another more basic editor on hand for those
> things.
I'll sometimes double click the @auto node and edit in Vim,
for a small file I'll edit in Leo, but to
do any extensive search/replace stuff I prefer Vim.
Thanks,
Kent