aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorChong Yidong2010-05-22 12:48:01 -0400
committerChong Yidong2010-05-22 12:48:01 -0400
commit110683addccf829fa2b98fa279246f60a228d4fa (patch)
treecd79923115846b4f226a3d2d32f767bbf7feee9c /doc
parent4e3028f8f788c646a184f74f13c6e8ec0bc61b81 (diff)
downloademacs-110683addccf829fa2b98fa279246f60a228d4fa.tar.gz
emacs-110683addccf829fa2b98fa279246f60a228d4fa.zip
Rename image-refresh to image-flush.
* image.c (Fimage_flush): Rename from image-refresh. * image.el (image-refresh): Define as an alias for image-flush. * image-mode.el (image-toggle-display-image): Caller changed. * display.texi (Image Cache): Update documentation about image caching.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/display.texi53
1 files changed, 31 insertions, 22 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 68631dcdefc..622de2cd3cf 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -4730,29 +4730,35 @@ cache, it can always be displayed, even if the value of
4730efficiently. When Emacs displays an image, it searches the image 4730efficiently. When Emacs displays an image, it searches the image
4731cache for an existing image specification @code{equal} to the desired 4731cache for an existing image specification @code{equal} to the desired
4732specification. If a match is found, the image is displayed from the 4732specification. If a match is found, the image is displayed from the
4733cache; otherwise, Emacs loads the image normally. 4733cache. Otherwise, Emacs loads the image normally.
4734 4734
4735 Occasionally, you may need to tell Emacs to refresh the images 4735@defun image-flush spec &optional frame
4736associated with a given image specification. For example, suppose you 4736This function removes the image with specification @var{spec} from the
4737display an image using a specification that contains a @code{:file} 4737image cache of frame @var{frame}. Image specifications are compared
4738property. The image is automatically cached, and subsequent displays 4738using @code{equal}. If @var{frame} is @code{nil}, it defaults to the
4739of that image, with the same image specification, will use the image 4739selected frame. If @var{frame} is @code{t}, the image is flushed on
4740cache. If the image file changes in the meantime, Emacs would be 4740all existing frames.
4741displaying the old version of the image. In such a situation, you can 4741
4742``refresh'' the image by calling @code{image-refresh}. 4742In Emacs' current implementation, each graphical terminal possesses an
4743 4743image cache, which is shared by all the frames on that terminal
4744 In Emacs' current implementation, each graphical terminal possesses
4745an image cache, which is shared by all the frames on that terminal
4746(@pxref{Multiple Terminals}). Thus, refreshing an image in one frame 4744(@pxref{Multiple Terminals}). Thus, refreshing an image in one frame
4747also refreshes it in all other frames on the same terminal. 4745also refreshes it in all other frames on the same terminal.
4748
4749@defun image-refresh spec &optional frame
4750This function refreshes any images with image specifications
4751@code{equal} to @var{spec} on frame @var{frame}. If @var{frame} is
4752@code{nil}, it defaults to the selected frame. If @var{frame} is
4753@code{t}, the refresh is applied to all existing frames.
4754@end defun 4746@end defun
4755 4747
4748 One use for @code{image-flush} is to tell Emacs about a change in an
4749image file. If an image specification contains a @code{:file}
4750property, the image is cached based on the file's contents when the
4751image is first displayed. Even if the file subsequently changes,
4752Emacs continues displaying the old version of the image. Calling
4753@code{image-flush} flushes the image from the cache, forcing Emacs to
4754re-read the file the next time it needs to display that image.
4755
4756 Another use for @code{image-flush} is for memory conservation. If
4757your Lisp program creates a large number of temporary images over a
4758period much shorter than @code{image-cache-eviction-delay} (see
4759below), you can opt to flush unused images yourself, instead of
4760waiting for Emacs to do it automatically.
4761
4756@defun clear-image-cache &optional filter 4762@defun clear-image-cache &optional filter
4757This function clears an image cache, removing all the images stored in 4763This function clears an image cache, removing all the images stored in
4758it. If @var{filter} is omitted or @code{nil}, it clears the cache for 4764it. If @var{filter} is omitted or @code{nil}, it clears the cache for
@@ -4768,9 +4774,12 @@ period of time, Emacs removes it from the cache and frees the
4768associated memory. 4774associated memory.
4769 4775
4770@defvar image-cache-eviction-delay 4776@defvar image-cache-eviction-delay
4771This variable specifies the number of seconds an image can remain in the 4777This variable specifies the number of seconds an image can remain in
4772cache without being displayed. When an image is not displayed for this 4778the cache without being displayed. When an image is not displayed for
4773length of time, Emacs removes it from the image cache. 4779this length of time, Emacs removes it from the image cache.
4780
4781Under some circumstances, if the number of images in the cache grows
4782too large, the actual eviction delay may be shorter than this.
4774 4783
4775If the value is @code{nil}, Emacs does not remove images from the cache 4784If the value is @code{nil}, Emacs does not remove images from the cache
4776except when you explicitly clear it. This mode can be useful for 4785except when you explicitly clear it. This mode can be useful for