Doctest Mode: MMM-Mode Support

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:

  • The doctest-docstring submode class is used to edit docstrings containing doctest examples in python-mode.
  • The doctest-example submode class is used to edit doctest examples in text-editing modes such as rst-mode.

Enabling Doctest-Mode's MMM-Mode Support

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).