[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/greader aeb49fe 58/76: greader-speechd.el:
From: |
Stefan Monnier |
Subject: |
[elpa] externals/greader aeb49fe 58/76: greader-speechd.el: |
Date: |
Fri, 8 Feb 2019 15:26:59 -0500 (EST) |
branch: externals/greader
commit aeb49fe4f8cde6461901b40545a250947540f83b
Author: Michelangelo Rodriguez <address@hidden>
Commit: Michelangelo Rodriguez <address@hidden>
greader-speechd.el:
fixed punctuation handling.
---
greader-speechd.el | 66 +++++++++++++++++++++++++++++-------------------------
1 file changed, 35 insertions(+), 31 deletions(-)
diff --git a/greader-speechd.el b/greader-speechd.el
index 2159bba..82df08d 100644
--- a/greader-speechd.el
+++ b/greader-speechd.el
@@ -16,7 +16,7 @@
:type 'string)
(defcustom
greader-speechd-executable-path
-(locate-file greader-speechd-executable exec-path)
+ (locate-file greader-speechd-executable exec-path)
"Path of speech-dispatcher client executable."
:tag "speechd client executable path"
:type 'string)
@@ -36,7 +36,7 @@
(defcustom
greader-speechd-punctuation
"none"
-"punctuation level of speech-dispatcher client to speak.
+ "punctuation level of speech-dispatcher client to speak.
It must be one of the following:
none, some, or all."
:tag "speech-dispatcher punctuation level"
@@ -44,17 +44,17 @@ none, some, or all."
;;; code
(defun greader-speechd--find-executable ()
"tries to find speech-dispatcher client using greader-speechd-executable as
basename."
-(locate-file greader-speechd-executable exec-path))
+ (locate-file greader-speechd-executable exec-path))
(defun greader-speechd-set-language
(&optional lang)
"sets language 'lang' for speech-dispatcher client.
if lang is omitted, it looks in variable greader-speechd-language and
retrieves the appropriate string used by spd-say or another client compatible."
(if (not lang)
- (concat "-l" greader-speechd-language)
+ (concat "-l" greader-speechd-language)
(progn
(setq-local greader-speechd-language lang)
- (concat "-l" lang))))
+ (concat "-l" lang))))
(defun greader-speechd-set-rate
(&optional rate)
@@ -64,33 +64,33 @@ for further documentation, see the documentation for
greader-speechd-rate variab
(concat "-r " (number-to-string greader-speechd-rate))
(progn
(setq-local greader-speechd-rate rate)
- (concat "-r " (number-to-string rate)))))
+ (concat "-r " (number-to-string rate)))))
+
(defun greader-speechd-set-punctuation (&optional punct)
"returns a suitable parameter to pass to spd-say for setting punctuation
leve.
punct must be a numeric value, 0 for no punctuation, 1 for some and 2 or >2
for all punctuation."
-(catch 'return
- (cond
- ((booleanp punct)
- (if punct
- (progn
- (setq-local greader-speechd-punctuation "all")
- (throw 'return (concat "-mall")))
- (progn
- (setq-local greader-speechd-punctuation "none")
- (throw 'return (concat "-mnone")))))
- ((numberp punct)
- (if (= punct 0)
- (progn
- (setq-local greader-speechd-punctuation "none")
- (throw 'return (concat "-mnone"))))
- (if (= punct 1)
- (progn
- (setq-local greader-speechd-punctuation "some")
- (throw 'return (concat "-msome"))))
- (if (>= punct 2)
- (progn
- (setq-local greader-speechd-punctuation "all")
- (throw 'return (concat "-mall"))))))))
+ (catch 'return
+ (cond
+ ((booleanp punct)
+ (if punct
+ (progn
+ (setq-local greader-speechd-punctuation "all")
+ (throw 'return (concat "-mall")))
+ (throw 'return greader-speechd-punctuation)))
+ ((numberp punct)
+ (if (= punct 0)
+ (progn
+ (setq-local greader-speechd-punctuation "none")
+ (throw 'return (concat "-mnone"))))
+ (if (= punct 1)
+ (progn
+ (setq-local greader-speechd-punctuation "some")
+ (throw 'return (concat "-msome"))))
+ (if (>= punct 2)
+ (progn
+ (setq-local greader-speechd-punctuation "all")
+ (throw 'return (concat "-mall"))))))))
+
(defun greader-speechd-stop ()
"stops speech-dispatcher client."
(start-process "speechd-client" nil greader-speechd-executable-path "-S")
@@ -115,16 +115,20 @@ punct must be a numeric value, 0 for no punctuation, 1
for some and 2 or >2 for
('punctuation
(cond
((equal arg 'no)
- (greader-speechd-set-punctuation 0))
+ (greader-speechd-set-punctuation 0)
+ nil)
((equal arg 'yes)
(greader-speechd-set-punctuation 2))
((not arg)
- (greader-speechd-set-punctuation))))
+ (if (equal (greader-speechd-set-punctuation) "all")
+"-mall"
+ nil))))
('stop
(greader-speechd-stop))
('extra
"-w")
(not-implemented
'not-implemented)))
+
(put 'greader-speechd 'greader-backend-name "greader-speechd")
(provide 'greader-speechd)
- [elpa] externals/greader a325ef4 54/76: Adding autoloads., (continued)
- [elpa] externals/greader a325ef4 54/76: Adding autoloads., Stefan Monnier, 2019/02/08
- [elpa] externals/greader 083f14b 43/76: greader.el:, Stefan Monnier, 2019/02/08
- [elpa] externals/greader 748cb81 44/76: greader.el:, Stefan Monnier, 2019/02/08
- [elpa] externals/greader ec40287 53/76: file README added., Stefan Monnier, 2019/02/08
- [elpa] externals/greader 0db37f6 48/76: preparing to merge., Stefan Monnier, 2019/02/08
- [elpa] externals/greader 4482ba6 56/76: initial work on punctuation., Stefan Monnier, 2019/02/08
- [elpa] externals/greader 3186627 75/76: greader.el:, Stefan Monnier, 2019/02/08
- [elpa] externals/greader 4ef8c7d 57/76: work on punctuation completed., Stefan Monnier, 2019/02/08
- [elpa] externals/greader 7a414f2 73/76: more work on backend completion, Stefan Monnier, 2019/02/08
- [elpa] externals/greader 9274673 66/76: Some diffs applied to various files., Stefan Monnier, 2019/02/08
- [elpa] externals/greader aeb49fe 58/76: greader-speechd.el:,
Stefan Monnier <=
- [elpa] externals/greader 2d55a6f 63/76: greader.el:, Stefan Monnier, 2019/02/08
- [elpa] externals/greader c5bb54e 61/76: greader.el:, Stefan Monnier, 2019/02/08
- [elpa] externals/greader 70128f8 59/76: greader.el:, Stefan Monnier, 2019/02/08
- [elpa] externals/greader 38b08ee 65/76: Merge branch 'devel', Stefan Monnier, 2019/02/08
- [elpa] externals/greader a2c9a16 55/76: changed greader-set-rate to reflect new back-ends architecture., Stefan Monnier, 2019/02/08
- [elpa] externals/greader 6baaffe 64/76: greader.el:, Stefan Monnier, 2019/02/08
- [elpa] externals/greader f278f60 70/76: fixes, Stefan Monnier, 2019/02/08
- [elpa] externals/greader 7d439f1 62/76: Patch from address@hidden applied, thanks!, Stefan Monnier, 2019/02/08
- [elpa] externals/greader 149ae41 74/76: Merge branch 'devel', Stefan Monnier, 2019/02/08
- [elpa] externals/greader 40e0718 69/76: greader.el:, Stefan Monnier, 2019/02/08