diff options
author | Lawrence Mitchell <wence@gmx.li> | 2011-03-28 20:20:47 +0000 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2011-04-06 10:42:57 +0200 |
commit | 56cb9cff34ac352221316f597e97a12a314b4d8b (patch) | |
tree | 65262bd0668b8f4615e9c0addb019beced807caa | |
parent | 5259210cfb2d9910d67bc4d63f0d531b0dbb3bf6 (diff) | |
download | org-mode-56cb9cff34ac352221316f597e97a12a314b4d8b.tar.gz |
Ensure org-export-handle-comments protects its insertions
* lisp/org-exp.el (org-export-handle-comments): Add the org-protected
property to the replacement string.
Although org-export-handle-comments adds the org-protected property to
the matched string, the subsequent `replace-match' call to change the
comment character does not add this property to the entire format
string. Fix this by propertizing the entirety of the newtext argument
to replace-match.
-rw-r--r-- | lisp/org-exp.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 9149535..eb2621b 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1904,7 +1904,10 @@ When it is nil, all comments will be removed." (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)) + (replace-match (org-add-props + (format commentsp (match-string 2)) + nil 'org-protected t) + t t)) (goto-char (1+ pos)) (replace-match "") (goto-char (max (point-min) (1- pos)))))))) |