emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r100413: Rename image-refresh to imag


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100413: Rename image-refresh to image-flush.
Date: Sat, 22 May 2010 12:48:01 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100413
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2010-05-22 12:48:01 -0400
message:
  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.
modified:
  doc/lispref/display.texi
  lisp/ChangeLog
  lisp/image-mode.el
  lisp/image.el
  src/ChangeLog
  src/image.c
=== modified file 'doc/lispref/display.texi'
--- a/doc/lispref/display.texi  2010-02-27 15:18:07 +0000
+++ b/doc/lispref/display.texi  2010-05-22 16:48:01 +0000
@@ -4730,29 +4730,35 @@
 efficiently.  When Emacs displays an image, it searches the image
 cache for an existing image specification @code{equal} to the desired
 specification.  If a match is found, the image is displayed from the
-cache; otherwise, Emacs loads the image normally.
-
-  Occasionally, you may need to tell Emacs to refresh the images
-associated with a given image specification.  For example, suppose you
-display an image using a specification that contains a @code{:file}
-property.  The image is automatically cached, and subsequent displays
-of that image, with the same image specification, will use the image
-cache.  If the image file changes in the meantime, Emacs would be
-displaying the old version of the image.  In such a situation, you can
-``refresh'' the image by calling @code{image-refresh}.
-
-  In Emacs' current implementation, each graphical terminal possesses
-an image cache, which is shared by all the frames on that terminal
+cache.  Otherwise, Emacs loads the image normally.
+
address@hidden image-flush spec &optional frame
+This function removes the image with specification @var{spec} from the
+image cache of frame @var{frame}.  Image specifications are compared
+using @code{equal}.  If @var{frame} is @code{nil}, it defaults to the
+selected frame.  If @var{frame} is @code{t}, the image is flushed on
+all existing frames.
+
+In Emacs' current implementation, each graphical terminal possesses an
+image cache, which is shared by all the frames on that terminal
 (@pxref{Multiple Terminals}).  Thus, refreshing an image in one frame
 also refreshes it in all other frames on the same terminal.
-
address@hidden image-refresh spec &optional frame
-This function refreshes any images with image specifications
address@hidden to @var{spec} on frame @var{frame}.  If @var{frame} is
address@hidden, it defaults to the selected frame.  If @var{frame} is
address@hidden, the refresh is applied to all existing frames.
 @end defun
 
+  One use for @code{image-flush} is to tell Emacs about a change in an
+image file.  If an image specification contains a @code{:file}
+property, the image is cached based on the file's contents when the
+image is first displayed.  Even if the file subsequently changes,
+Emacs continues displaying the old version of the image.  Calling
address@hidden flushes the image from the cache, forcing Emacs to
+re-read the file the next time it needs to display that image.
+
+  Another use for @code{image-flush} is for memory conservation.  If
+your Lisp program creates a large number of temporary images over a
+period much shorter than @code{image-cache-eviction-delay} (see
+below), you can opt to flush unused images yourself, instead of
+waiting for Emacs to do it automatically.
+
 @defun clear-image-cache &optional filter
 This function clears an image cache, removing all the images stored in
 it.  If @var{filter} is omitted or @code{nil}, it clears the cache for
@@ -4768,9 +4774,12 @@
 associated memory.
 
 @defvar image-cache-eviction-delay
-This variable specifies the number of seconds an image can remain in the
-cache without being displayed.  When an image is not displayed for this
-length of time, Emacs removes it from the image cache.
+This variable specifies the number of seconds an image can remain in
+the cache without being displayed.  When an image is not displayed for
+this length of time, Emacs removes it from the image cache.
+
+Under some circumstances, if the number of images in the cache grows
+too large, the actual eviction delay may be shorter than this.
 
 If the value is @code{nil}, Emacs does not remove images from the cache
 except when you explicitly clear it.  This mode can be useful for

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-05-21 20:43:04 +0000
+++ b/lisp/ChangeLog    2010-05-22 16:48:01 +0000
@@ -1,3 +1,9 @@
+2010-05-22  Chong Yidong  <address@hidden>
+
+       * image.el (image-refresh): Define as an alias for image-flush.
+
+       * image-mode.el (image-toggle-display-image): Caller changed.
+
 2010-05-21  Juri Linkov  <address@hidden>
 
        * progmodes/grep.el (grep-read-files): Fix multi-pattern aliases.

=== modified file 'lisp/image-mode.el'
--- a/lisp/image-mode.el        2010-05-08 18:47:07 +0000
+++ b/lisp/image-mode.el        2010-05-22 16:48:01 +0000
@@ -448,7 +448,7 @@
 
 (defvar archive-superior-buffer)
 (defvar tar-superior-buffer)
-(declare-function image-refresh "image.c" (spec &optional frame))
+(declare-function image-flush "image.c" (spec &optional frame))
 
 (defun image-toggle-display-image ()
   "Show the image of the image file.
@@ -477,7 +477,7 @@
         (inhibit-read-only t)
         (buffer-undo-list t)
         (modified (buffer-modified-p)))
-    (image-refresh image)
+    (image-flush image)
     (let ((buffer-file-truename nil)) ; avoid changing dir mtime by lock_file
       (add-text-properties (point-min) (point-max) props)
       (restore-buffer-modified-p modified))

=== modified file 'lisp/image.el'
--- a/lisp/image.el     2010-03-31 14:55:01 +0000
+++ b/lisp/image.el     2010-05-22 16:48:01 +0000
@@ -30,6 +30,7 @@
   "Image support."
   :group 'multimedia)
 
+(defalias 'image-refresh 'image-flush)
 
 (defconst image-type-header-regexps
   `(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm)

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-05-21 17:29:27 +0000
+++ b/src/ChangeLog     2010-05-22 16:48:01 +0000
@@ -1,3 +1,7 @@
+2010-05-22  Chong Yidong  <address@hidden>
+
+       * image.c (Fimage_flush): Rename from image-refresh.
+
 2010-05-21  Chong Yidong  <address@hidden>
 
        * xdisp.c (redisplay_internal): Clear caches even if redisplaying

=== modified file 'src/image.c'
--- a/src/image.c       2010-05-21 17:29:27 +0000
+++ b/src/image.c       2010-05-22 16:48:01 +0000
@@ -1689,11 +1689,13 @@
 }
 
 
-DEFUN ("image-refresh", Fimage_refresh, Simage_refresh,
+DEFUN ("image-flush", Fimage_flush, Simage_flush,
        1, 2, 0,
-       doc: /* Refresh the image with specification SPEC on frame FRAME.
-If SPEC specifies an image file, the displayed image is updated with
-the current contents of that file.
+       doc: /* Fush the image with specification SPEC on frame FRAME.
+This removes the image from the Emacs image cache.  If SPEC specifies
+an image file, the next redisplay of this image will read from the
+current contents of that file.
+
 FRAME nil or omitted means use the selected frame.
 FRAME t means refresh the image on all frames.  */)
      (spec, frame)
@@ -8526,7 +8528,7 @@
 
   defsubr (&Sinit_image_library);
   defsubr (&Sclear_image_cache);
-  defsubr (&Simage_refresh);
+  defsubr (&Simage_flush);
   defsubr (&Simage_size);
   defsubr (&Simage_mask_p);
   defsubr (&Simage_metadata);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]