diff options
| author | Chong Yidong | 2010-05-22 12:48:01 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-05-22 12:48:01 -0400 |
| commit | 110683addccf829fa2b98fa279246f60a228d4fa (patch) | |
| tree | cd79923115846b4f226a3d2d32f767bbf7feee9c /doc | |
| parent | 4e3028f8f788c646a184f74f13c6e8ec0bc61b81 (diff) | |
| download | emacs-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.texi | 53 |
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 | |||
| 4730 | efficiently. When Emacs displays an image, it searches the image | 4730 | efficiently. When Emacs displays an image, it searches the image |
| 4731 | cache for an existing image specification @code{equal} to the desired | 4731 | cache for an existing image specification @code{equal} to the desired |
| 4732 | specification. If a match is found, the image is displayed from the | 4732 | specification. If a match is found, the image is displayed from the |
| 4733 | cache; otherwise, Emacs loads the image normally. | 4733 | cache. 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 |
| 4736 | associated with a given image specification. For example, suppose you | 4736 | This function removes the image with specification @var{spec} from the |
| 4737 | display an image using a specification that contains a @code{:file} | 4737 | image cache of frame @var{frame}. Image specifications are compared |
| 4738 | property. The image is automatically cached, and subsequent displays | 4738 | using @code{equal}. If @var{frame} is @code{nil}, it defaults to the |
| 4739 | of that image, with the same image specification, will use the image | 4739 | selected frame. If @var{frame} is @code{t}, the image is flushed on |
| 4740 | cache. If the image file changes in the meantime, Emacs would be | 4740 | all existing frames. |
| 4741 | displaying the old version of the image. In such a situation, you can | 4741 | |
| 4742 | ``refresh'' the image by calling @code{image-refresh}. | 4742 | In Emacs' current implementation, each graphical terminal possesses an |
| 4743 | 4743 | image cache, which is shared by all the frames on that terminal | |
| 4744 | In Emacs' current implementation, each graphical terminal possesses | ||
| 4745 | an 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 |
| 4747 | also refreshes it in all other frames on the same terminal. | 4745 | also refreshes it in all other frames on the same terminal. |
| 4748 | |||
| 4749 | @defun image-refresh spec &optional frame | ||
| 4750 | This 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 | ||
| 4749 | image file. If an image specification contains a @code{:file} | ||
| 4750 | property, the image is cached based on the file's contents when the | ||
| 4751 | image is first displayed. Even if the file subsequently changes, | ||
| 4752 | Emacs continues displaying the old version of the image. Calling | ||
| 4753 | @code{image-flush} flushes the image from the cache, forcing Emacs to | ||
| 4754 | re-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 | ||
| 4757 | your Lisp program creates a large number of temporary images over a | ||
| 4758 | period much shorter than @code{image-cache-eviction-delay} (see | ||
| 4759 | below), you can opt to flush unused images yourself, instead of | ||
| 4760 | waiting for Emacs to do it automatically. | ||
| 4761 | |||
| 4756 | @defun clear-image-cache &optional filter | 4762 | @defun clear-image-cache &optional filter |
| 4757 | This function clears an image cache, removing all the images stored in | 4763 | This function clears an image cache, removing all the images stored in |
| 4758 | it. If @var{filter} is omitted or @code{nil}, it clears the cache for | 4764 | it. 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 | |||
| 4768 | associated memory. | 4774 | associated memory. |
| 4769 | 4775 | ||
| 4770 | @defvar image-cache-eviction-delay | 4776 | @defvar image-cache-eviction-delay |
| 4771 | This variable specifies the number of seconds an image can remain in the | 4777 | This variable specifies the number of seconds an image can remain in |
| 4772 | cache without being displayed. When an image is not displayed for this | 4778 | the cache without being displayed. When an image is not displayed for |
| 4773 | length of time, Emacs removes it from the image cache. | 4779 | this length of time, Emacs removes it from the image cache. |
| 4780 | |||
| 4781 | Under some circumstances, if the number of images in the cache grows | ||
| 4782 | too large, the actual eviction delay may be shorter than this. | ||
| 4774 | 4783 | ||
| 4775 | If the value is @code{nil}, Emacs does not remove images from the cache | 4784 | If the value is @code{nil}, Emacs does not remove images from the cache |
| 4776 | except when you explicitly clear it. This mode can be useful for | 4785 | except when you explicitly clear it. This mode can be useful for |