emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/calibre 3fa7d264da 03/11: Use constant instead of magic


From: ELPA Syncer
Subject: [elpa] externals/calibre 3fa7d264da 03/11: Use constant instead of magic value
Date: Sat, 20 May 2023 19:57:31 -0400 (EDT)

branch: externals/calibre
commit 3fa7d264dac9edd67e19b83f234c0f4485a65d02
Author: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Commit: Kjartan Óli Ágústsson <kjartanoli@disroot.org>

    Use constant instead of magic value
    
    * calibre-exec.el (calibre-exec--process-buffer): Create new constant
    to store the name of the output buffer for calibredb processes.
    (calibre-exec--process-sentinel): Use calibre-exec--process-buffer
    instead of hard coded magic string.
    
    Inform the user of the existence of the output buffer if an error occurs.
    (calibre-exec--execute): Use calibre-exec--process-buffer instead of
    hard coded magic string.
---
 calibre-exec.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/calibre-exec.el b/calibre-exec.el
index 33654669b9..9e6cc34919 100644
--- a/calibre-exec.el
+++ b/calibre-exec.el
@@ -24,6 +24,9 @@
 ;;; Code:
 (require 'calibre-core)
 
+(defconst calibre-exec--process-buffer "*calibre*"
+  "The name of the buffer containing output from processes.")
+
 (defvar calibre-exec--commands nil
   "A list of commands queued for execution.")
 
@@ -36,9 +39,9 @@ EVENT is the process event, see Info node
 `(elisp)Sentinels'"
   (if (string= event "finished\n")
       (progn
-        (kill-buffer "*calibre*")
+        (kill-buffer calibre-exec--process-buffer)
         (calibre-library--refresh t))
-    (error "Calibre process failed %S" event))
+    (error "Calibre process failed.  See %s for details." 
calibre-exec--process-buffer))
   (if calibre-exec--commands
       (calibre-exec--next-command)
     (setf calibre-exec--executing nil)))
@@ -52,7 +55,7 @@ calibredb.  SENTINEL is a process sentinel to install."
     (make-process
      :name "calibre"
      :command `(,calibre-calibredb-executable "--with-library" 
,(calibre--library) ,@args)
-     :buffer (get-buffer-create "*calibre*")
+     :buffer (get-buffer-create calibre-exec--process-buffer)
      :sentinel sentinel)))
 
 (defun calibre-exec--next-command ()



reply via email to

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