浏览代码

Examples: Untabify before re-inserting into Org

Leaving tabs in the code will mess up indentation in Org.
Carsten Dominik 16 年之前
父节点
当前提交
aa6654c9ce
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 3 0
      lisp/ChangeLog
  2. 1 0
      lisp/org-src.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-07-06  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-src.el (org-edit-src-exit): Untabify the example before
+	returning to Org.
+
 	* org-list.el (org-list-demote-modify-bullet): New option.
 	(org-first-list-item-p): Save point.
 	(org-fix-bullet-type): New optional argument FORCE-BULLET.

+ 1 - 0
lisp/org-src.el

@@ -408,6 +408,7 @@ the language, a switch telling of the content should be in a single line."
 	(buffer (current-buffer))
 	(nindent org-edit-src-nindent)
 	code line)
+    (untabify (point-min) (point-max))
     (save-excursion
       (goto-char (point-min))
       (if (looking-at "[ \t\n]*\n") (replace-match ""))