;;; thumbs.el --- Thumbnails previewer for images files
-;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2013 Free Software Foundation, Inc.
;; Author: Jean-Philippe Theberge <jphiltheberge@videotron.ca>
;; Maintainer: FSF
;; This package create two new modes: thumbs-mode and thumbs-view-image-mode.
;; It is used for basic browsing and viewing of images from within Emacs.
;; Minimal image manipulation functions are also available via external
-;; programs. If you want to do more complex tasks like categorise and tag
+;; programs. If you want to do more complex tasks like categorize and tag
;; your images, use image-dired.el
;;
;; The 'convert' program from 'ImageMagick'
;;; Code:
(require 'dired)
+(require 'cl-lib) ; for cl-gensym
;; CUSTOMIZATIONS
:group 'thumbs)
;; Unfortunately Windows XP has a program called CONVERT.EXE in
-;; C:/WINDOWS/SYSTEM32/ for partioning NTFS system. So Emacs
+;; C:/WINDOWS/SYSTEM32/ for partitioning NTFS systems. So Emacs
;; can find the one in your ImageMagick directory, you need to
;; customize this value to the absolute filename.
(defcustom thumbs-conversion-program
(make-variable-buffer-local 'thumbs-marked-list)
(put 'thumbs-marked-list 'permanent-local t)
-(defalias 'thumbs-gensym
- (if (fboundp 'gensym)
- 'gensym
- ;; Copied from cl-macs.el
- (defvar thumbs-gensym-counter 0)
- (lambda (&optional prefix)
- "Generate a new uninterned symbol.
-The name is made by appending a number to PREFIX, default \"G\"."
- (let ((pfix (if (stringp prefix) prefix "G"))
- (num (if (integerp prefix) prefix
- (prog1 thumbs-gensym-counter
- (setq thumbs-gensym-counter
- (1+ thumbs-gensym-counter))))))
- (make-symbol (format "%s%d" pfix num))))))
-
(defsubst thumbs-temp-dir ()
(file-name-as-directory (expand-file-name thumbs-temp-dir)))
(format "%s%s-%s.jpg"
(thumbs-temp-dir)
thumbs-temp-prefix
- (thumbs-gensym "T")))
+ (cl-gensym "T")))
(defun thumbs-thumbsdir ()
"Return the current thumbnails directory (from `thumbs-thumbsdir').
(setq dirsize (- dirsize (car (cdar files-list))))
(setq files-list (cdr files-list)))))
-;; Check the thumbsnail directory size and clean it if necessary.
+;; Check the thumbnail directory size and clean it if necessary.
(when thumbs-thumbsdir-auto-clean
(thumbs-cleanup-thumbsdir))