Browse Source

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*?".
Clément Pit-Claudel 3 years ago
parent
commit
ebd06c15b5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lisp/org-src.el

+ 2 - 1
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))