match braces?

Grant Edwards invalid at invalid
Thu Sep 3 16:33:57 CEST 2009

On 2009-09-03, Ben Finney <ben+python at> wrote:
> Tim Chase <python.list at> writes:
>> Any editor worth its salt will offer indentation-based folding (I know
>> vim does, and I would be astonished if emacs didn't.
> Emacs calls that ???hide/show???, and the ???hs-minor-mode??? can be enabled for
> any buffer (and can thus of course be automatically enabled on defined
> conditions, e.g. whenever a Python buffer is detected).
> Learn more at <URL:>.

There's only one problem: it doesn't work out-of-the-box.  At
least it never has for me.  The only thing it knows how to hide
is the entire body of a function definition.  I never want to
do that.  What I want to do is hide/unhide the blocks within
if/then/else or loops so that the control flow is clearer.
Emacs hs-minor-mode won't do that (at least not for me).

ISTR that you are supposed to be able to get it working by
replacing python-mode with some after-market version and then
patching the hide-show code or something like that -- but I've
never been brave enough (or bored enough) to attempt it.

Grant Edwards                   grante             Yow! Not SENSUOUS ... only
                                  at               "FROLICSOME" ... and in
                                 need of DENTAL WORK ... in

More information about the Python-list mailing list