branch : pmacs2
This commit is contained in:
moculus 2007-07-17 11:40:04 +00:00
parent 81b84b24e1
commit 16c4448bac
2 changed files with 43 additions and 11 deletions

42
README
View File

@ -1,19 +1,51 @@
Pmacs version 0.1
Released june 27, 2007 by Erik Osheim <erik@osheim.org>
Released June 27, 2007 by Erik Osheim <erik@osheim.org>
Pmacs is an Emacs-like editor written entirely in Python. It is designed to have
maximally correct and powerful support for syntax highlighting, indenting, etc.
and to be extensible in python.
maximally correct and powerful support for syntax highlighting, to support
various methods of automatically indenting lines, and to be extensible in
python.
Pmacs is available to you under the GPL version 2.
While the general interface of pmacs is related to emacs, there was explicitly
no attempt to support all emacs' functions, emacs' underlying data structures,
or even high-level. There is not currently a formalized "public API" for pmacs,
although some parts are "more public" than others. The code is somewhat
commented, although currently there is only one author. Buyer beware!
Requirements:
=============
1. python 2.3 or higher
2. ncurses
Optional Dependencies:
======================
1. ispell
2. aespipe
3. perl
4. ctags
5. cvs
6. svn
Quick Start Guide:
1. Download and unpack the pmacs tarball file. After this, there should be
a directory called "pmacs2" somewhere in your filesystem. It doesn't
matter where you put this. We'll call the full path to this directory
PMACSDIR; in future steps substitute the actual path for this symbol.
2. Create a symlink to PMACSDIR/application.py and put it in a directory
listed in your $PATH (~/bin, /usr/local/bin, and /usr/bin are all good
candidates). You can name this symlink whatever you want; I use "pmc".
3. Try editing a file, by typing "pmc FILE" where FILE is the path to the
file you want to edit.
4. Edit the file!
You can type Control-c and then Meta-h to get a list of all the
available actions and which key(s) perform them. Type Control-x k to get
out of the "help buffer". If you have used emacs, many (but not all) of
these keybindings should seem familiar.
5. To save your changes, type Control-x Control-s. To quit, type Control-x
Control-c. To quit without saving changes, type Control-c Control-c.
There is currently no other documentation (besides comments in the code). Good
luck!

View File

@ -19,11 +19,10 @@ class Handler(object):
def add_action(self, action):
if self.window is None:
return
if action.name in self.window.application.methods:
elif action.name in self.window.application.methods:
return
if action.name in self.window.application.methods:
raise Exception, "Action %r already found" % action.name
self.window.application.methods[action.name] = action
else:
self.window.application.methods[action.name] = action
def del_action(self, name):
if self.window is None:
return
@ -33,9 +32,10 @@ class Handler(object):
def add_binding(self, name, sequence):
if self.window is None:
return
if name not in self.window.application.methods:
elif name not in self.window.application.methods:
raise Exception, "No action called %r found" % name
self.bindings[sequence] = name
else:
self.bindings[sequence] = name
def add_bindings(self, name, sequences):
if self.window is None:
return