[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Tue, 07 Feb 2006 12:52:45 +0200
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)
After generating different images in the same file and visiting them after
every change in Emacs, I noticed that the displayed image doesn't
get updated. Later I found the variable image-cache-eviction-delay and
changed its value to a small delay (1 sec), but it didn't have any effect
contrary to its documentation: the changed image was not updated in
the cache. It seems this behavior is caused by the constant value
#define CLEAR_IMAGE_CACHE_COUNT 101 that checks the value of
image-cache-eviction-delay only on 101-st redisplay. Surely, I can use
(add-hook 'post-command-hook 'clear-image-cache), but this is not
a general solution.
OTOH, I don't see why I should change the value of image-cache-eviction-delay,
if it is Emacs' job to update the cache when the image data changes.
So I found that updating the image cache after visiting an new image
was correct before the 2006-01-30 change in image-mode.el:
* image-mode.el (image-toggle-display): Use file name if possible,
instead of unnecessarily allocating a (possibly huge) lisp string.
But I don't blame this change. It is a good optimization, but it
revealed a problem in cache processing code. This code doesn't update
the cache for the file name when the file contents changes.
- Image cache,
Juri Linkov <=