branch: externals/org
commit ebd06c15b5bb44070a5a9a7fbf17e1fef41c7521
Author: Clément Pit-Claudel <cpitclau...@gmail.com>
Commit: TEC <t...@tecosaur.com>

    org-src: Reset buffer-modified-p after fontifying
    
    * lisp/org-src.el (org-src-font-lock-fontify-block): Reset the
    modification flag of the temporary fontification buffer after
    fontifying.
    
    Without this some modes cause Emacs to prompt about unsaved buffers
    when exiting: "Save buffer *org-src-fontification:...-mode*?".
---
 lisp/org-src.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org-src.el b/lisp/org-src.el
index f1948bf..51dde60 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -642,7 +642,8 @@ as `org-src-fontify-natively' is non-nil."
                  (put-text-property
                   (+ start (1- pos)) (1- (+ start next)) prop new-prop
                   org-buffer)))
-             (setq pos next))))
+             (setq pos next)))
+          (set-buffer-modified-p nil))
        ;; Add Org faces.
        (let ((src-face (nth 1 (assoc-string lang org-src-block-faces t))))
           (when (or (facep src-face) (listp src-face))

Reply via email to