summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2011-09-06 21:52:04 -0600
committerEric Schulte <schulte.eric@gmail.com>2011-09-06 21:52:17 -0600
commitd0a3a3870f1d8e51d621890728c55ad9862371cb (patch)
tree9c72b821538049460a36cb11ec4ffa8e846c982b
parent0dd10f5d9743a02aa504155a6f8be14b9c587d44 (diff)
downloadorg-mode-d0a3a3870f1d8e51d621890728c55ad9862371cb.tar.gz
org-exp: only remove commas on the front line of a code block
* lisp/org-exp.el (org-export-select-backend-specific-text): Only remove commas on the front line of a code block.
-rw-r--r--lisp/org-exp.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index f795fbd..42b26e4 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -1738,8 +1738,14 @@ from the buffer."
(save-excursion
(save-match-data
(goto-char beg-content)
- (while (re-search-forward "^[ \t]*\\(,\\)" end-content t)
- (replace-match "" nil nil nil 1))))
+ (let ((front-line (save-excursion
+ (re-search-forward
+ "[^[:space:]]" end-content t)
+ (goto-char (match-beginning 0))
+ (current-column))))
+ (while (re-search-forward "^[ \t]*\\(,\\)" end-content t)
+ (when (= (current-column) front-line)
+ (replace-match "" nil nil nil 1))))))
(delete-region (match-beginning 0) (match-end 0))
(save-excursion
(goto-char beg)