branch: externals/greader
commit 0fe0302c362543b267ed82173ce197498df42538
Author: Michelangelo Rodriguez <michelangelo.rodrig...@gmail.com>
Commit: Michelangelo Rodriguez <michelangelo.rodrig...@gmail.com>

    greader version 0.11.3
    
    Handling espeak possible emacspeak errors. too.
---
 greader-audiobook.el | 27 +++++++++++++++------------
 greader.el           |  2 +-
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/greader-audiobook.el b/greader-audiobook.el
index b154507c97..e1644275df 100644
--- a/greader-audiobook.el
+++ b/greader-audiobook.el
@@ -208,10 +208,13 @@ Return the generated file name, or nil if at end of the 
buffer."
          (setq text (greader-dehyphenate text))
          (when (or greader-dict-mode greader-dict-toggle-filters)
            (setq text (greader-dict-check-and-replace text)))
-         (setq output (call-process command nil nil nil rate language
+         (setq output (call-process command nil "*espeak-output*" nil
+                                    rate language
                                     wave-file text))
-         (when (= output 0)
-           (goto-char (cdr block)))
+         (if (= output 0)
+             (goto-char (cdr block))
+           (error "Espeak has generated an error.  Please see
+      *espeak-output* for more information"))
          filename)
       nil)))
 
@@ -256,7 +259,7 @@ COUNTER represents the current file name."
         (filename nil)
         (counter-chars 0))
     (while (< counter-chars (- (length
-                                total-blocks-string)
+                               total-blocks-string)
                               (length counter-string)))
       (setq filename (concat filename "0"))
       (setq counter-chars (+ counter-chars 1)))
@@ -266,10 +269,10 @@ COUNTER represents the current file name."
   "Compress given BOOK-DIRECTORY."
   (let ((zip-args (append (list "-rj")greader-audiobook-zip-args (list
                                                                  (concat
-                                                           
(string-remove-suffix
-                                                            "/"
-                                                            book-directory)
-                                                           ".zip"))
+                                                                  
(string-remove-suffix
+                                                                   "/"
+                                                                   
book-directory)
+                                                                  ".zip"))
                          (list book-directory)))
        (result nil))
     (setq result (apply 'call-process "zip" nil "*audiobook-zip*" nil
@@ -319,15 +322,15 @@ buffer without the extension, if any."
            (make-directory default-directory))
          (unless greader-audiobook-buffer-quietly
            (message "Starting conversion of %s ."
-                                                          book-directory))
+                    book-directory))
          (while (greader-audiobook--get-block)
            (setq output-file-name
                  (greader-audiobook--calculate-file-name
                   output-file-counter total-blocks))
            (unless greader-audiobook-buffer-quietly
              (message "converting block %d of %d"
-                                                            output-file-counter
-                                                            total-blocks))
+                      output-file-counter
+                      total-blocks))
            (setq output-file-name
                  (greader-audiobook-convert-block output-file-name))
            (if output-file-name
@@ -335,7 +338,7 @@ buffer without the extension, if any."
                  (when greader-audiobook-transcode-wave-files
                    (unless greader-audiobook-buffer-quietly
                      (message "Transcoding block to %s..."
-                                                                    
greader-audiobook-transcode-format))
+                              greader-audiobook-transcode-format))
                    (greader-audiobook-transcode-file
                     output-file-name)
                    (when
diff --git a/greader.el b/greader.el
index 66d525d1d2..6640329f27 100644
--- a/greader.el
+++ b/greader.el
@@ -8,7 +8,7 @@
 ;; URL: https://gitlab.com/michelangelo-rodriguez/greader
 
 ;; package-requires: ((google-translate))
-;; Version: 0.11.2
+;; Version: 0.11.3
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by

Reply via email to