|
|
|
@ -1225,13 +1225,72 @@ |
|
|
|
(add-to-list 'org-structure-template-alist |
|
|
|
(add-to-list 'org-structure-template-alist |
|
|
|
structure-template)) |
|
|
|
structure-template)) |
|
|
|
'(("el" . "src emacs-lisp") |
|
|
|
'(("el" . "src emacs-lisp") |
|
|
|
("sh" . "src sh"))) |
|
|
|
("sh" . "src sh") |
|
|
|
|
|
|
|
("ss" . "src scheme") |
|
|
|
|
|
|
|
("py" . "src python"))) |
|
|
|
(require 'org-tempo) |
|
|
|
(require 'org-tempo) |
|
|
|
#+end_src |
|
|
|
#+end_src |
|
|
|
Fontify src blocks |
|
|
|
Fontify src blocks |
|
|
|
#+begin_src emacs-lisp |
|
|
|
#+begin_src emacs-lisp |
|
|
|
(setq org-src-fontify-natively t) |
|
|
|
(setq org-src-fontify-natively t) |
|
|
|
#+end_src |
|
|
|
#+end_src |
|
|
|
|
|
|
|
This makes scheme src blocks work |
|
|
|
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
|
|
|
|
(org-babel-do-load-languages |
|
|
|
|
|
|
|
'org-babel-load-languages |
|
|
|
|
|
|
|
'((python . t) |
|
|
|
|
|
|
|
(scheme . t) |
|
|
|
|
|
|
|
(emacs-lisp . t))) |
|
|
|
|
|
|
|
#+end_src |
|
|
|
|
|
|
|
Patch ~ob-scheme.el~ while waiting for upstream |
|
|
|
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
|
|
|
|
(defun org-babel-scheme-execute-with-geiser (code output impl repl) |
|
|
|
|
|
|
|
"Execute code in specified REPL. |
|
|
|
|
|
|
|
If the REPL doesn't exist, create it using the given scheme |
|
|
|
|
|
|
|
implementation. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns the output of executing the code if the OUTPUT parameter |
|
|
|
|
|
|
|
is true; otherwise returns the last value." |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(let ((result nil)) |
|
|
|
|
|
|
|
(with-temp-buffer |
|
|
|
|
|
|
|
(insert (format ";; -*- geiser-scheme-implementation: %s -*-" impl)) |
|
|
|
|
|
|
|
(newline) |
|
|
|
|
|
|
|
(insert code) |
|
|
|
|
|
|
|
(geiser-mode) |
|
|
|
|
|
|
|
(let ((geiser-repl-window-allow-split nil) |
|
|
|
|
|
|
|
(geiser-repl-use-other-window nil)) |
|
|
|
|
|
|
|
(let ((repl-buffer (save-current-buffer |
|
|
|
|
|
|
|
(org-babel-scheme-get-repl impl repl)))) |
|
|
|
|
|
|
|
(when (not (eq impl (org-babel-scheme-get-buffer-impl |
|
|
|
|
|
|
|
(current-buffer)))) |
|
|
|
|
|
|
|
(message "Implementation mismatch: %s (%s) %s (%s)" impl (symbolp impl) |
|
|
|
|
|
|
|
(org-babel-scheme-get-buffer-impl (current-buffer)) |
|
|
|
|
|
|
|
(symbolp (org-babel-scheme-get-buffer-impl |
|
|
|
|
|
|
|
(current-buffer))))) |
|
|
|
|
|
|
|
(setq geiser-repl--repl repl-buffer) |
|
|
|
|
|
|
|
(setq geiser-impl--implementation nil) |
|
|
|
|
|
|
|
(let ((geiser-debug-jump-to-debug-p nil) |
|
|
|
|
|
|
|
(geiser-debug-show-debug-p nil)) |
|
|
|
|
|
|
|
(let ((ret (funcall |
|
|
|
|
|
|
|
;; use `geiser-eval-region/wait' only when available |
|
|
|
|
|
|
|
;; in newer versions of `geiser' |
|
|
|
|
|
|
|
(if (fboundp 'geiser-eval-region/wait) |
|
|
|
|
|
|
|
'geiser-eval-region/wait |
|
|
|
|
|
|
|
'geiser-eval-region) |
|
|
|
|
|
|
|
(point-min) |
|
|
|
|
|
|
|
(point-max)))) |
|
|
|
|
|
|
|
(setq result (if output |
|
|
|
|
|
|
|
(or (geiser-eval--retort-output ret) |
|
|
|
|
|
|
|
"Geiser Interpreter produced no output") |
|
|
|
|
|
|
|
(geiser-eval--retort-result-str ret ""))))) |
|
|
|
|
|
|
|
(when (not repl) |
|
|
|
|
|
|
|
(save-current-buffer (set-buffer repl-buffer) |
|
|
|
|
|
|
|
(geiser-repl-exit)) |
|
|
|
|
|
|
|
(set-process-query-on-exit-flag (get-buffer-process repl-buffer) nil) |
|
|
|
|
|
|
|
(kill-buffer repl-buffer))))) |
|
|
|
|
|
|
|
result)) |
|
|
|
|
|
|
|
#+end_src |
|
|
|
*** Lowercase org blocks |
|
|
|
*** Lowercase org blocks |
|
|
|
There is a new trend to use lowercase in the org block |
|
|
|
There is a new trend to use lowercase in the org block |
|
|
|
definitions; this gist (taken from the [[https://scripter.co/org-keywords-lower-case/][Scripter blog]]) lowercases |
|
|
|
definitions; this gist (taken from the [[https://scripter.co/org-keywords-lower-case/][Scripter blog]]) lowercases |
|
|
|
@ -1412,7 +1471,7 @@ |
|
|
|
(autoload 'enable-paredit-mode "paredit" "Turn on |
|
|
|
(autoload 'enable-paredit-mode "paredit" "Turn on |
|
|
|
pseudo-structural editing of Lisp code." t) |
|
|
|
pseudo-structural editing of Lisp code." t) |
|
|
|
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) |
|
|
|
(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) |
|
|
|
|
|
|
|
(add-hook 'scheme-mode-hook #'enable-paredit-mode) |
|
|
|
(require 'highlight-parentheses) |
|
|
|
(require 'highlight-parentheses) |
|
|
|
|
|
|
|
|
|
|
|
(defun hydra-paren/hl-paren-force-fix () |
|
|
|
(defun hydra-paren/hl-paren-force-fix () |
|
|
|
|