;; Thumbnail file creation processes begin here and are marshaled
;; in a queue by `image-dired-create-thumb'.
- (setq process
- (apply #'start-process "image-dired-create-thumbnail" nil
- image-dired-cmd-create-thumbnail-program
- (mapcar
- (lambda (arg) (format-spec arg spec))
- (if (memq image-dired-thumbnail-storage
- image-dired--thumbnail-standard-sizes)
- image-dired-cmd-create-standard-thumbnail-options
- image-dired-cmd-create-thumbnail-options))))
+ (let ((cmd image-dired-cmd-create-thumbnail-program)
+ (args (mapcar
+ (lambda (arg) (format-spec arg spec))
+ (if (memq image-dired-thumbnail-storage
+ image-dired--thumbnail-standard-sizes)
+ image-dired-cmd-create-standard-thumbnail-options
+ image-dired-cmd-create-thumbnail-options))))
+ (image-dired-debug "Running %s %s" cmd (string-join args " "))
+ (setq process
+ (apply #'start-process "image-dired-create-thumbnail" nil
+ cmd args)))
(setf (process-sentinel process)
(lambda (process status)
(cl-decf image-dired-queue-active-jobs)
(image-dired-thumb-queue-run)
(when (= image-dired-queue-active-jobs 0)
- (image-dired-debug-message
+ (image-dired-debug
(format-time-string
"Generated thumbnails in %s.%3N seconds"
(time-subtract nil
(defvar image-dired-debug nil
"Non-nil means enable debug messages.")
-(defun image-dired-debug-message (&rest args)
+(defun image-dired-debug (&rest args)
"Display debug message ARGS when `image-dired-debug' is non-nil."
(when image-dired-debug
(apply #'message args)))
(defun image-dired-dir ()
"Return the current thumbnail directory (from variable `image-dired-dir').
Create the thumbnail directory if it does not exist."
- (let ((image-dired-dir (file-name-as-directory
- (expand-file-name image-dired-dir))))
+ (let ((image-dired-dir
+ (file-name-as-directory
+ (expand-file-name image-dired-dir))))
(unless (file-directory-p image-dired-dir)
(with-file-modes #o700
(make-directory image-dired-dir t))