mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
lang/org: add jupyter support to eval handler
This commit is contained in:
@ -8,13 +8,18 @@
|
|||||||
if (save-excursion (goto-char pos) (org-in-src-block-p t))
|
if (save-excursion (goto-char pos) (org-in-src-block-p t))
|
||||||
return (goto-char pos)))
|
return (goto-char pos)))
|
||||||
(message "Nothing to evaluate at point")
|
(message "Nothing to evaluate at point")
|
||||||
(org-babel-where-is-src-block-head)
|
(let ((info (org-babel-get-src-block-info t))
|
||||||
(let ((beg (max beg (match-beginning 5)))
|
(beg (max beg (match-beginning 5)))
|
||||||
(end (min end (match-end 5)))
|
(end (min end (match-end 5))))
|
||||||
(major-mode
|
(cond
|
||||||
(org-src-get-lang-mode (or (org-eldoc-get-src-lang)
|
((and (string-prefix-p "jupyter-" (car info))
|
||||||
(user-error "No lang specified for this src block")))))
|
(require 'jupyter nil t))
|
||||||
(+eval/region beg end)))))
|
(jupyter-eval-region beg end))
|
||||||
|
((let ((major-mode
|
||||||
|
(org-src-get-lang-mode
|
||||||
|
(or (org-eldoc-get-src-lang)
|
||||||
|
(user-error "No lang specified for this src block")))))
|
||||||
|
(+eval/region beg end))))))))
|
||||||
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
Reference in New Issue
Block a user