diff options
| author | Chong Yidong | 2007-06-14 02:22:13 +0000 |
|---|---|---|
| committer | Chong Yidong | 2007-06-14 02:22:13 +0000 |
| commit | bce28eaecd0e1ad1c9018e4d8164b798082680dd (patch) | |
| tree | 412a74fbdb6af794cb2ab48b145e392bcacaf950 | |
| parent | 650ad62469df4642b67c7dfc2a355019b63fa883 (diff) | |
| download | emacs-bce28eaecd0e1ad1c9018e4d8164b798082680dd.tar.gz emacs-bce28eaecd0e1ad1c9018e4d8164b798082680dd.zip | |
(Image Cache): Document image-refresh.
| -rw-r--r-- | lispref/display.texi | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/lispref/display.texi b/lispref/display.texi index f644a02c2eb..81da9f8d6e9 100644 --- a/lispref/display.texi +++ b/lispref/display.texi | |||
| @@ -4276,13 +4276,43 @@ cache, it can always be displayed, even if the value of | |||
| 4276 | @subsection Image Cache | 4276 | @subsection Image Cache |
| 4277 | @cindex image cache | 4277 | @cindex image cache |
| 4278 | 4278 | ||
| 4279 | Emacs stores images in an image cache when it displays them, so it can | 4279 | Emacs stores images in an image cache so that it can display them |
| 4280 | display them again more efficiently. It removes an image from the cache | 4280 | again more efficiently. When Emacs displays an image, it searches the |
| 4281 | when it hasn't been displayed for a specified period of time. | 4281 | image cache for an existing image specification @code{equal} to the |
| 4282 | desired specification. If a match is found, the image is displayed | ||
| 4283 | from the cache; otherwise, Emacs loads the image normally. | ||
| 4284 | |||
| 4285 | Occasionally, you may need to tell Emacs to refresh the images | ||
| 4286 | associated with a given image specification. For example, suppose you | ||
| 4287 | display an image using a specification that contains a @code{:file} | ||
| 4288 | property. The image is loaded from the given file and stored in the | ||
| 4289 | image cache. If you later display the image again, using the same | ||
| 4290 | image specification, the image is displayed from the image cache. | ||
| 4291 | Normally, this is not a problem. However, if the image file has | ||
| 4292 | changed in the meantime, Emacs would be displaying the old version of | ||
| 4293 | the image. In such a situation, it is necessary to ``refresh'' the | ||
| 4294 | image using @code{image-refresh}. | ||
| 4295 | |||
| 4296 | @defun image-refresh spec &optional frame | ||
| 4297 | This function refreshes any images having image specifications | ||
| 4298 | @code{equal} to @var{spec} on frame @var{frame}. If @var{frame} is | ||
| 4299 | @code{nil}, the selected frame is used. If @var{frame} is @code{t}, | ||
| 4300 | the refresh is applied to all existing frames. | ||
| 4301 | |||
| 4302 | This works by removing all image with image specifications matching | ||
| 4303 | @var{spec} from the image cache. Thus, the next time the image is | ||
| 4304 | displayed, Emacs will load the image again. | ||
| 4305 | @end defun | ||
| 4306 | |||
| 4307 | @defun clear-image-cache &optional frame | ||
| 4308 | This function clears the entire image cache. If @var{frame} is | ||
| 4309 | non-@code{nil}, only the cache for that frame is cleared. Otherwise, | ||
| 4310 | all frames' caches are cleared. | ||
| 4311 | @end defun | ||
| 4282 | 4312 | ||
| 4283 | When an image is looked up in the cache, its specification is compared | 4313 | If an image in the image cache has not been displayed for a specified |
| 4284 | with cached image specifications using @code{equal}. This means that | 4314 | period of time, Emacs removes it from the cache and frees the |
| 4285 | all images with equal specifications share the same image in the cache. | 4315 | associated memory. |
| 4286 | 4316 | ||
| 4287 | @defvar image-cache-eviction-delay | 4317 | @defvar image-cache-eviction-delay |
| 4288 | This variable specifies the number of seconds an image can remain in the | 4318 | This variable specifies the number of seconds an image can remain in the |
| @@ -4294,12 +4324,6 @@ except when you explicitly clear it. This mode can be useful for | |||
| 4294 | debugging. | 4324 | debugging. |
| 4295 | @end defvar | 4325 | @end defvar |
| 4296 | 4326 | ||
| 4297 | @defun clear-image-cache &optional frame | ||
| 4298 | This function clears the image cache. If @var{frame} is non-@code{nil}, | ||
| 4299 | only the cache for that frame is cleared. Otherwise all frames' caches | ||
| 4300 | are cleared. | ||
| 4301 | @end defun | ||
| 4302 | |||
| 4303 | @node Buttons | 4327 | @node Buttons |
| 4304 | @section Buttons | 4328 | @section Buttons |
| 4305 | @cindex buttons in buffers | 4329 | @cindex buttons in buffers |