diff --git a/markdown-mode.el b/markdown-mode.el index 7584cad4..53f92edd 100644 --- a/markdown-mode.el +++ b/markdown-mode.el @@ -6274,8 +6274,12 @@ See `markdown-wiki-link-p' and `markdown-follow-wiki-link'." (defun markdown-unfontify-region-wiki-links (from to) "Remove wiki link faces from the region specified by FROM and TO." (interactive "*r") - (remove-text-properties from to '(font-lock-face markdown-link-face)) - (remove-text-properties from to '(font-lock-face markdown-missing-link-face))) + (let ((modified (buffer-modified-p))) + (remove-text-properties from to '(font-lock-face markdown-link-face)) + (remove-text-properties from to '(font-lock-face markdown-missing-link-face)) + ;; remove-text-properties marks the buffer modified in emacs 24.3, + ;; undo that if it wasn't originally marked modified + (set-buffer-modified-p modified))) (defun markdown-fontify-region-wiki-links (from to) "Search region given by FROM and TO for wiki links and fontify them.