nxhtml team mailing list archive
-
nxhtml team
-
Mailing list archive
-
Message #00180
[Question #102628]: Python, ReStructuredText and MuMaMo
New question #102628 on nXhtml:
https://answers.launchpad.net/nxhtml/+question/102628
Hello!
I would like to edit Python code that contains docstrings in ReStructuredText [1]. By looking at nXhtml's code, I managed to write the following Lisp functions:
;; Python + ReST with nxHtml's MuMaMo
(defun ms-python-long-string (pos min max)
"Find Python long strings. Return range and 'mumamo-comment-mode.
See `mumamo-find-possible-chunk' for POS, MIN and MAX."
(mumamo-quick-static-chunk pos min max "\"\"\"((" "))\"\"\"" nil 'rst-mode nil))
(define-mumamo-multi-major-mode ms-python-rst-mumamo-mode
"Turn on multiple major modes for Python with RestructuredText docstrings."
("Python ReST Family" python-mode
(ms-python-long-string)))
The resulting mode doesn't work, though. Using emacs 23.1.1 from Ubuntu, it doesn't identify any chunks. With the emacs snapshot currently delivered with Ubuntu, it recognizes the first chunk, but Python indentation and text coloring stops working after that chunk.
What am I doing wrong? This would be very useful to me and, I guess, to many other people, since ReStructuredText is becoming the official documentation format for Python.
[1] http://docutils.sourceforge.net/rst.html
--
You received this question notification because you are a member of
nXhtml, which is an answer contact for nXhtml.