Hacking Heaven - Leo+XEmacs Integrated

Andrew Dalke adalke at mindspring.com
Wed Jan 29 02:43:49 EST 2003


Aum wrote:
> The simpler way to set it up is to just stuck a script called 'leo'
> somewhere in your execution path. The script I'm using (which assumes the
> leo directory is /usr/local/src/leo), is:

Mmmm, may want to clean that up as (untested)

   #!/usr/bin/env python

   import sys, os
   pybin = '/usr/bin/python'
   leodir = '/usr/local/src/leo'
   print sys.argv
   if len(sys.argv) != 2:
     sys.exit("usage: leo filename.leo")
   d, f = os.path.split(sys.argv[1])
   print "dir = '%s', file = '%s'" % (d, f)
   if d:
     os.chdir(d)
   os.execv(pybin, (leodir, f))

but that's besides the point.  The distribution isn't ready
for people to use, at least by people like me who would rather
not have to figure out what's missing from a distribution and
implement it myself.

I realize there are people who like doing that.  Just like
I realize there are people who tweak initialization and other
dot files.  I'm just not one of them.


>>In the local cvs directory?  I didn't see that file located
>>anywhere under the /usr/local/ directory, which is what I
>>expected.  How does any leo installation know to look in
>>the cvs directory for the configuration.
> 
> 
> Depends on where you check out leo to. I use /usr/local/src/leo

You said to "Install Leo from CVS."  I got it from CVS and
installed with "python setup.py install".

You then said "Replace LeoPy.leo with my hacked copy".
That implies replacing it in the installation, and not in
the checkout dir.  But that file doesn't exist in the
installation.

In other words, I am telling you that your directions and
leo's directions for installing it are lacking.  To make
it more likely that people will look into leo, fix the
installation instructions, and fix the other problems
(like a missing "INSTALL.txt") I pointed out.

>>>3. Set up your xemacs so it launches gnuserv on startup
>>
>>Used xemacs for years. .... So, um, how do I do that and why?
> 
> gnuserv is an XEmacs function. Simply stick '(gnuserv)' in your init.el

What is an 'init.el'?  I don't find one in my filesystem.
The closest is /usr/share/xemacs-21.1.14/lisp/x-init.el

Is it the same as a .emacs file?  I don't often customize
things so I don't hav... oh, I do have one!  It says

;; Red Hat Linux default .emacs initialization file

Anyway, I added "(gnuserv)" to the end of my .emacs file and
started xemacs to get the following message


(1) (initialization/error) An error has occurred while loading ~/.emacs:

Symbol's function definition is void: gnuserv

To ensure normal operation, you should investigate the cause of the error
in your initialization file and remove it.  Use the `-debug-init' option
to XEmacs to view a complete error backtrace.



BTW, what I'm trying to do is again point out that just because
you know what to do doesn't mean that others know what to do.
I could likely root around the xemacs.org site to figure this out,
but why is it worth my time to figure out all the missing parts?

Oh, and it appears that I can start gnuserve with M-x gnuserve-start
However, leo doesn't seem to affect it at all.  (I tested that it
worked by using 'gnuclient'.)

BTW, you said "slide the divider all the way right so no code pane
is visible, then resize the window to thin and tall".  Isn't the
code pane on the bottom, so to make it disappear I move the horizontal
slider all the way to the bottom?  I have three frames, which look
like

    -------------------
   |            |      |
   |  tree      |  log |
   |            |      |
   |--------------------
   |                   |
   |   code            |
   |                   |
   |                   |
    -------------------

Note that none of the examples in the documentation show a screenshot
with the log window and the doc for "equal sized panes" implies
there should be only two
   The Equal Sized Panes command resizes the panes so that each
   fills half of the main window.

I completely agree with Jack Diederich's comment that the leo site
and documentation is very vague.  There's nothing to walk through
the basics of what it means to use the editor.  I am not going to
spend much time trying to figure things out.

Now, I think the idea of an outlining editor is interesting, which
is why I'm putting this effort into having you all clean up the
code and fix things up so it's more accessible to people whose
brains don't automatically understand what it's about.



> XEmacs will run normally, but with one difference. If another process on
> your system executes the command 'gnuclient filename', it's the same as it
> executing 'xemacs filename', except the file gets opened in the same
> instance of xemacs. Magic really.

Hmmm.  I do recall someone talking about that about 5 years ago.
Never looked into it.

> As above, put '(gnuserv)' in your init.el

As above, what init.el?

>>How do I start leo?  Nothing is installed under /usr/local/bin.
>>Ahhh, okay, grep for "__main__" shows that the exectuable is
>>'leo.py', which is not marked as executable out of cvs so I need
>>to run it as 'python leo.py'.
> 
> 
> Use the above script.

My point it that that step isn't obvious.  Why isn't that
program installed into /usr/local/bin/leo?  Why isn't that
script marked as executable in CVS?


>>Looks like I shouldn't have done the 'python setup.py install'?
> 
> Doesn't seem to be needed.

Then why is it there and why isn't there anything which describes
how to install the package (like the INSTALL.TXT which the
CHANGELOG^WREADME says is supposed to be there).  The standard
practice is that you install Python code with setup.py, so this
violates that practice.

> Check out my screenshot at:
> http://www.freenet.org.nz/downloads/leo-screenshot.gif

I did.  It looks, btw, like there's no way I can keep the Python
code in one file.  For example, I'll do a search for "self.var"
in xemacs to view all uses of the var attribute in a class,
but since everything is broken up into small files, I lose that
ability.

And searches in leo aren't interactive like they are in emacs.

I have no more time to investigate this.  Could you please
bring it up again in a few months, once all these usability and
support issues have been addressed?

					Andrew
					dalke at dalkescientific.com





More information about the Python-list mailing list