summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorAndreas Politz <politza@hochschule-trier.de>2019-01-21 05:10:00 +0100
committerAndreas Politz <politza@hochschule-trier.de>2019-01-21 06:09:21 +0100
commit23bd9f15971b695ac3bba4a3d304154e122bdd34 (patch)
treed32f683689934e4fba615bff5d25d80ff593a5c8 /lisp
parent7a6c2382f347feeffe96d28c66503b243aafedbe (diff)
Remove duplicate images when cachingfix/cache-dups
Diffstat (limited to 'lisp')
-rw-r--r--lisp/pdf-cache.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/pdf-cache.el b/lisp/pdf-cache.el
index ea4182f..c946654 100644
--- a/lisp/pdf-cache.el
+++ b/lisp/pdf-cache.el
@@ -231,8 +231,9 @@ This function always returns nil."
(add-hook 'pdf-info-close-document-hook 'pdf-cache-clear-images nil t)
(add-hook 'pdf-annot-modified-functions
'pdf-cache--clear-images-of-annotations nil t))
- (push (pdf-cache--make-image page width data hash)
- pdf-cache--image-cache)
+ (let ((image (pdf-cache--make-image page width data hash)))
+ (setq pdf-cache--image-cache
+ (cons image (delete image pdf-cache--image-cache))))
;; Forget old image(s).
(when (> (length pdf-cache--image-cache)
pdf-cache-image-limit)