Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   re: mmm-mode, python-mode and doctest-mode? (http://www.velocityreviews.com/forums/t527623-re-mmm-mode-python-mode-and-doctest-mode.html)

John J Lee 08-07-2007 07:49 PM

re: mmm-mode, python-mode and doctest-mode?
 
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/svnro...octest-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



All times are GMT. The time now is 02:34 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57