[Org] Move Hy Babel code to ‘db-org’

This commit is contained in:
Daniel - 2018-08-04 12:32:54 +02:00
parent 24a59404a0
commit d0a98c9c6a
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
2 changed files with 16 additions and 13 deletions

13
init.el
View File

@ -1205,19 +1205,6 @@ are assumed to be of the form *.crt."
(add-hook 'hy-mode-hook 'lispy-mode)
(add-hook 'hy-mode-hook 'inferior-lisp)))
(defun org-babel-execute:hy (body params)
;; http://kitchingroup.cheme.cmu.edu/blog/2016/03/30/OMG-A-Lisp-that-runs-python/
"Execute hy code BODY with parameters PARAMS."
(ignore params)
(let* ((temporary-file-directory ".")
(tempfile (make-temp-file "hy-")))
(with-temp-file tempfile
(insert body))
(unwind-protect
(shell-command-to-string
(format "hy %s" tempfile))
(delete-file tempfile))))
;; * TeX

View File

@ -886,6 +886,22 @@ Current Task: %`org-clock-current-task; "
(when (package-installed-p 'org-download)
(use-package org-download))
;;; Babel
(defun org-babel-execute:hy (body params)
;; http://kitchingroup.cheme.cmu.edu/blog/2016/03/30/OMG-A-Lisp-that-runs-python/
"Execute hy code BODY with parameters PARAMS."
(ignore params)
(let* ((temporary-file-directory ".")
(tempfile (make-temp-file "hy-")))
(with-temp-file tempfile
(insert body))
(unwind-protect
(shell-command-to-string
(format "hy %s" tempfile))
(delete-file tempfile))))
;;; End