diff options
author | Bastien Guerry <bzg@altern.org> | 2012-02-01 00:10:06 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-02-01 00:10:06 +0100 |
commit | 04ecf18db0de904dd966318c9bfe89c94b058054 (patch) | |
tree | 146942fe590e6c733bafa4e57a0365438a43c152 | |
parent | 1ec188b00a25ab9c3316b36c6b0da148a4f989ab (diff) | |
parent | 182970cf8e680943483fcece79d17070b783bb72 (diff) | |
download | org-mode-04ecf18db0de904dd966318c9bfe89c94b058054.tar.gz |
Merge branch 'maint' of orgmode.org:org-mode into maint
-rw-r--r-- | lisp/org-exp.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 8a7ca62..2373613 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1730,10 +1730,11 @@ from the buffer." ":[ \t]*\\(.*\\)") nil t) (if (not (eq backend org-export-current-backend)) (delete-region (point-at-bol) (min (1+ (point-at-eol)) (point-max))) - (replace-match "\\1\\2" t) - (add-text-properties - (point-at-bol) (min (1+ (point-at-eol)) (point-max)) - `(org-protected t original-indentation ,ind org-native-text t)))) + (let ((ind (get-text-property (point-at-bol) 'original-indentation))) + (replace-match "\\1\\2" t) + (add-text-properties + (point-at-bol) (min (1+ (point-at-eol)) (point-max)) + `(org-protected t original-indentation ,ind org-native-text t))))) ;; Delete #+ATTR_BACKEND: stuff of another backend. Those ;; matching the current backend will be taken care of by ;; `org-export-attach-captions-and-attributes' @@ -1748,7 +1749,8 @@ from the buffer." (while (re-search-forward (concat "^[ \t]*#\\+BEGIN_" backend-name "\\>.*\n?") nil t) (setq beg (match-beginning 0) beg-content (match-end 0)) - (setq ind (save-excursion (goto-char beg) (org-get-indentation))) + (setq ind (or (get-text-property beg 'original-indentation) + (save-excursion (goto-char beg) (org-get-indentation)))) (when (re-search-forward (concat "^[ \t]*#\\+END_" backend-name "\\>.*\n?") nil t) (setq end (match-end 0) end-content (match-beginning 0)) |