Ver código fonte

org-babel: Haskell lhs export: ensure all \[begin|end]{code} statements start at the first column

Eric Schulte 15 anos atrás
pai
commit
c0d54a9a6b
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      contrib/babel/lisp/langs/org-babel-haskell.el

+ 4 - 0
contrib/babel/lisp/langs/org-babel-haskell.el

@@ -174,6 +174,10 @@ constructs (header arguments, no-web syntax etc...) are ignored."
       (find-file tmp-tex-file)
       (goto-char (point-min)) (forward-line 2)
       (insert "%include polycode.fmt\n")
+      ;; ensure all \begin/end{code} statements start at the first column
+      (while (re-search-forward "^[ \t]+\\\\begin{code}[^\000]+\\\\end{code}" nil t)
+        (replace-match (save-match-data (org-remove-indentation (match-string 0)))
+                       t t))
       (setq contents (buffer-string))
       (save-buffer) (kill-buffer))
     (delete-file tmp-tex-file)