[PYTHONMAC-SIG] Future stuff for the Alpha python mode

Guido van Rossum guido@CNRI.Reston.Va.US
Mon, 16 Dec 1996 16:30:36 -0500


> >I want a feature that Emacs mode has, and which is necessary
> >for compatibility with files originating on Unix: while a tab
> >character is worth 8 spaces, the block indentation is worth 4 spaces.
> 
> block indentation, does this have its own keybing?  If so do you use it to
> put in the four spaces in a single line, or does it do what it sounds like,
> ident a (selected?) block?

This is used in a number of places: first, when you type a command
like 'if' or 'def', the next line is indented by this much (rather
than by a tab character).  Next, commands like block shift left
(dedent) and block shift right (indent) shift by this amount.
Finally, Emacs' Python mode has a way to automatically "re-indent" a
line or a block, and it will use this indentation for each level.

> No, I'll just have to change some of the key invoked procedures, (the ones
> for return and tab), and get python mode to change the tab lenght to 8
> instead of the default of four while in the python mode.

OK, this is fine.

> Haven't found ay way to do it yet, since Alpha only uses pattern matching
> to do its colorizing, and not the parsing that lisp allows, it is pretty
> easy for you to write legal combinations that exceed strict pattern
> matching.

Well, a string literal is easy enough recognizable as a pattern -- if
we don't mind that multi-line strings are botched.  Try this (using
Python's regex syntax -- I don't know Alpha's but it can't be too
different):

	'\([^'\\]\|\\.\)*'

(where the quotes are part of the pattern!)  Similar for double quotes.

--Guido van Rossum (home page: http://www.python.org/~guido/)

=================
PYTHONMAC-SIG  - SIG on Python for the Apple Macintosh

send messages to: pythonmac-sig@python.org
administrivia to: pythonmac-sig-request@python.org
=================