]> git.eshelyaron.com Git - emacs.git/commitdiff
image-dired: Print command when debugging
authorStefan Kangas <stefankangas@gmail.com>
Fri, 16 Sep 2022 19:34:57 +0000 (21:34 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Fri, 16 Sep 2022 19:36:10 +0000 (21:36 +0200)
* 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'.

lisp/image/image-dired-external.el
lisp/image/image-dired-util.el

index 1e63123a2d164528455b7d7e1d1b6e7f0b3b69c3..6ad2aa72c90669eb4d686c934a1e4a5b00a03122 100644 (file)
@@ -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
index 0ac25ef8615bc1e175b59e32efcd9f9518c4b2fa..f9caed57b20af774df3be9ecf69d5faa5eaa61ab 100644 (file)
@@ -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))