branch: externals/calibre
commit 9d8abb05f88c1be804d5bee4053ae577b83a1446
Author: Kjartan Oli Agustsson <[email protected]>
Commit: Kjartan Oli Agustsson <[email protected]>

    Log the calibredb command being executed to the *calibre* buffer
    
    * calibre-exec.el (calibre-exec--execute): Log the command being
      executed to the *calibre* buffer before execution.
    
    This should make it easier to determine why a command fails, since it
    becomes possible to identify which command it was.
---
 calibre-exec.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/calibre-exec.el b/calibre-exec.el
index ed9e0f57aa..ff57614276 100644
--- a/calibre-exec.el
+++ b/calibre-exec.el
@@ -50,12 +50,16 @@ EVENT is the process event, see Info node
   "Execute calibredb with arguments ARGS.
 ARGS should be a list of strings to be passed as arguments to
 calibredb.  SENTINEL is a process sentinel to install."
-  (if (not (executable-find calibre-calibredb-executable))
-      (error "Could not find calibredb")
+  (unless (executable-find calibre-calibredb-executable)
+    (error "Could not find calibredb"))
+  (let ((buffer (get-buffer-create calibre-exec--process-buffer))
+        (command `(,calibre-calibredb-executable "--with-library" 
,(calibre--library) ,@args)))
+    (with-current-buffer buffer
+      (insert (string-join command " ") "\n"))
     (make-process
      :name "calibre"
-     :command `(,calibre-calibredb-executable "--with-library" 
,(calibre--library) ,@args)
-     :buffer (get-buffer-create calibre-exec--process-buffer)
+     :command command
+     :buffer buffer
      :sentinel sentinel)))
 
 (defun calibre-exec--next-command ()

Reply via email to