diff --git a/lisp/org.el b/lisp/org.el index 62131be..5a00236 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15565,8 +15565,17 @@ BEG and END default to the buffer boundaries." (overlay-put ov 'display img) (overlay-put ov 'face 'default) (overlay-put ov 'org-image-overlay t) + (overlay-put ov 'modification-hooks + (list 'org-display-inline-modification-hook)) (push ov org-inline-image-overlays))))))))) +(defun org-display-inline-modification-hook (ov after beg end &optional len) + "Remove inline-display overlay if a corresponding region is modified." + (let ((inhibit-modification-hooks t)) + (when (and ov after) + (delete ov org-inline-image-overlays) + (delete-overlay ov)))) + (defun org-remove-inline-images () "Remove inline display of images." (interactive)