From: Stefan Kangas Date: Fri, 16 Sep 2022 19:34:57 +0000 (+0200) Subject: image-dired: Print command when debugging X-Git-Tag: emacs-29.0.90~1856^2~435 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dda7502e0a7e0dafe6b4c4bdab8480f6cff11c66;p=emacs.git image-dired: Print command when debugging * lisp/image/image-dired-external.el (image-dired-create-thumb-1): Display command and arguments when debugging. * lisp/image/image-dired-util.el (image-dired-debug): Rename from 'image-dired-debug-message'. --- diff --git a/lisp/image/image-dired-external.el b/lisp/image/image-dired-external.el index 1e63123a2d1..6ad2aa72c90 100644 --- a/lisp/image/image-dired-external.el +++ b/lisp/image/image-dired-external.el @@ -311,15 +311,17 @@ and remove the cached thumbnail files between each trial run.") ;; 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) @@ -327,7 +329,7 @@ and remove the cached thumbnail files between each trial run.") (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 diff --git a/lisp/image/image-dired-util.el b/lisp/image/image-dired-util.el index 0ac25ef8615..f9caed57b20 100644 --- a/lisp/image/image-dired-util.el +++ b/lisp/image/image-dired-util.el @@ -38,7 +38,7 @@ (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))) @@ -46,8 +46,9 @@ (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))