[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/greader 9951bcf34c 1/2: Function `greader-get-language'
From: |
ELPA Syncer |
Subject: |
[elpa] externals/greader 9951bcf34c 1/2: Function `greader-get-language' added. |
Date: |
Sat, 22 Jul 2023 06:58:31 -0400 (EDT) |
branch: externals/greader
commit 9951bcf34c9a6780b9fd907e38d5d5b7f018cc2a
Author: Michelangelo Rodriguez <michelangelo.rodriguez@gmail.com>
Commit: Michelangelo Rodriguez <michelangelo.rodriguez@gmail.com>
Function `greader-get-language' added.
---
greader-espeak.el | 41 ++++++++---------------------------------
greader.el | 4 ++++
2 files changed, 12 insertions(+), 33 deletions(-)
diff --git a/greader-espeak.el b/greader-espeak.el
index 9cb784c9f1..d56ae36c92 100644
--- a/greader-espeak.el
+++ b/greader-espeak.el
@@ -1,32 +1,9 @@
-;;; greader-espeak.el --- espeak back-end for greader -*- lexical-binding: t;
-*-
-
-;; Copyright (C) 2019 Free Software Foundation, Inc.
-
-;; 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
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-
-;;; Commentary:
-;;
-
-;;; Code:
-
(defgroup greader-espeak
nil
"Back-end of espeak for greader."
:group 'greader
)
-;;; customization
+
(defcustom greader-espeak-language "en"
"Specifies the language of this back-end.
For a comprehensive list of languages and voices available in espeak
@@ -50,7 +27,6 @@ this variable determines authomatically if espeak is present
in your PATH enviro
:tag "espeak punctuation"
:type 'boolean)
-;;; code
(defun greader-espeak-set-rate (&optional rate)
"Return a string suitable for setting espeak RATE."
(if (not rate)
@@ -68,7 +44,6 @@ LANG must be recognized by espeak or espeak-ng."
(setq-local greader-espeak-language lang)
(concat "-v " lang))))
-;;;###autoload
(defun greader-espeak (command &optional arg &rest _)
"Back-end main function of greader-espeak.
COMMAND must be a string suitable for `make-process'."
@@ -86,19 +61,19 @@ COMMAND must be a string suitable for `make-process'."
('punctuation
(pcase arg
('yes
- (setq-local greader-espeak-punctuation t)
- "--punct")
+ (setq-local greader-espeak-punctuation t)
+ "--punct")
('no
- (setq-local greader-espeak-punctuation nil)
- nil)
+ (setq-local greader-espeak-punctuation nil)
+ nil)
('nil
- (if greader-espeak-punctuation
+ (if greader-espeak-punctuation
"--punct"
nil))))
-
+ ('get-language
+ greader-espeak-language)
(_
'not-implemented)))
(put 'greader-espeak 'greader-backend-name "greader-espeak")
(provide 'greader-espeak)
-;;; greader-espeak.el ends here
diff --git a/greader.el b/greader.el
index ddbce5f486..6e4d9e9830 100644
--- a/greader.el
+++ b/greader.el
@@ -608,6 +608,10 @@ buffer, so if you want to set it globally, please use `m-x
"Set punctuation to FLAG."
(greader-call-backend 'punctuation flag))
+(defun greader-get-language ()
+ "return language set in current back-end."
+ (greader-call-backend 'get-language))
+
(defun greader-toggle-punctuation ()
"Toggle punctuation locally for current buffer."
(interactive)