emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master dda7502e0a 2/2: image-dired: Print command when debugging


From: Stefan Kangas
Subject: master dda7502e0a 2/2: image-dired: Print command when debugging
Date: Fri, 16 Sep 2022 15:36:35 -0400 (EDT)

branch: master
commit dda7502e0a7e0dafe6b4c4bdab8480f6cff11c66
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    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'.
---
 lisp/image/image-dired-external.el | 22 ++++++++++++----------
 lisp/image/image-dired-util.el     |  7 ++++---
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/lisp/image/image-dired-external.el 
b/lisp/image/image-dired-external.el
index 1e63123a2d..6ad2aa72c9 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 0ac25ef861..f9caed57b2 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]