commit fc73a411deedccecf1952bc9d55ea99f60022cb4
parent 4656dd3aa40ab5d3e7051f218a2d64904f9d38e6
Author: Yuval Langer <yuval.langer@gmail.com>
Date: Mon, 10 Jul 2023 21:08:05 +0300
Fix a few docstring issues.
Diffstat:
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/nano-tts.el b/nano-tts.el
@@ -52,8 +52,11 @@ nil when no text-to-speech engine is running.")
(defun nano-tts--get-region-as-string-to-speak ()
- "Returns the string inside the region and concatenates a newline
-at its end for better espeak-ability."
+ "Return the string inside the region.
+
+Concatenates a newline to the end of the region's string to make
+the espeak actually read the text sent. This is needed due to
+espeak's stdandard input buffering."
(concat
(buffer-substring (region-beginning)
(region-end))
@@ -63,9 +66,11 @@ at its end for better espeak-ability."
(defun nano-tts-speak ()
- "Starts a new TTS process and send the region's text into its
+ "Read aloud a region of text.
+
+Start a new TTS process and send the region's text into its
stdin, otherwise send the same to the existing running TTS
-process. If the process is not running, make the system forget
+process. If the process is not running, make nano-tts forget
about the last process."
(interactive)
@@ -82,7 +87,7 @@ about the last process."
(nano-tts--get-region-as-string-to-speak)))
;; If the TTS process is not running.
(t
- ;; Kill the TTS process before making the system forget about
+ ;; Kill the TTS process before making nano-tts forget about
;; it.
(nano-tts-kill))))
@@ -101,14 +106,16 @@ about the last process."
(defun nano-tts-kill ()
- "Set the system's variable holding the process object to nil and
+ "Stop speaking.
+
+Set nano-tts's variable holding the process object to nil and
kill the process."
(interactive)
;; If there is a TTS process object.
(if nano-tts--tts-process
(let ((old-tts-process nano-tts--tts-process))
- ;; Make the system aware that it is dead.
+ ;; Make nano-tts aware that it is dead.
(setq nano-tts--tts-process
nil)
;; Kill the TTS process.