jupyter-insert: Only fontify the docstring region for Python inspect requests

* jupyter-python.el (jupyter-insert): Do it.
This commit is contained in:
Nathaniel Nicandro 2018-11-14 02:21:40 -06:00
parent 45a62b6b81
commit 0052d9b30f

View file

@ -63,9 +63,14 @@ buffer."
(cond
((and (eq mime :text/plain)
(eq (jupyter-message-type msg) :inspect-reply))
(when (search-forward "Docstring:" nil t)
(save-excursion
(goto-char (point-min))
(when (re-search-forward "^Docstring:" nil t)
(jupyter-fontify-region-according-to-mode
#'rst-mode (1+ (point)) (point-max))))
#'rst-mode (1+ (point))
(or (and (re-search-forward "^File:" nil t)
(line-beginning-position))
(point-max))))))
(t nil)))))
(cl-defmethod jupyter-load-file-code (file &context (jupyter-lang python))