浏览代码

Merge branch 'origin-maint'

Eric Schulte 13 年之前
父节点
当前提交
fc5d53d910
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      lisp/org-exp-blocks.el

+ 7 - 1
lisp/org-exp-blocks.el

@@ -217,7 +217,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)