mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 23:32:52 +00:00
org-display-inline-remove-overlay: Do better job clearing images from cache
* lisp/org.el (org-display-inline-remove-overlay): Force remove overlay images from Emacs image cache when un-displaying inline image overlays. This change should: (1) slightly improve Emacs memory usage when the number of inline images is large; (2) Clear images from cache every time Emacs removes the overlay for any reason. (`org-display-inline-remove-overlay' is used in overlay 'modification-hooks.)
This commit is contained in:
parent
954a95ec5f
commit
41a8666c09
|
@ -16399,6 +16399,10 @@ buffer boundaries with possible narrowing."
|
|||
"Remove inline-display overlay if a corresponding region is modified."
|
||||
(when (and ov after)
|
||||
(delete ov org-inline-image-overlays)
|
||||
;; Clear image from cache to avoid image not updating upon
|
||||
;; changing on disk. See Emacs bug#59902.
|
||||
(when (overlay-get ov 'org-image-overlay)
|
||||
(image-flush (overlay-get ov 'display)))
|
||||
(delete-overlay ov)))
|
||||
|
||||
(defun org-remove-inline-images (&optional beg end)
|
||||
|
|
Loading…
Reference in a new issue