lang/org: major refactor
The motivation for this change was to rethink lang/org's flags. Many of its former flags represented non-features. Therefore, its flags have been reduced to five: +dragndrop, +ipython, +pandoc, +gnuplot and +present. Everything else is included as org-load-hooks and treated as reasonable defaults. Other changes: - Fixes #1502: don't autopair certain pairs when in a math region - Fixes #1483: broken localleader in org-agenda - Adds gnuplot support #1108 - Doom's org submodules have been moved into lang/org/contrib/, because I expect there will be *many* more to come, and I don't want to pollute the moudle's root.
This commit is contained in:
parent
9752cc005c
commit
11bfb17894
17 changed files with 972 additions and 809 deletions
38
modules/lang/org/contrib/ipython.el
Normal file
38
modules/lang/org/contrib/ipython.el
Normal file
|
@ -0,0 +1,38 @@
|
|||
;;; lang/org/contrib/babel.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! ob-ipython
|
||||
:defer t
|
||||
:init
|
||||
(defvar +ob-ipython-local-runtime-dir nil)
|
||||
|
||||
(setq ob-ipython-resources-dir ".ob-ipython-resrc")
|
||||
|
||||
(defun +org|babel-load-ipython (lang)
|
||||
(and (string-prefix-p "jupyter-" (symbol-name lang))
|
||||
(require 'ob-ipython nil t)))
|
||||
(add-hook '+org-babel-load-functions #'+org|babel-load-ipython)
|
||||
:config
|
||||
(set-popup-rules!
|
||||
'(("\\*ob-ipython.*"
|
||||
:slot 2 :side right :size 100 :height 0.2
|
||||
:select nil :quit nil :transient nil)
|
||||
("^\\*Python"
|
||||
:slot 0 :side right :size 100
|
||||
:select nil :quit nil :ttl nil)
|
||||
("\\*Python:.*"
|
||||
:slot 0 :side right :size 100
|
||||
:select nil :quit nil :transient nil)))
|
||||
|
||||
;; advices for remote kernel and org-src-edit
|
||||
(advice-add 'ob-ipython--create-repl :override #'+org*ob-ipython--create-repl)
|
||||
(advice-add 'org-babel-edit-prep:ipython :override #'+org*org-babel-edit-prep:ipython)
|
||||
(advice-add 'org-babel-execute:ipython :override #'+org*org-babel-execute:ipython)
|
||||
(advice-add 'org-babel-ipython-initiate-session :override #'+org*org-babel-ipython-initiate-session)
|
||||
|
||||
;; retina resolution image hack
|
||||
(when (eq window-system 'ns)
|
||||
(advice-add 'ob-ipython--write-base64-string :around #'+org*ob-ipython--write-base64-string))
|
||||
|
||||
;; ipython has its own async keyword, disable ipython in ob-async.
|
||||
(after! ob-async
|
||||
(add-to-list 'ob-async-no-async-languages-alist "ipython")))
|
Loading…
Add table
Add a link
Reference in a new issue