From 038cdffe0c4bf1686bfeb2ed11facd78dfc35870 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Fri, 18 May 2012 09:06:42 -0400 Subject: [PATCH] indent block boundaries when body is no-indent Thanks to Seb and Nick for pointing this out. * lisp/org-exp-blocks.el (org-export-blocks-preprocess): Even when the body of a block is not indented the boundary markers should be indented to their original positions so things like list indentation still work. --- lisp/org-exp-blocks.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/org-exp-blocks.el b/lisp/org-exp-blocks.el index 7d466cec6..fbac65920 100644 --- a/lisp/org-exp-blocks.el +++ b/lisp/org-exp-blocks.el @@ -211,7 +211,13 @@ which defaults to the value of `org-export-blocks-witheld'." (when replacement (delete-region match-start match-end) (goto-char match-start) (insert replacement) - (unless preserve-indent + (if preserve-indent + ;; indent only the code block markers + (save-excursion + (indent-line-to indentation) ; indent end_block + (goto-char match-start) + (indent-line-to indentation)) ; indent begin_block + ;; indent everything (indent-code-rigidly match-start (point) indentation))))) ;; cleanup markers (set-marker match-start nil) -- 2.11.4.GIT