Browse Source

Fix bug with line protection while including source code files

There was an issue that lines starting with a space followed by #
would be protected when importing the file, but not unprotected when
formatting the example.  The reason for this issue is that we recently
changed to protect indented #+ lines.
Carsten Dominik 15 years ago
parent
commit
fa2a21c313
2 changed files with 4 additions and 1 deletions
  1. 3 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-exp.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-09-02  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-exp.el (org-get-file-contents): Only protect lines that
+	really need it.
+
 	* org-html.el (require): require cl for compilation.
 
 	* org.el:  Avoid using `default-major-mode'.

+ 1 - 1
lisp/org-exp.el

@@ -2170,7 +2170,7 @@ take care of the block they are in."
     (buffer-string)
     (when (member markup '("src" "example"))
       (goto-char (point-min))
-      (while (re-search-forward "^\\(\\*\\|[ \t]*#\\)" nil t)
+      (while (re-search-forward "^\\([*#]\\|[ \t]*#\\+\\)" nil t)
 	(goto-char (match-beginning 0))
 	(insert ",")
 	(end-of-line 1)))