]> git.eshelyaron.com Git - emacs.git/commitdiff
(thumbs-thumbname): The resulting thubname includes a hash value to improve its
authorJuanma Barranquero <lekktu@gmail.com>
Mon, 30 May 2005 09:45:11 +0000 (09:45 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Mon, 30 May 2005 09:45:11 +0000 (09:45 +0000)
uniqueness, and has a ".jpg" extension. Also, it is now a valid filename on all
systems.
(thumbs-make-thumb): Use `let', not `let*'.
(thumbs-show-thumbs-list): Check for JPEG availability.

lisp/ChangeLog
lisp/thumbs.el

index f7104c21885b4b8b2a06869766cff3088192dee0..fee028e52ebef0b8bace6337ceb0fe19c5f14ab3 100644 (file)
@@ -1,3 +1,11 @@
+2005-05-30  Juanma Barranquero  <lekktu@gmail.com>
+
+       * thumbs.el (thumbs-thumbname): The resulting thubname now
+       includes a hash value to improve its uniqueness, and has a ".jpg"
+       extension.  Also, it is now a valid filename on all systems.
+       (thumbs-make-thumb): Use `let', not `let*'.
+       (thumbs-show-thumbs-list): Check for JPEG availability.
+
 2005-05-30  Richard M. Stallman  <rms@gnu.org>
 
        * filesets.el (filesets-menu-ensure-use-cached):
@@ -14,7 +22,7 @@
 
        * progmodes/gdb-ui.el (gdb-toggle-breakpoint):
        Make regexp more robust.
-       (gdb-display-assembler-buffer, gdb-frame-assembler-buffer): 
+       (gdb-display-assembler-buffer, gdb-frame-assembler-buffer):
        Force regeneration of disassembly.
 
 2005-05-29  Jay Belanger  <belanger@truman.edu>
@@ -79,7 +87,7 @@
 2005-05-29   Manuel Serrano  <Manuel.Serrano@sophia.inria.fr>
 
        * flyspell.el (flyspell-emacs, flyspell-use-local-map): Vars moved up.
-       (flyspell-default-delayed-commands): add backward-delete-char-untabify.
+       (flyspell-default-delayed-commands): Add backward-delete-char-untabify.
        (flyspell-abbrev-p): Default to nil.
        (flyspell-use-global-abbrev-table-p): Doc fix.
        (flyspell-large-region): Allow nil as value.
 
 2005-05-28  Karl Berry  <karl@gnu.org>
 
-       * textmodes/tex-mode.el: now that tex-send-command calls
+       * textmodes/tex-mode.el: Now that tex-send-command calls
        shell-quote-argument (2005-03-31 change), remove all calls to
        shell-quote-argument; they all end up invoking tex-send-command.
        The double quoting loses on filenames with non-safe characters,
        Toggle display of floating point registers.
        (gdb-registers-mode-map): Bind SPC to toggle-gdb-all-registers.
 
-       * progmodes/gud.el (gud-goto-info): Use info. Don't use require.
+       * progmodes/gud.el (gud-goto-info): Use info.  Don't use require.
        (toggle-gud-tooltip-dereference):
        Rename from gud-toggle-tooltip-dereference.
 
index 1657c4b01a96c947adbbdc8078b2045d492d84fe..03491873c9daf51214e6b6f4e8ec9eed77555e94 100644 (file)
@@ -302,18 +302,21 @@ Or, alternatively, a SIZE may be specified."
 
 (defun thumbs-thumbname (img)
   "Return a thumbnail name for the image IMG."
-  (concat thumbs-thumbsdir "/"
-         (subst-char-in-string
-          ?\  ?\_
-          (apply
-           'concat
-           (split-string
-            (expand-file-name img) "/")))))
+  (convert-standard-filename
+   (let ((filename (expand-file-name img)))
+     (format "%s/%08x-%s.jpg"
+             thumbs-thumbsdir
+             (sxhash filename)
+             (subst-char-in-string
+              ?\s ?\_
+              (apply
+               'concat
+               (split-string filename "/")))))))
 
 (defun thumbs-make-thumb (img)
   "Create the thumbnail for IMG."
-  (let* ((fn (expand-file-name img))
-        (tn (thumbs-thumbname img)))
+  (let ((fn (expand-file-name img))
+        (tn (thumbs-thumbname img)))
     (if (or (not (file-exists-p tn))
            ;;  This is not the right fix, but I don't understand
            ;;  the external program or why it produces a geometry
@@ -378,8 +381,9 @@ If MARKED is non-nil, the image is marked."
     (unless (bobp) (newline))))
 
 (defun thumbs-show-thumbs-list (L &optional buffer-name same-window)
-  (when (not (display-images-p))
-    (error "Images are not supported in this Emacs session"))
+  (unless (and (display-images-p)
+               (image-type-available-p 'jpeg))
+    (error "Required image type is not supported in this Emacs session"))
   (funcall (if same-window 'switch-to-buffer 'pop-to-buffer)
           (or buffer-name "*THUMB-View*"))
   (let ((inhibit-read-only t))