mmm-mode is an Emacs minor mode that allows multiple major modes to coexist in a single buffer. doctest-mode version 0.5 (alpha) defines two "mmm submode classes," which can be used to edit and run doctest examples using within other modes:
To enable doctest-mode's support for mmm-mode, add the following two lines to your emacs init file (just after the lines that install doctest-mode):
(autoload 'doctest-register-mmm-classes "doctest-mode") (doctest-register-mmm-classes t t)
Then restart Emacs (or reload your configuration file).