org-exp: check for protection before removing comments

* lisp/org-exp.el (org-export-handle-comments): check for protection
  before removing comments
This commit is contained in:
Eric Schulte 2010-06-27 19:35:34 -07:00
parent ee629299c0
commit 0e636dc2ed
1 changed files with 11 additions and 8 deletions

View File

@ -1644,14 +1644,17 @@ When it is nil, all comments will be removed."
(while (or (looking-at re)
(re-search-forward re nil t))
(setq pos (match-beginning 0))
(if (and commentsp
(not (equal (char-before (match-end 1)) ?+)))
(progn (add-text-properties
(match-beginning 0) (match-end 0) '(org-protected t))
(replace-match (format commentsp (match-string 2)) t t))
(goto-char (1+ pos))
(replace-match "")
(goto-char (max (point-min) (1- pos)))))))
(if (get-text-property (point) 'org-protected)
(goto-char (1+ pos))
(if (and commentsp
(not (equal (char-before (match-end 1)) ?+)))
(progn (add-text-properties
(match-beginning 0) (match-end 0) '(org-protected t))
(replace-match (format commentsp (match-string 2)) t t))
(goto-char (1+ pos))
(replace-match "")
(goto-char (max (point-min) (1- pos))))))))
(defun org-export-mark-radio-links ()
"Find all matches for radio targets and turn them into internal links."