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

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

[elpa] externals/greader 9274673 66/76: Some diffs applied to various fi


From: Stefan Monnier
Subject: [elpa] externals/greader 9274673 66/76: Some diffs applied to various files.
Date: Fri, 8 Feb 2019 15:27:00 -0500 (EST)

branch: externals/greader
commit 9274673ebe3ca3d2350badec1ac6cabb6542f52c
Author: Michelangelo Rodriguez <address@hidden>
Commit: Michelangelo Rodriguez <address@hidden>

    Some diffs applied to various files.
---
 greader-espeak.el  | 93 +++++++++++++++++++-----------------------------------
 greader-speechd.el | 45 ++++++++++----------------
 2 files changed, 50 insertions(+), 88 deletions(-)

diff --git a/greader-espeak.el b/greader-espeak.el
index cac7780..4c4e059 100644
--- a/greader-espeak.el
+++ b/greader-espeak.el
@@ -12,100 +12,73 @@
   :group 'greader
   )
 ;;; customization
-(defcustom
-  greader-espeak-language
-  "en"
+(defcustom greader-espeak-language "en"
   "specifies the language of this back-end. For a comprehensive list of 
languages and voices available in espeak type in a terminal:
-espeak --list-languages
-"
+espeak --list-languages"
   :tag "greader espeak language"
   :type 'string)
-(defcustom
-  greader-espeak-rate
-  200
+
+(defcustom greader-espeak-rate 200
   "Specifies the rate os speech in words per minute."
   :tag "greader espeak rate"
   :type 'integer)
-(defcustom
-  greader-espeak-executable-name
-  (locate-file "espeak" exec-path)
-  "Path of espeak executable.
+
+(defcustom greader-espeak-executable-name "espeak"
+  "File name of espeak executable.
 this variable determines authomatically if espeak is present in your PATH 
environment, then if this variable is nil, it means that you must first install 
espeak."
   :tag "espeak executable"
   :type 'string)
-(defcustom
-  greader-espeak-punctuation
-  nil
+
+(defcustom greader-espeak-punctuation nil
   "espeak punctuation switch."
   :tag "espeak punctuation"
   :type 'boolean)
 
 ;;; code
-(defun greader-espeak-set-rate
-    (&optional rate)
-  "returns a string suitable for setting espeak rate."
+(defun greader-espeak-set-rate (&optional rate)
+  "Return a string suitable for setting espeak rate."
   (if (not rate)
       (concat "-s" (number-to-string greader-espeak-rate))
     (progn
       (setq-local greader-espeak-rate rate)
       (concat "-s" (number-to-string rate)))))
-(defun greader-espeak-set-language
-    (&optional lang)
-  "returns the appropriate string to pass to espeak in order to set the 
language appropriately"
+
+(defun greader-espeak-set-language (&optional lang)
+  "Return the appropriate string to pass to espeak in order to set the 
language appropriately"
   (if (not lang)
       (concat "-v" greader-espeak-language)
     (progn
       (setq-local greader-espeak-language lang)
       (concat "-v " lang))))
-(defun greader-espeak--find-executable
-    ()
-  "tries to find espeak executable in PATH.
-If it's present, returns absolute path of espeak, else returns nil."
-  (locate-file "espeak" exec-path))
 
-(defun greader-espeak-set-punctuation
-    (&optional switch)
-  "sets espeak punctuation on or off.
-this function accepts only nil or t."
-  (if switch
-      (setq-local greader-espeak-punctuation switch)
-    greader-espeak-punctuation))    
 ;;;###autoload
-(defun greader-espeak (command &optional arg &rest args)
+(defun greader-espeak (command &optional arg &rest _)
   "back-end main function of greader-espeak."
   (pcase command
     ('executable
-     (if greader-espeak-executable-name
-        greader-espeak-executable-name
-       nil))
+     greader-espeak-executable-name)
     ('lang
-     (if (not arg)
-        (greader-espeak-set-language)
-       (greader-espeak-set-language arg)))
+     (greader-espeak-set-language arg))
     ('rate
      (cond
-      ((not arg)
-       (greader-espeak-set-rate))
-      ((numberp arg)
-       (greader-espeak-set-rate arg))
       ((equal arg 'value)
-       greader-espeak-rate)))
+       greader-espeak-rate)
+      (t
+       (greader-espeak-set-rate arg))))
     ('punctuation
-     (cond
-      (
-       (equal arg 'yes)
-       (setq-local greader-espeak-punctuation t)
-       "--punct")
-      (
-       (equal arg 'no)
-       (setq-local greader-espeak-punctuation nil)
-       nil)
-      ((not arg)
-       (if greader-espeak-punctuation
-          "--punct"
-        nil))))
+     (pcase arg
+       ('yes
+        (setq-local greader-espeak-punctuation t)
+        "--punct")
+       ('no
+        (setq-local greader-espeak-punctuation nil)
+        nil)
+       ('nil
+        (if greader-espeak-punctuation
+           "--punct"
+         nil))))
     
-    (command-not-implemented
+    (_
      'not-implemented)))
-(put 'greader-espeak 'greader-backend-name "greader-espeak")
+
 (provide 'greader-espeak)
diff --git a/greader-speechd.el b/greader-speechd.el
index 82df08d..e4023ef 100644
--- a/greader-speechd.el
+++ b/greader-speechd.el
@@ -8,39 +8,29 @@
   "speech-dispatcher back-end for greader"
   :group 'greader)
 
-(defcustom
-  greader-speechd-executable
-  "spd-say"
-  "executable file name."
+(defcustom greader-speechd-executable "spd-say"
+  "Executable file name."
   :tag "speech-dispatcher client executable file name"
   :type 'string)
-(defcustom
-  greader-speechd-executable-path
-  (locate-file greader-speechd-executable exec-path)
-  "Path of speech-dispatcher client executable."
-  :tag "speechd client executable path"
-  :type 'string)
-(defcustom
-  greader-speechd-language
-  "en"
-  "specifies language of speech-dispatcher client to speak in."
+
+(defcustom greader-speechd-language "en"
+  "Language of speech-dispatcher client to speak in."
   :tag "speech-dispatcher language"
   :type 'string)
-(defcustom
-  greader-speechd-rate
-  10
-  "specifies rate of speech.
-(From -100 to 100.)"
+
+(defcustom greader-speechd-rate 10
+  "Rate of speech.
+Can be a value between -100 and 100."
   :tag "speech-dispatcher rate"
   :type 'integer)
-(defcustom
-  greader-speechd-punctuation
-  "none"
-  "punctuation level of speech-dispatcher client to speak.
+
+(defcustom greader-speechd-punctuation "none"
+  "Punctuation level of speech-dispatcher client to speak.
 It must be one of the following:
 none, some, or all."
   :tag "speech-dispatcher punctuation level"
   :type 'string)
+
 ;;; code
 (defun greader-speechd--find-executable ()
   "tries to find speech-dispatcher client using greader-speechd-executable as 
basename."
@@ -93,14 +83,14 @@ punct must be a numeric value, 0 for no punctuation, 1 for 
some and 2 or >2 for
 
 (defun greader-speechd-stop ()
   "stops speech-dispatcher client."
-  (start-process "speechd-client" nil greader-speechd-executable-path "-S")
+  (start-process "speechd-client" nil greader-speechd-executable "-S")
   (sleep-for 0 100))
 ;;;###autoload
-(defun greader-speechd (command &optional arg &rest ignore)
+(defun greader-speechd (command &optional arg &rest _)
   "greader speech-dispatcher back-end."
   (pcase command
     ('executable
-     greader-speechd-executable-path)
+     greader-speechd-executable)
     ('lang
      (if (not arg)
         (greader-speechd-set-language)
@@ -127,8 +117,7 @@ punct must be a numeric value, 0 for no punctuation, 1 for 
some and 2 or >2 for
      (greader-speechd-stop))
     ('extra
      "-w")
-    (not-implemented
+    (_
      'not-implemented)))
 
-(put 'greader-speechd 'greader-backend-name "greader-speechd")
 (provide 'greader-speechd)



reply via email to

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