On Tue, 7 Aug 2007, Edward Loper wrote: > [John J Lee] >> Is it possible to get doctest-mode to work with mmm-mode and python-mode >> nicely so that docstrings containing doctests are editable in doctest-mode? > > I recently released a new version of doctest-mode [1], and I came across your > email [2] (it was on the first page of google hits for "doctest-mode"). So I > decided to have a go at getting doctest-mode to play nicely with mmm-mode. > The result is available here: > > https://python-mode.svn.sf.net/svnroot/python-mode/trunk/python-mode/doctest-mode.el
Nice! Works for me so far (emacs 22). I'm also very pleased to see that doctest-mode no longer attempts to auto-fill at the end of long lines -- that was extremely annoying, and the new behaviour is a big improvement. Here's another wish. My next-nearest doctest-mode annoyance: hitting TAB should have similar behaviour to python-mode. So, the first press of the TAB key gets you a sensible guess at the indentation you want. The second and subsequent TAB keypresses cycle through no indentation, '>>>' indentation, and '...' indentation. Ideally this would be made to work in combination with the standard indentation-cycling behaviour in those cases where multiple indentations are allowed within Python code (so, it might be ' ... ', '', ' >>> ', ' ... ',' ... ', ' ... ' as the TAB key is repeatedly pressed). >> `doctest-example' >> >> Used to edit doctest examples in text-editing modes, such as >> `rst-mode' or `text-mode'. Docstring submode regions start with >> optionally indented prompts (>>>) and end with blank lines. Use >> (C-c % C-e) to insert a new doctest-example region. When >> `doctest-execute' (C-c C-c) is called inside a doctest-example >> region, it executes all examples in the buffer. I couldn't immediately see how to get this working in a .doctest file, so haven't tried this yet. Another wish: Even though I don't normally run code from emacs directly, I do think it would be very handy indeed to be able to execute a *single* doctest example from doctest-mode. Don't know what keybinding would be conventional... John -- http://mail.python.org/mailman/listinfo/python-list