Hacking Heaven - Leo+XEmacs Integrated

Aum spam at al-queda.org
Tue Jan 28 22:56:10 EST 2003


On Tue, 28 Jan 2003 17:17:44 -0700, Andrew Dalke wrote:

> Aum wrote:
>> Installation:
>> 1. Install Leo from CVS - instructions on the Leo website (above)
> 
> I couldn't find anything other than the standard Sourceforge
> CVS instructions, which wasn't all that obvious to find.  Did
> you mean anything else?
> 
> I then did a 'python setup.py install' which is not mentioned
> on the CVS directory.  There is a 'README.txt' which is more
> of a CHANGELOG than a README.  The first line says
> 
>   Important note: See INSTALL.TXT for installation instructions.
> 
> but there is no 'INSTALL.TXT' anywhere in the cvs distribution.
> 
> Note that it installs 20 modules in site-packages, as compared
> to a module, which is what I would have prefered.

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:

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

Then, I can just type 'leo filename.leo' and it comes up fine.

>> 2. Replace LeoPy.leo with my hacked copy:
>>    http://www.freenet.org.nz/downloads/LeoPy.leo
> 
> 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

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

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.


> I did find
>    Options -> Customize -> Emacs -> Environment -> Gnuserv
> but nothing which said "launch gnuserv on startup"

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

>> 4. Open a leo window on the left of the screen - slide the divider all the
>>    way right so no code pane is visible, then resize the window to thin and  
>>    tall
> 
> 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.

> Looks like I shouldn't have done the 'python setup.py install'?

Doesn't seem to be needed.

>> 5. Open Xemacs on the right.
> 
> That one I can do.
> 
>> Try out this combo - you might just love it.
> 
> I tried.  So far it's in the category of "maybe a great idea
> but not yet at the state for me."

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

Cheers
A





More information about the Python-list mailing list