emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org a12d15df98 3/3: org-display-inline-remove-overlay:


From: ELPA Syncer
Subject: [elpa] externals/org a12d15df98 3/3: org-display-inline-remove-overlay: Do better job clearing images from cache
Date: Sun, 11 Dec 2022 04:57:53 -0500 (EST)

branch: externals/org
commit a12d15df982686ed41654f5487d58d77dfb56966
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    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.)
---
 lisp/org.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/org.el b/lisp/org.el
index 35adcc434b..ec56458df9 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16364,6 +16364,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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]