I often edit Python code in my Emacs and have it set up to display Python files in Python mode. I often find myself formatting dosctrings as ReStructured Text and I was thinking that it would be great if I could have Emacs show these docstrings as in ReST mode. Is this possible somehow?
Asked
Active
Viewed 525 times
5
-
1Did you have a look at http://www.emacswiki.org/emacs/MultipleModes ? – fredtantini Nov 27 '15 at 14:38
-
1For instance: http://stackoverflow.com/questions/15493342/have-emacs-edit-python-docstrings-using-rst-mode – fredtantini Nov 27 '15 at 14:39
1 Answers
4
You can try this minor mode
https://github.com/glyph/python-docstring-mode
with that conf:
(add-to-list 'load-path "/path/to/python-docstring-mode-master")
(require 'python-docstring)
(add-hook 'python-mode-hook (lambda () (python-docstring-mode t)))
djangoliv
- 181
- 5
-
I have tried installing python-docstring via `package`. It seems to install OK but is nowhere to be found afterwards and gives an error when I try `require`ing it. – Thomas Arildsen Jan 22 '16 at 11:16
-
1I don't use `package` but you can download and unzip it in `/path/to/python-docstring-mode-master` to have a try – djangoliv Jan 22 '16 at 11:56