[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 ()
- [elpa] externals/calibre updated (28c605f9dc -> ad65bf9b51), ELPA Syncer, 2023/05/20
- [elpa] externals/calibre 41263e2820 08/11: Fix byte compiler warnings, ELPA Syncer, 2023/05/20
- [elpa] externals/calibre 436e70ac13 09/11: Fix docstring quoting, ELPA Syncer, 2023/05/20
- [elpa] externals/calibre ad65bf9b51 11/11: Bump package version to 1.3.3, ELPA Syncer, 2023/05/20
- [elpa] externals/calibre 3fa7d264da 03/11: Use constant instead of magic value,
ELPA Syncer <=
- [elpa] externals/calibre e0f6e49316 04/11: Add missing search function to calibre-cli, ELPA Syncer, 2023/05/20
- [elpa] externals/calibre 67b7386841 07/11: Move functions from calibre-core to calibre-cli, ELPA Syncer, 2023/05/20
- [elpa] externals/calibre 6ff78d6eca 05/11: Use correct author separator in calibre-cli, ELPA Syncer, 2023/05/20
- [elpa] externals/calibre 503e175c54 02/11: Document internal variables, ELPA Syncer, 2023/05/20
- [elpa] externals/calibre d7dd1f4d70 01/11: Fix copyright header, ELPA Syncer, 2023/05/20
- [elpa] externals/calibre 49f05eedc0 10/11: Remove second definition of calibre-series widget, ELPA Syncer, 2023/05/20
- [elpa] externals/calibre 472fb38333 06/11: Factor out JSON parsing in calibre-cli, ELPA Syncer, 2023/05/20