An Emacs mode for editing Python code

lp:~freiksenet/python-mode/hide-show-support

Created by Mikhail Novikov on 2009-09-01 and last modified on 2010-01-17

Improved version of http://mail.python.org/pipermail/python-mode/2006-April/000353.html patch. Adds hide-show support to python.

Hiding is customizable with two custom setting variables - py-hide-show-keywords specifies keywords whose blocks you want to be hideable and with py-hide-show-hide-docstrings you can specify if you want docstrings to be hidden.

This was done as part of Tero Karvinen Linux Basics course at Haaga-Helia UAS.

Known issues:
* Considers end of docstring to be a block too as end gets matched by block head regex.

* Some versions of emacs introduced bug to hideshow that makes this work badly. Hideshow.el from emacs trunk works fine.

*Hideshowviz.el conflicts with python-mode because it implements own mod-map. To fix it comment out stuff in hideshowviz like this:

in function
(define-minor-mode hideshowvis-minor-mode ()
----some-code
           ;(use-local-map hideshowvis-mode-map)
           )
        (remove-overlays (point-min) (point-max) 'hideshowvis-hs t)

And add this line to your .emacs:

(add-hook 'hideshowvis-mode-hook (global-set-key [left-fringe mouse-1] 'hideshowvis-click-fringe))

Get this branch:
bzr branch lp:~freiksenet/python-mode/hide-show-support
Only Mikhail Novikov can upload to this branch. If you are Mikhail Novikov please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Mikhail Novikov
Project:
python-mode.el
Status:
Merged

Recent revisions

355. By Mikhail Novikov on 2009-09-27

Fixed XEmacs bug of adding stuff too many times.

354. By Mikhail Novikov <email address hidden> on 2009-09-15

Customization possibility added.

353. By Mikhail Novikov <email address hidden> on 2009-09-02

Added support for more constructs and support for docstrings

352. By Mikhail Novikov <email address hidden> on 2009-09-01

Added hide-show support.

351. By Barry Warsaw on 2009-03-20

When shifting regions right and left, keep the region active in Emacs.

350. By Barry Warsaw on 2009-03-19

Emacs 23 has apparently changed the way transient-mark-mode works, so that we
now have to catch the 'mark-inactive signal that can occur. We really want to
say "if there's no mark, (mark) should return nil".

349. By Barry Warsaw on 2009-01-29

Post release tweaks.

348. By Barry Warsaw on 2009-01-29

Place this file under the GPLv3 and bump the version number.

347. By Barry Warsaw on 2008-11-29

None should be a pseudo keyword even though it's a keyword in Python 3.0. The
difference is that keywords must have spaces around them, but pseudo keywords
need not be surrounded by spaces.

346. By Barry Warsaw on 2008-11-28

Post-release tweaks.

Branch metadata

Branch format:
Branch format 6
Repository format:
Bazaar pack repository format 1 with rich root (needs bzr 1.0)
This branch contains Public information 
Everyone can see this information.