speechd-el-2.11/0000755000175000001440000000000014070023103012133 5ustar pdmusersspeechd-el-2.11/speechd.el0000644000175000001440000013673614070023103014110 0ustar pdmusers;;; speechd.el --- Library for accessing Speech Dispatcher -*- lexical-binding: t -*- ;; Copyright (C) 2012-2021 Milan Zamazal ;; Copyright (C) 2003-2010 Brailcom, o.p.s. ;; Author: Milan Zamazal ;; COPYRIGHT NOTICE ;; ;; 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 . ;;; Commentary: ;; This library allows you to communicate with Speech Dispatcher. ;; Usually, the communication goes like this: ;; ;; (speechd-open) ;; ... ;; (speechd-say-text "Hello, world!") ;; ... ;; (speechd-close) ;; ;; Functions and variables starting with the prefix `speechd--' are considered ;; internal and you shouldn't use them outside this file. ;; ;; See docstrings and the Texinfo manual for full details. ;;; Code: (require 'cl-lib) (require 'xml) (require 'speechd-common) ;;; User variables (defgroup speechd () "SSIP interface." :group 'speechd-el) (defcustom speechd-connection-method 'unix-socket "Connection method to Speech Dispatcher. Possible values are `unix-socket' for Unix domain sockets and `inet-socket' for Internet sockets on a given host and port (see `speechd-host' and `speechd-port' variables)." :type '(choice (const :tag "Unix domain socket" unix-socket) (const :tag "Internet socket" inet-socket)) :group 'speechd) (defcustom speechd-host (or (getenv "SPEECHD_HOST") "localhost") "Name of the default host running speechd to connect to. Value of this variable matters only when Internet sockets are used for communication with Speech Dispatcher." :type 'string :group 'speechd) (defcustom speechd-port (or (condition-case _ (car (read-from-string (getenv "SPEECHD_PORT"))) (error)) 6560) "Default port of speechd. Value of this variable matters only when Internet sockets are used for communication with Speech Dispatcher." :type 'integer :group 'speechd) (defcustom speechd-autospawn t "If non-nil, Emacs will attempt to automatically start Speech Dispatcher. This means that if speechd-el gets a speech request and the Speech Dispatcher server is not running already, speechd-el will launch it." :type 'boolean :group 'speechd) (defcustom speechd-timeout 3 "Number of seconds to wait for speechd response." :type 'integer :group 'speechd) (define-widget 'speechd-priority-tag 'choice "Radio group for selecting a speechd priority tag." :args '((const :tag "Important" :value important) (const :tag "Message" :value message) (const :tag "Text" :value text) (const :tag "Notification" :value notification) (const :tag "Progress" :value progress))) (define-widget 'speechd-voice-tag 'choice "Voice selector." :args '((const :tag "Default" nil) (symbol :tag "Named" :value nil :match (lambda (w value) (or (eq value nil) (assoc value speechd-voices)))))) (defmacro speechd--generate-customization-options (var) (let ((value (symbol-value var))) `(quote (choice :value ,(cdr (cl-first value)) ,@(mapcar #'(lambda (o) `(const :tag ,(car o) ,(cdr o))) value))))) (defconst speechd--punctuation-modes '(("none" . none) ("some" . some) ("all" . all))) (defconst speechd--capital-character-modes '(("none" . none) ("spell" . spell) ("icon" . icon))) (defun speechd--set-variable-and-reopen (name value) (let ((orig-value (when (default-boundp name) (default-value name)))) (set-default name value) (when (and (not (equal orig-value value)) (fboundp 'speechd-reopen)) (speechd-reopen)))) (defcustom speechd-voices '() "Alist of voice identifiers and their parameters. Each element of the list is of the form (VOICE-ID . PARAMETERS), where VOICE-ID is a symbol under which the voice will be accessed and PARAMETERS is an alist of parameter identifiers and parameter values. Valid parameter names are the following symbols: language, gender, age, style, name, rate, pitch, volume, punctuation-mode, capital-character-mode, message-priority, output-module. Please note that any parameter entry present will change the corresponding parameter, even if the parameter value is nil or empty; if you don't want to change the parameter in any way by the voice, don't put it to the list (and don't enable its entry in customize). Name is a string identifying Speech Dispatcher voice name. If it is not given, the parameters gender, age, and style are considered to select a Speech Dispatcher voice. Gender can be one of the symbols `male', `female', `neutral'. Age can be one of the symbols `middle-adult', `child'. `neutral'. Style can be one of the numbers 1, 2, 3 (style values are likely to be changed in future). The message-priority parameter sets priority of any message of the voice. Its value is any of the message priority symbols. See the corresponding speechd-set-* functions for valid values of other parameters. The voice named nil is special, it defines a default voice. Explicit definition of its parameters is optional." :type `(repeat (cons :tag "Voice" (speechd-voice-tag :tag "Voice") (set :tag "Parameters" ;; (cons :tag "Language" (const :format "" language) string) (cons :tag "Gender" (const :format "" gender) (choice (const male) (const female) (const neutral))) (cons :tag "Age" (const :format "" age) (choice (const middle-adult) (const child) (const neutral))) (cons :tag "Style" (const :format "" style) (choice (const 1) (const 2) (const 3))) (cons :tag "SSIP voice identifier" (const :format "" name) (choice (const "male1") (const "male2") (const "male3") (const "female1") (const "female2") (const "female3") (const "child_male") (const "child_female") (string :tag "Other"))) ;; (cons :tag "Rate" (const :format "" rate) integer) (cons :tag "Pitch" (const :format "" pitch) integer) (cons :tag "Volume" (const :format "" volume) integer) ;; (cons :tag "Punctuation mode" (const :format "" punctuation-mode) ,(speechd--generate-customization-options speechd--punctuation-modes)) (cons :tag "Capital character mode" (const :format "" capital-character-mode) ,(speechd--generate-customization-options speechd--capital-character-modes)) ;; (cons :tag "Message priority" (const :format "" message-priority) (speechd-priority-tag :value text)) (cons :tag "Output module" (const :format "" output-module) string)))) :set #'speechd--set-variable-and-reopen :group 'speechd) (defcustom speechd-connection-voices '() "Alist of connection names and corresponding voices. Each element of the list is of the form (CONNECTION-NAME . VOICE-ID), where CONNECTION-NAME is a string naming a connection and VOICE-ID is a voice identifier defined in the variable `speechd-voices'. For connections that are not specified here, the voice named nil is used. You must reopen the connections to apply the changes to this variable." :type '(alist :key-type (string :tag "Connection name") :value-type (speechd-voice-tag :tag "Voice")) :set #'speechd--set-variable-and-reopen :group 'speechd) (defcustom speechd-cancelable-connections '() "List of names of connections on which cancel operation applies by default." :type '(repeat (string :tag "Connection name")) :group 'speechd) (defcustom speechd-face-voices '() "Alist mapping faces to voices. Each of the alist element is of the form (FACE . VOICE) where FACE is a face and string is a voice identifier defined in `speechd-voices'. Each face is spoken in the corresponding voice. If there's no item for a given face in this variable, the face is spoken in the current voice." :type '(alist :key-type face :value-type (speechd-voice-tag :tag "Voice")) :group 'speechd) ;;; External variables (defvar speechd-spell nil "If non-nil, any spoken text is spelled.") ;;; Internal constants and configuration variables (defconst speechd--buffer " *speechd*" "Name of the buffer associated with speechd connections.") (defconst speechd--application-name "Emacs" "Name of the client as set to speechd.") (defvar speechd--language-codes '(("czech" . "cs") ("english" . "en") ("french" . "fr") ("german" . "de"))) (defvar speechd--default-language (or (cdr (assoc current-language-environment speechd--language-codes)) "en")) (defvar speechd--default-connection-parameters '(punctuation-mode some spelling-mode nil capital-character-mode none voice male1 rate 0 pitch 0 volume 100 index-marks t ssml-mode nil)) (defconst speechd--coding-system (if (featurep 'xemacs) 'no-conversion-dos ;; No utf yet 'utf-8-dos)) (defconst speechd--parameter-names '((client-name . "CLIENT_NAME") (language . "LANGUAGE") (message-priority . "PRIORITY") (punctuation-mode . "PUNCTUATION") (pause-context . "PAUSE_CONTEXT") (capital-character-mode . "CAP_LET_RECOGN") (voice . "VOICE") (synthesizer-voice . "SYNTHESIS_VOICE") (rate . "RATE") (pitch . "PITCH") (volume . "VOLUME") (spelling-mode . "SPELLING") (index-marks . "NOTIFICATION INDEX_MARKS") (ssml-mode . "SSML_MODE") (output-module . "OUTPUT_MODULE") ; TODO: to be removed sometimes )) (defconst speechd--list-parameters '((voices "VOICES" identity) (synthesis-voices "SYNTHESIS_VOICES" (lambda (line) (cl-first (split-string line)))))) (defconst speechd--parameter-value-mappings '((message-priority (important . "IMPORTANT") (message . "MESSAGE") (text . "TEXT") (notification . "NOTIFICATION") (progress . "PROGRESS") ) (punctuation-mode (none . "none") (some . "some") (all . "all")) (capital-character-mode (none . "none") (spell . "spell") (icon . "icon")) (spelling-mode (t . "on") (nil . "off")) (index-marks (t . "on") (nil . "off")) (ssml-mode (t . "on") (nil . "off")))) (defconst speechd--volatile-parameters '(output-module)) ;;; Internal variables (cl-defstruct speechd--connection name host port (failure-p nil) (last-try-time nil) process (process-output "") (paused-p nil) (in-block nil) (parameters ()) (forced-priority nil) (last-command nil)) (cl-defstruct speechd--request string) (defvar speechd--connections (make-hash-table :test 'equal) "Hash table mapping client names to `speechd-connection' instances.") (defvar speechd--retry-time 1.0) (defvar speechd-client-name) (defvar speechd--current-connection) ;;; Utilities (defmacro speechd--iterate-connections (&rest body) `(maphash #'(lambda (_ connection) (let ((speechd--current-connection connection)) ,@body)) speechd--connections)) (defmacro speechd--iterate-clients (&rest body) `(maphash #'(lambda (name _) (let ((speechd-client-name name)) ,@body)) speechd--connections)) (defun speechd-connection-names () "Return the list of all present connection names." (let ((names '())) (speechd--iterate-clients (push speechd-client-name names)) names)) (defmacro speechd--with-current-connection (&rest body) `(let ((speechd--current-connection (speechd--connection))) (when (and (speechd--connection-failure-p speechd--current-connection) (>= (- (float-time) (speechd--connection-last-try-time speechd--current-connection)) speechd--retry-time)) (ignore-errors (speechd-reopen t)) (setq speechd--current-connection (speechd--connection))) (unless (speechd--connection-failure-p speechd--current-connection) ,@body))) (defmacro speechd--with-connection-setting (var value &rest body) (let ((accessor (intern (concat "speechd--connection-" (symbol-name var)))) (orig-value (gensym))) `(let ((,orig-value (,accessor connection))) (setf (,accessor connection) ,value) (unwind-protect (progn ,@body) (setf (,accessor connection) ,orig-value))))) (defmacro speechd--with-connection-parameters (parameters &rest body) (let (($parameters (gensym)) ($orig-parameters (gensym)) ($cparameters (gensym)) ($p (gensym)) ($v (gensym)) ($orig-v (gensym)) ($pv (gensym))) `(let* ((,$parameters ,parameters) (,$orig-parameters ())) (unwind-protect (let ((,$cparameters (speechd--connection-parameters speechd--current-connection))) (while ,$parameters (let* ((,$p (cl-first ,$parameters)) (,$v (cl-second ,$parameters)) (,$orig-v (plist-get ,$cparameters ,$p))) (when (and (not (equal ,$v ,$orig-v)) (or ,$v (not (memq ,$p '(language))))) (when (and (plist-member ,$cparameters ,$p) (not (memq ,$p '(message-priority)))) (push (cons ,$p ,$orig-v) ,$orig-parameters)) (speechd--set-parameter ,$p ,$v))) (setq ,$parameters (nthcdr 2 ,$parameters))) ,@body) (dolist (,$pv ,$orig-parameters) (speechd--set-parameter (car ,$pv) (cdr ,$pv))))))) (defun speechd--voice-name (parameters) (or (cdr (assoc 'name parameters)) (let ((gender (cdr (assoc 'gender parameters))) (age (cdr (assoc 'age parameters))) (style (cdr (assoc 'style parameters)))) (format "%s%s%s" (if (eq age 'child) "child_" "") (if (eq gender 'female) "female" "male") (or style "1"))))) (defun speechd--voice-parameters (voice) (let* ((parameters (cdr (assoc voice speechd-voices))) (voice-name (speechd--voice-name parameters)) (result (if voice-name (list 'voice voice-name) '()))) (dolist (p parameters) (unless (memq (car p) '(name gender age style)) (plist-put result (car p) (cdr p)))) result)) (defmacro speechd--with-voice (voice &rest body) `(speechd--with-connection-parameters (speechd--voice-parameters ,voice) ,@body)) (defun speechd--current-language () speechd-language) ;;; Process management functions (cl-defun speechd--connection (&optional (name speechd-client-name) (create-if-needed t)) (or (gethash name speechd--connections) (and create-if-needed (let ((speechd-client-name name)) (speechd-open))))) (defun speechd--jump-to-marker (index-mark) (let ((marker (cdr (assoc index-mark speechd--markers)))) (when marker (let ((buffer (marker-buffer marker)) (position (marker-position marker))) (when buffer (select-window (or (get-buffer-window buffer) (selected-window))) (unless (eq (window-buffer) buffer) (switch-to-buffer buffer)) (goto-char position)))))) (defun speechd--process-notifications (output) ;; 700-msg_id ;; 700-client_id ;; 700-index_mark ;; 700 END (let ((notifications '()) (pos 0)) (while (string-match speechd--notification-regexp output pos) (push (list (match-string 1 output) (match-string 2 output) (match-string 3 output)) notifications) (setq pos (match-end 0))) ;; There can be additional index marks inserted by Speech Dispatcher, ;; let's skip them and find the first meaningful index mark. (while notifications (cl-destructuring-bind (code separator _message) (car notifications) (setq notifications (cdr notifications)) (when (and (equal code speechd--index-mark-code) (equal separator " ")) (when notifications (cl-destructuring-bind (code separator message) (car notifications) (when (and (equal code speechd--index-mark-code) (equal separator "-")) (speechd--jump-to-marker message) (setq notifications nil)))))))) output) (defun speechd--process-filter (_process output) (speechd--with-current-connection (setf (speechd--connection-process-output speechd--current-connection) (speechd--process-notifications (concat (speechd--connection-process-output speechd--current-connection) output))))) (defun speechd--open-connection (method host port socket-name) (let ((process (cond ((eq method 'unix-socket) (make-network-process :name "speechd" :family "local" :remote (or socket-name (or (getenv "SPEECHD_SOCK") (expand-file-name (let ((runtime-dir (getenv "XDG_RUNTIME_DIR"))) (concat (if runtime-dir (concat runtime-dir "/") "~/.") "speech-dispatcher/speechd.sock"))))))) ((eq method 'inet-socket) (open-network-stream "speechd" nil host port)) (t (error "Invalid communication method: `%s'" method))))) (when process (set-process-coding-system process speechd--coding-system speechd--coding-system) (if (fboundp 'set-process-query-on-exit-flag) (set-process-query-on-exit-flag process nil) (set-process-query-on-exit-flag process nil)) (set-process-filter process #'speechd--process-filter)) process)) (defun speechd--close-connection (connection) (let ((process (speechd--connection-process connection))) (when process (delete-process (speechd--connection-process connection)) (setf (speechd--connection-process connection) nil)))) (defun speechd--send-connection (connection command) (let ((process (speechd--connection-process connection))) (when process (with-speechd-coding-protection (condition-case _ (progn (process-send-string process command) (let ((output (speechd--connection-process-output connection))) (while (not (string-match speechd--end-regexp output)) (unless (accept-process-output process speechd-timeout nil 1) (signal 'ssip-connection-error "Timeout in communication with Speech Dispatcher")) (setq output (speechd--connection-process-output connection))) (let ((pos (match-end 0))) ;; If there are more responses, try to get in sync: (while (string-match speechd--end-regexp output pos) (setq output (substring output pos)) (setq pos (- (match-end 0) pos))) (setf (speechd--connection-process-output connection) (substring output pos)) (substring output 0 pos)))) (error (speechd--permanent-connection-failure connection) (signal 'ssip-connection-error "Error in communication with Speech Dispatcher"))))))) (put 'ssip-connection-error 'error-conditions '(error speechd-connection-error ssip-connection-error)) (put 'ssip-connection-error 'error-message "Error on opening Speech Dispatcher connection") ;;;###autoload (cl-defun speechd-open (&optional method &key host port socket-name quiet force-reopen) "Open connection to Speech Dispatcher using the given method. If the connection corresponding to the current `speechd-client-name' value already exists, close it and reopen again, with the same connection parameters. Available methods are `unix-socket' and `inet-socket' for communication over Unix sockets and TCP sockets respectively. Default is 'unix-socket'. The key arguments HOST and PORT are only relevant to the `inet-socket' communication method and identify the speechd server location. They can override default values stored in the variables `speechd-host' and `speechd-port'. The SOCKET-NAME argument is only relevant to the `unix-socket' communication method and can override the default path to the Dispatcher's Unix socket for the given user. If the key argument QUIET is non-nil, don't report failures and quit silently. If the key argument FORCE-REOPEN is non-nil, try to reopen an existent connection even if it previously failed. Return the opened connection on success, nil otherwise." (interactive) (let ((connection (gethash speechd-client-name speechd--connections))) (let ((method (or method speechd-connection-method)) (host (or host speechd-host)) (port (or port speechd-port))) (when connection (speechd--close-connection connection) (setq host (speechd--connection-host connection) port (speechd--connection-port connection))) (when speechd-autospawn (when (eql (ignore-errors (call-process "speech-dispatcher" nil nil nil "--spawn")) 0) (sleep-for 1))) (let* ((name speechd-client-name) (voice (cdr (assoc name speechd-connection-voices))) (default-parameters (append (speechd--voice-parameters voice) speechd--default-connection-parameters)) (parameters (cond ((and connection force-reopen) (append default-parameters (speechd--connection-parameters connection))) (connection (append (speechd--connection-parameters connection) default-parameters)) (t default-parameters))) (connection-error nil) (process (when (or (not connection) (not (speechd--connection-failure-p connection)) force-reopen) (condition-case err (speechd--open-connection (or method 'unix-socket) host port socket-name) (file-error (setq connection-error err) nil))))) (when (or process (not quiet)) (setq connection (make-speechd--connection :name name :host host :port port :process process)) (puthash name connection speechd--connections)) (when (and (not process) (not quiet)) (speechd--permanent-connection-failure connection) (signal 'ssip-connection-error connection-error)) (when process (speechd--set-connection-name name) (setq parameters (append parameters (list 'language speechd--default-language))) (let ((already-set '(client-name))) (while parameters (cl-destructuring-bind (parameter value . next) parameters (unless (memq parameter already-set) (push parameter already-set) (speechd--set-parameter parameter value)) (setq parameters next))))) (let ((priority (and connection (plist-get default-parameters 'message-priority)))) (when priority (speechd--set-parameter 'message-priority priority) (setf (speechd--connection-forced-priority connection) t))))) connection)) (cl-defun speechd-close (&optional (name speechd-client-name)) "Close speechd connection named NAME." (interactive) (let ((connection (speechd--connection name nil))) (when connection (speechd--close-connection connection) (remhash name speechd--connections)))) (defun speechd-close-all () "Close all speechd connections." (speechd--iterate-clients (speechd-close))) (defun speechd-reopen (&optional quiet) "Close and open again all the connections to speechd. If QUIET is non-nil, don't echo success report." (interactive) (let ((number-of-connections 0) (number-of-failures 0)) (maphash #'(lambda (name _) (let ((speechd-client-name name)) (if (speechd-open nil :quiet t :force-reopen t) (cl-incf number-of-connections) (cl-incf number-of-failures)))) speechd--connections) (unless quiet (message (format "%d connections successfully reopened, %d failures" number-of-connections number-of-failures))))) ;;; Process communication functions (defconst speechd--eol "\n") (defconst speechd--end-regexp (format "^[0-6][0-9][0-9] .*%s" speechd--eol)) (defconst speechd--result-regexp (format "\\`[0-9][0-9][0-9]-\\(.*\\)%s" speechd--eol)) (defconst speechd--success-regexp (format "^[1-2][0-9][0-9] .*%s" speechd--eol)) (defconst speechd--notification-regexp (format "^\\(7[0-9][0-9]\\)\\([- ]\\)\\(.*\\)%s" speechd--eol)) (defconst speechd--index-mark-code "700") (defun speechd--permanent-connection-failure (connection) (speechd--close-connection connection) (setf (speechd--connection-failure-p connection) t (speechd--connection-last-try-time connection) (float-time) (speechd--connection-paused-p connection) nil (speechd--connection-parameters connection) ())) (defun speechd--send-request (request) (speechd--with-current-connection (save-match-data (let ((answer (speechd--send-connection speechd--current-connection (speechd--request-string request)))) (let ((data '()) success) (while (and answer (string-match speechd--result-regexp answer)) (push (match-string 1 answer) data) (setq answer (substring answer (match-end 0)))) (setq success (and answer (string-match speechd--success-regexp answer))) (unless success (setq data nil)) (list success data (and success (substring answer 0 3)) (and success (substring answer 4)))))))) (defconst speechd--block-commands '(("speak") (".") ("sound_icon") ("char") ("key") ("quit") ("block" ("end")) ("set" ("self" ("rate") ("pitch") ("volume") ("voice") ("language") ("punctuation") ("cap_let_recogn") ("ssml_mode"))))) (defun speechd--block-command-p (command &optional allowed) (unless allowed (setq allowed speechd--block-commands)) (let* ((match (assoc (downcase (cl-first command)) allowed)) (rest-allowed (cdr match))) (and match (or (not rest-allowed) (speechd--block-command-p (cl-rest command) rest-allowed))))) (cl-defun speechd--send-command (command) (unless (listp command) (setq command (list command))) (speechd--with-current-connection (when (or (not (speechd--connection-in-block speechd--current-connection)) (speechd--block-command-p command)) (setf (speechd--connection-last-command speechd--current-connection) command) (speechd--send-request (make-speechd--request :string (concat (mapconcat #'identity command " ") speechd--eol)))))) (defun speechd--send-text (text) (when (cl-first (or (speechd--send-command "SPEAK") '(t))) ;; We must be careful here. There is no answer from SSIP until all data ;; including the terminator is sent. Thus, if we send the data in pieces, ;; there may be noticeable delays when waiting for TCP packet ;; acknowledgments. So we send all data, including the final dot ;; terminator, in a single piece. (save-match-data (let ((i 0)) (while (string-match "[\200-\377]" text i) (let ((char (string-to-char (match-string 0 text)))) (if (char-charset char '(eight-bit)) (setq text (replace-match (format "\\%o" (encode-char char 'eight-bit)) t t text)) (setq i (match-end 0)))))) (let ((i 0)) (while (and (> (length text) 0) (string-match "\\(\\`\\|\n\\)\\(\\(\\.\\).*\\)\\(\n\\|\\'\\)" text i)) (setq text (replace-match ".." nil nil text 3)) (setq i (1+ (match-end 0)))))) ;; We must remove text properties from the string, otherwise Emacs does ;; strange things when recoding non-ASCII characters to UTF-8. (set-text-properties 0 (length text) nil text) (unless (cl-first (or (speechd--send-request (make-speechd--request :string (concat text speechd--eol "." speechd--eol))) '(t))) ;; We must reset the connection on failure, to bring it back to the ;; command state from the text reading state. (speechd-close)))) ;;; Value retrieval functions (defun speechd--list (parameter) (cl-multiple-value-bind (command processor) (cdr (assoc parameter speechd--list-parameters)) (mapcar processor (cl-second (speechd--send-command (list "LIST" command)))))) ;;; Parameter setting functions (defun speechd--convert-numeric (number) (cond ((< number -100) -100) ((> number 100) 100) (t number))) (defun speechd--transform-parameter-value (parameter value) (cond ((stringp value) value) ((integerp value) (number-to-string (speechd--convert-numeric value))) ((symbolp value) (cdr (assoc value (cdr (assoc parameter speechd--parameter-value-mappings))))))) (defun speechd--call-set-parameter (parameter value globally) (let ((p (or (cdr (assoc parameter speechd--parameter-names)) (error "Invalid parameter name: `%s'" parameter))) (v (or (speechd--transform-parameter-value parameter value) (error "Invalid parameter value: %s=%s" parameter value)))) (speechd--send-command (list "SET" (if globally "all" "self") p v)))) (defun speechd--set-connection-parameter (parameter value) (let* ((plist (speechd--connection-parameters speechd--current-connection)) (orig-value (if (plist-member plist parameter) (plist-get plist parameter) 'unknown))) (when (or (memq parameter speechd--volatile-parameters) (and (not (equal orig-value value)) (or (not (eq parameter 'message-priority)) (not (speechd--connection-forced-priority speechd--current-connection))))) (let ((answer (speechd--call-set-parameter parameter value nil))) (setq speechd--current-connection (speechd--connection)) (when (cl-first answer) (setf (speechd--connection-parameters speechd--current-connection) (plist-put (speechd--connection-parameters speechd--current-connection) parameter value)))) ;; Speech Dispatcher bug work-around (when (eq parameter 'language) (let ((output-module (plist-get (speechd--connection-parameters speechd--current-connection) 'output-module))) (when output-module (speechd--set-connection-parameter 'output-module output-module))))))) (defun speechd--set-parameter (parameter value &optional all) (if all (progn ;; We must iterate clients even on global all, to update speechd-el ;; connection parameters. (speechd--iterate-connections (speechd--set-connection-parameter parameter value)) (when (consp all) (speechd--with-current-connection (speechd--call-set-parameter parameter value t)))) (speechd--with-current-connection (speechd--set-connection-parameter parameter value)))) (defun speechd--set-connection-name (name) (speechd--set-parameter 'client-name (format "%s:%s:%s" (user-login-name) speechd--application-name name))) (defun speechd-set-language (language) "Set language of the current client connection to LANGUAGE. Language must be an RFC 1766 language code, as a string." (interactive (list (read-string "Language: "))) (speechd--set-parameter 'language language)) (defun speechd-set-ssml-mode (value) "Set SSML mode value. SSML is reset to \"off\" when connection is reopened." (speechd--set-parameter 'ssml-mode value)) (defmacro speechd--generate-set-command (parameter prompt argdesc) (let* ((prompt* (concat prompt ": ")) (argdesc* (eval argdesc)) (docstring (format "Set %s of the current connection. VALUE must be %s. If called with a prefix argument, set it for all connections." (downcase prompt) (cond ((integerp argdesc*) "a number between -100 and 100") ((not argdesc*) "a string") ((listp argdesc*) (concat "one of the symbols " (mapconcat #'(lambda (x) (symbol-name (cdr x))) argdesc* ", "))) (t (concat "one of the strings allowed by your " "Speech Dispatcher\ninstallation")))))) `(defun ,(intern (concat "speechd-set-" (symbol-name parameter))) (value &optional all) ,docstring (interactive ,(cond ((integerp argdesc*) (concat "n" prompt* "\nP")) ((not argdesc*) (concat "s" prompt* "\nP")) ((listp argdesc*) `(list (cdr (assoc (completing-read ,prompt* ,argdesc nil t) ,argdesc)) current-prefix-arg)) (t `(list (completing-read ,prompt* (mapcar #'list (speechd--list (quote ,argdesc*)))) current-prefix-arg)))) (when value (speechd--set-parameter (quote ,parameter) value all) (message "%s set to %s." ,prompt value))))) (speechd--generate-set-command capital-character-mode "Capital character mode" speechd--capital-character-modes) (speechd--generate-set-command pitch "Pitch" 0) (speechd--generate-set-command volume "Volume" 0) (speechd--generate-set-command rate "Rate" 0) (speechd--generate-set-command voice "Voice" 'voices) (speechd--generate-set-command synthesizer-voice "Synthesizer voice" 'synthesis-voices) (speechd--generate-set-command punctuation-mode "Punctuation mode" speechd--punctuation-modes) (speechd--generate-set-command pause-context "Pause context" 0) ;; TODO: Remove this one once proper output module setting is defined. (speechd--generate-set-command output-module "Output module" nil) (defun speechd-add-connection-settings (voice) "Add current connection and its settings to `speechd-connection-voices'." (interactive "SNew voice name: ") (if (or (not (assoc voice speechd-voices)) (y-or-n-p "Voice already exists, replace it? ")) (setq ;; the voice speechd-voices (cons (speechd--with-current-connection (cons voice (let ((voice-parameters ()) (connection-parameters (speechd--connection-parameters speechd--current-connection))) (while connection-parameters (cl-destructuring-bind (p v . next) connection-parameters (unless (memq p '(client-name message-priority spelling-mode)) (push (cons (cl-case p (voice 'name) (t p)) (cl-case p (punctuation-mode (cdr (assoc v speechd--punctuation-modes))) (capital-character-mode (cdr (assoc v speechd--capital-character-modes))) (t v))) voice-parameters)) (setq connection-parameters next))) (nreverse voice-parameters)))) (remove (assoc speechd-client-name speechd-voices) speechd-voices)) ;; the connection speechd-connection-voices (cons (cons speechd-client-name voice) (remove (assoc speechd-client-name speechd-connection-voices) speechd-connection-voices))) (message "Settings NOT added"))) ;;; Blocks (defun speechd-block (function &optional parameters) "Call FUNCTION inside an SSIP block. FUNCTION is called without any arguments." (speechd--with-current-connection (let ((%block-connection speechd--current-connection) (nested (and speechd--current-connection (speechd--connection-in-block speechd--current-connection)))) (speechd--with-connection-parameters parameters (let ((speechd-client-name (speechd--connection-name speechd--current-connection))) (unless nested (speechd--send-command '("BLOCK BEGIN")) (when speechd--current-connection (setf (speechd--connection-in-block speechd--current-connection) t))) (unwind-protect (funcall function) (unless nested (let ((speechd--current-connection %block-connection)) (when speechd--current-connection (setf (speechd--connection-in-block speechd--current-connection) nil) (speechd--send-command '("BLOCK END"))))))))))) (defmacro speechd-block* (parameters &rest body) "Set PARAMETERS and enclose BODY by an SSIP block. Before invoking BODY, the BLOCK BEGIN command is sent, and the BLOCK END command is sent afterwards. PARAMETERS is a property list defining parameters to be set before sending the BLOCK BEGIN command. The property-value pairs correspond to the arguments of the `speechd--set-parameter' function." `(speechd-block (lambda () ,@body) ,parameters)) ;;; Speaking functions (defconst speechd--index-mark-prefix "index-") (defvar speechd--markers '()) ; assoc list of (INDEX . MARKER) (defun speechd--ssml (text beg markers) (let ((end (1- (+ beg (length text))))) (dolist (m markers) (cl-destructuring-bind (pos index _marker) m (when (<= beg pos end) (let ((text-pos (- pos beg))) (put-text-property text-pos (1+ text-pos) 'index index text)))))) (setq text (xml-escape-string text)) (let ((pos 0)) (while (setq pos (next-single-property-change pos 'index text)) (let ((mark (format "" speechd--index-mark-prefix (get-text-property pos 'index text)))) (setq text (concat (substring text 0 pos) mark (substring text pos))) (setq pos (+ pos (length mark) 1))))) (concat "" text "")) ;;;###autoload (cl-defun speechd-say-text (text &key (priority speechd-default-text-priority) say-if-empty markers) "Speak the given TEXT, represented by a string. The key argument `priority' defines the priority of the message and must be one of the symbols `important', `message', `text', `notification' or `progress'. The key argument SAY-IF-EMPTY is non-nil, TEXT is sent through SSIP even if it is empty." (interactive "sText: ") (when (or say-if-empty (not (string= text ""))) (cl-flet ((properties (point) (let ((voice (cdr (assq (get-text-property point 'face text) speechd-face-voices))) (language (get-text-property point 'language text))) (append (when (stringp voice) (list 'voice voice)) (when language (list 'language language)) (when (and voice (symbolp voice)) (speechd--voice-parameters voice)))))) (let* ((beg 0) (new-properties (properties beg))) (while beg (let* ((properties new-properties) (change-point beg) (end (progn (while (and (setq change-point (next-property-change change-point text)) (equal properties (setq new-properties (properties change-point))))) change-point)) (substring (substring text beg end))) (when markers (setq speechd--markers (mapcar #'(lambda (m) (cons (format "%s%s" speechd--index-mark-prefix (cl-second m)) (cl-third m))) markers)) (setq substring (speechd--ssml substring beg markers))) (speechd-block* `(message-priority ,priority language ,(speechd--current-language) spelling-mode ,speechd-spell ssml-mode ,(not (null markers)) ,@properties) (speechd--send-text substring)) (setq beg end))))))) (cl-defun speechd-say-sound (name &key (priority speechd-default-sound-priority)) "Ask speechd to play an auditory icon. NAME is the name of the icon, any string acceptable by speechd. The key argument `priority' defines the priority of the message and must be one of the symbols `important', `message', `text', `notification' or `progress'." (speechd--set-parameter 'message-priority priority) (speechd--send-command (list "SOUND_ICON" name))) (cl-defun speechd-say-char (char &key (priority speechd-default-char-priority)) "Speak the given CHAR, any UTF-8 character. The key argument `priority' defines the priority of the message and must be one of the symbols `important', `message', `text', `notification' or `progress'." (speechd--set-parameter 'message-priority priority) (speechd--with-current-connection (speechd--with-connection-parameters `(language ,(speechd--current-language)) (speechd--send-command (list "CHAR" (format "%s" (cl-case char (? "space") (?\n "linefeed") (t (char-to-string char))))))))) (cl-defun speechd-say-key (key &key (priority speechd-default-key-priority)) "Speak the given KEY, represented by a key event. The key argument `priority' defines the priority of the message and must be one of the symbols `important', `message', `text', `notification' or `progress'." (let* ((modifiers (event-modifiers key)) (character (event-basic-type key)) (string (if (numberp character) (cond ((< character 32) (push 'control modifiers) (format "%c" (+ ?a (1- character)))) ((and (>= character 128) (< character 160)) "?") ((= character ? ) "space") ((= character ?_) "underscore") ((= character ?\") "double-quote") ((= character 127) "backspace") (t (format "%c" character))) (format "%s" character)))) (dolist (m modifiers) (setq string (concat (symbol-name m) "_" string))) (speechd--set-parameter 'message-priority priority) (speechd--with-current-connection (speechd--with-connection-parameters `(language ,(speechd--current-language)) (speechd--send-command (list "KEY" (format "%s" string))))))) ;;; Control functions (defun speechd--control-command (command all &optional repeatable) (cond ((not all) (when (or repeatable (not (equal (cl-first (speechd--connection-last-command (speechd--connection))) command))) (speechd--send-command (list command "self")))) ((eq all 'some) (let ((speechd-client-name$ speechd-client-name)) (speechd--iterate-clients (when (or (equal speechd-client-name$ speechd-client-name) (member speechd-client-name speechd-cancelable-connections)) (speechd--control-command command nil repeatable))))) ((numberp all) (speechd--iterate-clients (speechd--control-command command nil repeatable))) (t (speechd--send-command (list command "all"))))) ;;;###autoload (defun speechd-cancel (&optional all) "Stop speaking all the messages sent through the current client so far. If the universal argument is given, stop speaking messages of all clients. If a numeric argument is given, stop speaking messages of all current Emacs session clients. If no argument is given, stop speaking messages of the current client and all the clients of the current Emacs session named in `speechd-cancelable-connections'." (interactive "P") (speechd--control-command "CANCEL" (or all 'some) t)) ;;;###autoload (defun speechd-stop (&optional all) "Stop speaking the currently spoken message (if any) of this client. If the optional argument ALL is non-nil, stop speaking the currently spoken messages of all clients." (interactive "P") (speechd--control-command "STOP" all t)) ;;;###autoload (defun speechd-pause (&optional all) "Pause speaking in the current client. If the optional argument ALL is non-nil, pause speaking in all clients." (interactive "P") (if all (speechd--iterate-connections (setf (speechd--connection-paused-p speechd--current-connection) t)) (speechd--with-current-connection (setf (speechd--connection-paused-p speechd--current-connection) t))) (speechd--control-command "PAUSE" (not (not all)))) ;;;###autoload (defun speechd-resume (&optional all) "Resume previously stopped speaking in the current client. If the optional argument ALL is non-nil, resume speaking messages of all clients." (interactive "P") (speechd--with-current-connection (when (or all (speechd--connection-paused-p speechd--current-connection)) (speechd--control-command "RESUME" (not (not all))) (if all (setf (speechd--connection-paused-p speechd--current-connection) nil) (speechd--iterate-connections (setf (speechd--connection-paused-p speechd--current-connection) nil)))))) ;;;###autoload (defun speechd-repeat () "Repeat the last message sent to speechd." (interactive) (if t (message "Not yet implemented in speechd") (let ((id (car (cl-second (speechd--send-command '("HISTORY" "GET" "LAST")))))) (when id (speechd--send-command (list "HISTORY" "SAY" id)))))) ;;; Announce (provide 'speechd) ;;; speechd.el ends here speechd-el-2.11/speechd-el.cs.texi0000644000175000001440000016173314070023103015456 0ustar pdmusers\chyph \def\fontprefix{cs} \input texinfo @comment %**start of header @setfilename speechd-el.cs.info @documentlanguage cs @documentencoding ISO-8859-2 @set VERSION 1.0 @settitle speechd-el @value{VERSION} @syncodeindex fn cp @syncodeindex ky cp @syncodeindex vr cp @comment %**end of header @copying Český překlad manuálu programu speechd-el, @value{VERSION}. Copyright @copyright{} 2003, 2004 Brailcom, o.p.s. @quotation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License.'' @end quotation You can also (at your option) distribute this manual under the GNU General Public License: @quotation Permission is granted to copy, distribute and/or modify this document 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. A copy of the license is included in the section entitled ``GNU General Public License''. @end quotation @end copying @dircategory Sound @dircategory Emacs @direntry * speechd-el cs: (speechd-el.cs). Emacsové rozhraní ke Speech Dispatcher. @end direntry @titlepage @title speechd-el @subtitle pro verzi @value{VERSION} @author Milan Zamazal @author Brailcom, o.p.s. @page @vskip 0pt plus 1filll @insertcopying @end titlepage @contents @ifnottex @node Top, Úvodem, (dir), (dir) @top speechd-el @insertcopying @end ifnottex @menu * Úvodem:: K@tie{}čemu je speechd-el a tento manuál? * Uživatelská příručka:: Používání řečového výstupu Emacsu. * Elispová knihovna:: Používání speechd-el v elispových programech. * Kontaktní informace:: Oznamování chyb atd. * Kopírování tohoto manuálu:: GNU Free Documentation License. * Index:: Všeobjímající index. @end menu @c **************************************************************************** @node Úvodem, Uživatelská příručka, Top, Top @chapter Úvodem @cindex Speech Dispatcher speechd-el je emacsový klient ke Speech Dispatcher. Poskytuje následující funkce: @itemize @bullet @item @cindex SSIP Elispovou knihovnu pro přístup ke Speech Dispatcher s@tie{}využitím soketové komunikace založené na jeho komunikačním protokolu (SSIP). @item Podporu pro řečový výstup Emacsu, zaměřený zejména na prostředky potřebné pro využívání Emacsu slepými a těžce zrakově postiženými uživateli. @end itemize Klíčové rysy speechd-el jsou: @cindex rysy @itemize @bullet @item Podporu pro automatické mluvení, bez nutnosti úprav každé emacsové funkce, kterou je potřeba rozmluvit. Většina emacsových programů z@tie{}distribuce Emacsu i@tie{}mimo ni získává řečový výstup okamžitě, bez jakékoliv speciální podpory. @item Nejsou prováděny téměř žádné změny standardního chování Emacsu a nedochází ke konfliktům s@tie{}uživatelskými nastaveními. @item Plná spolupráce se Speech Dispatcher. @item Malý rozsah kódu. @end itemize Manuál popisuje řečové uživatelské rozhraní, jak si toto rozhraní přizpůsobit a rozšířit a elispovou knihovnu. Doporučujeme, aby uživatel byl částečně obeznámen se Speech Dispatcher na uživatelské úrovni, ale není to nezbytné. @c **************************************************************************** @node Uživatelská příručka, Elispová knihovna, Úvodem, Top @chapter Uživatelská příručka speechd-el speechd-el umožňuje používat Emacs bez zobrazení na monitoru, pouze jen s@tie{}řečovým výstupem. Hlavní oblast využití je mezi slepci a zrakově postiženými lidmi, nicméně řečový výstup může být užitečný i@tie{}pro celou řadu dalších věcí, podle toho co kdo potřebuje. Nejnovější verzi speechd-el si můžete stáhnout na @url{http://www.freebsoft.org/pub/projects/speechd-el/}. speechd-el používá pro řečový výstup Speech Dispatcher, takže abyste vůbec nějaký řečový výstup slyšeli, potřebujete mít funkční instalaci Speech Dispatcher. Všechny informace o@tie{}Speech Dispatcher naleznete na @url{http://www.freebsoft.org/speechd}. @menu * Instalace:: Jak speechd-el nainstalovat. * Spuštění řečového výstupu:: Jak jej rozmluvit. * Příkazy:: Jak jej používat. * Konfigurace:: Základní konfigurace. * Pokročilá konfigurace:: Psaní vlastních reakcí na příkazy. * Potíže:: Když se speechd-el chová podivně. * Tipy:: Užitečné emacsové tipy. * Oznamování chyb:: Chyby speechd-el a Speech Dispatcher. @end menu @node Instalace, Spuštění řečového výstupu, Uživatelská příručka, Uživatelská příručka @section Instalace speechd-el se nainstaluje následujícími kroky: @enumerate @item Zkopírujte všechny @file{*.el} soubory z@tie{}distribučního balíku někam do emacsových adresářů obsažených v@tie{}cestě vašeho Emacsu. @item Chcete-li, můžete si @file{*.el} soubory zkompilovat. To doporučujeme, protože speechd-el běží se zkompilovanými soubory podstatně rychleji. Kompilaci můžete provést příkazem @example make compile @end example Poté přiinstalujte zkompilované soubory do emacsové cesty ke zdrojovým souborům speechd-el. @item Nainstalujte soubor @file{speechd-log-extractor} do některé z@tie{}cest obsažených v@tie{}shellové proměnné PATH, například do adresáře @file{/usr/local/bin/}. @item Do svého @file{~/.emacs} si přidejte následující řádek: @lisp (autoload 'speechd-speak "speechd-speak" nil t) @end lisp @end enumerate Pro úspěšný provoz speechd-el je nutno mít nainstalované a spuštěné Speech Dispatcher. Doporučená je verze@tie{}0.5 nebo vyšší. @node Spuštění řečového výstupu, Příkazy, Instalace, Uživatelská příručka @section Spuštění řečového výstupu Po instalaci @file{*.el} souborů a restartu Emacsu můžete inicializovat řečový výstup prostřednictvím příkazu @kbd{M-x speechd-speak}. Chcete-li, aby se tak dělo automaticky při každém startu Emacsu, přidejte si do svého @file{~/.emacs} následující řádek, za dříve vložený řádek s@tie{}@code{autoload}: @lisp (speechd-speak) @end lisp @table @kbd @item M-x speechd-speak @findex speechd-speak @kindex C-e C-s Inicializuj Emacs pro řečový výstup a začni mluvit. Prosím nezapomeňte, že abyste něco slyšeli, musíte mít korektně nainstalováno Speech Dispatcher! Po počátečním nastavení může být tento příkaz použit znovu, v@tie{}případě potřeby restartu řečové podpory. Zejména jej musíte spustit pokaždé, když je restartováno Speech Dispatcher. Je-li příkaz zavolán s@tie{}prefixovým argumentem, jsou před jeho provedením nejprve uzavřena všechna spojení na Speech Dispatcher. To je užitečné v@tie{}případě, kdy potřebujete zresetovat parametry všech spojení, viz @ref{Hlasy spojení}. Po svém prvním zavolání se příkaz stane dostupným pod klávesou @kbd{C-e C-s}. @end table @cindex vedlejší módy Poté, co jsou provedena úvodní nastavení, je zapínání a vypínání řečového výstupu řízeno vedlejšími módy speechd-speak a global-speechd-speak. Příkazy pro přepínání módů obvykle nejsou používány přímo, můžete místo nich používat příkaz @code{speechd-speak-toggle-speaking} (@pxref{Řídící příkazy}), ale pokud je potřebujete, jsou k@tie{}dispozici. @table @kbd @item M-x speechd-speak-mode @findex speechd-speak-mode Zapni nebo vypni mluvení v@tie{}aktuálním bufferu. Je-li příkaz zavolán bez prefixového argumentu, přepne mluvící mód. Nenulový prefixový argument zapne mluvení, nulový prefixový argument jej vypne. @item M-x global-speechd-speak-mode @findex global-speechd-speak-mode Zapni nebo vypni mluvení globálně. Je-li příkaz zavolán bez prefixového argumentu, přepne mluvící mód. S@tie{}prefixovým argumentem zapne mluvení právě v@tie{}případě, kdy je tento argument kladný. @end table @node Příkazy, Konfigurace, Spuštění řečového výstupu, Uživatelská příručka @section Příkazy Všechny základní příkazy speechd-el jsou dostupné pod společnou prefixovou klávesou, kterou je implicitně @kbd{C-e} (tuto prefixovou klávesu lze změnit, @pxref{Konfigurace}). Jestliže je prefixová klávesa v@tie{}konfliktu s@tie{}některým globálním příkazem Emacsu, původní příkaz je dostupný dvojím stiskem prefixové klávesy. Například v@tie{}případě implicitního prefixu lze příkaz @code{end-of-line}, normálně dostupný pod klávesou @kbd{C-e}, vyvolat klávesovou kombinací @kbd{C-e C-e}. @menu * Příkazy pro čtení:: Čtení částí textu. * Informující příkazy:: Informace o bufferu, módech, apod. * Řídící příkazy:: Přerušení, nastavení rychlosti, apod. * Příkazy nastavující parametry:: Modifikace řečového výstupu. * Hláskování:: Jak hláskovat určitý text. * Ostatní příkazy:: Pomocné příkazy. @end menu @node Příkazy pro čtení, Informující příkazy, Příkazy, Příkazy @subsection Příkazy pro čtení @table @kbd @item C-e l @kindex C-e l @findex speechd-speak-read-line Přečti aktuální řádek (@code{speechd-speak-read-line}). S@tie{}prefixovým argumentem přečti řádek jen od aktuální pozice kurzoru do konce řádku. @item C-e b @kindex C-e b @findex speechd-speak-read-buffer Přečti aktuální buffer (@code{speechd-speak-read-buffer}). @item C-e > @kindex C-e > @findex speechd-speak-read-rest-of-buffer Přečti aktuální buffer od pozice kurzoru do konce bufferu (@code{speechd-speak-read-rest-of-buffer}). @item C-e o @kindex C-e o @findex speechd-speak-read-other-window Přečti buffer v@tie{}jiném okně, je-li nějaké jiné okno otevřené (@code{speechd-speak-read-other-window}). @item C-e r @kindex C-e r @findex speechd-speak-read-region Přečti aktuální oblast (@code{speechd-speak-read-region}). @item C-e C-r @kindex C-e C-r @findex speechd-speak-read-rectangle Přečti text v@tie{}obdélníkové oblasti (@code{speechd-speak-read-rectangle}). @item C-e w @kindex C-e w @findex speechd-speak-read-word Přečti nejbližší slovo za kurzorem (@code{speechd-speak-read-word}). @item C-e . @kindex C-e . @findex speechd-speak-read-sentence Přečti aktuální větu (@code{speechd-speak-read-sentence}). @item C-e @{ @kindex C-e @{ @findex speechd-speak-read-paragraph Přečti nejbližší odstavec za kurzorem (@code{speechd-speak-read-paragraph}). @item C-e [ @kindex C-e [ @findex speechd-speak-read-page Přečti nejbližší stránku za kurzorem (@code{speechd-speak-read-page}). @item C-e ' @kindex C-e ' @findex speechd-speak-read-sexp Přečti nejbližší symbolický výraz za kurzorem (@code{speechd-speak-read-sexp}). @item C-e c @kindex C-e c @findex speechd-speak-read-char Přečti znak na pozici kurzoru (@code{speechd-speak-read-char}). @item C-e C-n @kindex C-e C-n @findex speechd-speak-read-next-line Přečti následující řádek (@code{speechd-speak-read-next-line}). @item C-e C-p @kindex C-e C-p @findex speechd-speak-read-previous-line Přečti předchozí řádek (@code{speechd-speak-read-previous-line}). @item C-e m @kindex C-e m @findex speechd-speak-last-message Přečti poslední zobrazené hlášení Emacsu (@code{speechd-speak-last-message}). @item C-e RET @cindex mode line @kindex C-e RET @findex speechd-speak-read-mode-line Přečti mode line (@code{speechd-speak-read-mode-line}). Poznámka: Tento příkaz funguje jen v@tie{}Emacsu verze 21.4 nebo vyšší. @item C-e i @kindex C-e i @findex speechd-speak-last-insertions Přečti poslední přečtený vložený text (@code{speechd-speak-last-insertions}). To znamená text přečtený v@tie{}automaticky mluvících bufferech, viz @xref{Automatické mluvení bufferů}. @end table @cindex prompty požadující znak @cindex read-char Některé příkazy Emacsu vypisují prompt, po kterém čekají na zadaný znak. Typickým příkladem je příkaz @code{ispell-word}. Pokud zmeškáte předtím přečtený text, můžete pro jeho zopakování použít ve znakovém promptu následující klávesové příkazy: @table @kbd @item C-e @findex speechd-speak-last-message Ten samý příkaz jako @kbd{C-e m} výše (@code{speechd-speak-last-message}). @item C-a @findex speechd-speak-last-insertions Ten samý příkaz jako @kbd{C-e i} výše (@code{speechd-speak-last-insertions}). @end table Pokud se vám takové chování znakového promptu nezamlouvá, můžete jej deaktivovat pomocí následující proměnné: @vtable @code @item speechd-speak-allow-prompt-commands Je-li hodnotou proměnné něco jiného než @code{nil}, povol ve znakových promptech výše uvedené klávesové příkazy. @end vtable @node Informující příkazy, Řídící příkazy, Příkazy pro čtení, Příkazy @subsection Informující příkazy @table @kbd @item C-e C-i b @findex speechd-speak-buffer-info @cindex buffer Přečti informace o@tie{}aktuálním bufferu (@code{speechd-speak-buffer-info}). @item C-e C-i f @findex speechd-speak-frame-info @cindex frame Přečti informace o@tie{}aktuálním frame (@code{speechd-speak-frame-info}). @item C-e C-i h @findex speechd-speak-header-line-info @cindex header line Přečti obsah header line (@code{speechd-speak-header-line-info}). Poznámka: Tento příkaz funguje jen v@tie{}Emacsu verze 21.4 nebo vyšší. @item C-e C-i m @findex speechd-speak-mode-info @cindex módy Přečti informace o@tie{}aktuálním hlavním a vedlejším módu (@code{speechd-speak-mode-info}). @item C-e C-i c @findex speechd-speak-coding-info @cindex systémy kódování Přečti informaci o@tie{}aktuálním systému kódování (@code{speechd-speak-coding-info}). @item C-e C-i i @findex speechd-speak-input-method-info @cindex vstupní metoda Přečti informaci o@tie{}aktuální vstupní metodě (@code{speechd-speak-input-method-info}). @item C-e C-i p @findex speechd-speak-process-info @cindex proces Přečti stav procesu asociovaného s@tie{}aktuálním bufferem (@code{speechd-speak-process-info}). @end table @node Řídící příkazy, Příkazy nastavující parametry, Informující příkazy, Příkazy @subsection Řídící příkazy @table @kbd @item C-e q @kindex C-e q @findex speechd-speak-toggle-speaking @cindex ztišení Globálně přepni mluvení (@code{speechd-speak-toggle-speaking}). Při vyvolání s@tie{}prefixovým argumentem přepni mluvení pouze v@tie{}aktuálním bufferu. @item C-e s @kindex C-e s @findex speechd-stop @cindex zastavení Zastav mluvení aktuální zprávy (@code{speechd-stop}). Ostatní zprávy ve frontě Speech Dispatcher budou normálně přemluveny. Je-li příkaz vyvolán s@tie{}prefixovým argumentem, zastav mluvení aktuální zprávy u@tie{}všech klientů, nejen aktuálního spojení. @item C-e x @kindex C-e x @findex speechd-cancel @cindex zastavení Zastav mluvení všech zpráv ve frontě aktuálního spojení. Je-li příkaz vyvolán s@tie{}univerzálním prefixovým argumentem, zastav čtení všech zpráv ve všech spojeních. Je-li příkaz vyvolán s@tie{}číselným prefixovým argumentem, zastav mluvení všech zpráv v@tie{}Emacsu, ve kterém byl příkaz vyvolán. @item C-e p @kindex C-e p @findex speechd-pause @cindex přerušení Přeruš mluvení --- prozatím ztichni a odlož mluvení aktuální zprávy až do vyvolání příkazu pokračování v@tie{}mluvení (@code{speechd-pause}). Je-li příkaz vyvolán s@tie{}prefixovým argumentem, přeruš mluvení u@tie{}všech klientů. @item C-e SPC @kindex C-e SPC @findex speechd-resume @cindex pokračování Pokračuj v@tie{}pozastaveném mluvení (@code{speechd-resume}). Je-li příkaz vyvolán s@tie{}prefixovým argumentem, pokračuj v@tie{}mluvení u@tie{}všech klientů. @item C-e 1 @itemx C-e 2 @itemx C-e 3 @itemx C-e 4 @itemx C-e 5 @itemx C-e 6 @itemx C-e 7 @itemx C-e 8 @itemx C-e 9 @kindex C-e 1 @kindex C-e 2 @kindex C-e 3 @kindex C-e 4 @kindex C-e 5 @kindex C-e 6 @kindex C-e 7 @kindex C-e 8 @kindex C-e 9 @findex speechd-speak-key-set-predefined-rate @cindex rychlost Nastav jednu z@tie{}přednastavených rychlostí mluvení (@code{speechd-speak-key-set-predefined-rate}). @kbd{C-e 1} nastaví nejnižší rychlost, @kbd{C-e 5} nastaví střední rychlost a @kbd{C-e 9} nastaví nejvyšší rychlost. @end table @node Příkazy nastavující parametry, Hláskování, Řídící příkazy, Příkazy @subsection Příkazy pro nastavení parametrů @cindex parametry Tyto příkazy nastavují různé vlastnosti řečového výstupu. Všechny jsou aplikovány pouze na aktuální spojení do Speech Dispatcher (více informací o@tie{}spojeních do Speech Dispatcher naleznete v@tie{}@pxref{Hlasy spojení}), pokud nejsou vyvolány s@tie{}prefixovým argumentem. Při vyvolání s@tie{}číselným prefixovým argumentem jsou aplikovány na všechna spojení speechd-el, při vyvolání s@tie{}univerzálním prefixovým argumentem jsou aplikována na všechna spojení Speech Dispatcher. Chcete-li si pro konkrétní buffer vytvořit zvláštní spojení, které má své vlastní parametry, můžete tak učinit následujícím příkazem: @table @kbd @item C-e C-c @kindex C-e C-c @findex speechd-speak-new-connection @cindex spojení Nastav pro aktuální buffer dané spojení (@code{speechd-speak-new-connection}). Příkaz se zeptá na jméno spojení, můžete zadat buď nové jméno, nebo jméno již existujícího spojení. Při obyčejném vyvolání příkazu je vám nabídnuto nově vygenerované jméno spojení, zatímco při vyvolání příkazu s@tie{}prefixovým argumentem si můžete vybrat z@tie{}nabídnutých jmen existujících spojení. @end table Příkazy ovlivňující základní parametry převodu textu na řeč: @table @kbd @item C-e d l @kindex C-e d l @findex speechd-set-language @cindex jazyk Nastav jazyk spojení. Zadejte jej jako kód jazyka dle ISO 639. @item C-e d . @kindex C-e d . @findex speechd-set-punctuation-mode @cindex interpunkce Urči, jak zpracovávat interpunkci, zda ji číst či ignorovat. @code{all} znamená číst všechny interpunkční znaky, @code{none} je všechny přeskakuje a @code{some} čte zadanou podmnožinu interpunkčních znaků zadaných v@tie{}konfiguraci Speech Dispatcher. @item C-e d c @kindex C-e d c @findex speechd-set-capital-character-mode @cindex velká písmena Nastav mód signalizace velkých písmen. @code{icon} znamená signalizaci zvukovou ikonou, @code{spell} znamená jejich hláskování prostřednictvím speciální hláskovací tabulky a @code{none} znamená, že velká písmena nejsou nijak zvlášť signalizována. @end table Příkazy ovlivňující vlastnosti řečového výstupu: @table @kbd @item C-e d v @kindex C-e d v @findex speechd-set-voice @cindex hlas Nastav implicitní hlas, který má syntetizér používat (@code{speechd-set-voice}). Můžete si vybrat některý z@tie{}množiny hlasů nabízených ve vaší instalaci Speech Dispatcher. @item C-e d r @kindex C-e d r @findex speechd-set-rate @cindex rychlost Nastav rychlost čtení, v@tie{}rozmezí od -100 (nejpomalejší) po 100 (nejrychlejší) (@code{speechd-set-rate}). Často asi budete raději používat příkaz @code{speechd-speak-key-set-predefined-rate}, dostupný na klávese @kbd{C-e @var{number}}, viz @ref{Řídící příkazy}. @item C-e d p @kindex C-e d p @findex speechd-set-pitch @cindex výška Nastav výšku hlasu, v@tie{}rozmezí od -100 (nejnižší) po 100 (nejvyšší) (@code{speechd-set-pitch}). @item C-e d V @kindex C-e d V @findex speechd-set-volume @cindex hlasitost Nastav hlasitost hlasu, v@tie{}rozmezí od -100 (nejnižší) po 100 (nejvyšší) (@code{speechd-set-volume}). @end table Příkazy ovlivňující řečový syntetizér: @table @kbd @item C-e d o @kindex C-e d o @findex speechd-set-output-module @cindex výstupní modul Přepni Speech Dispatcher na zadaný výstupní modul (@code{speechd-set-output-module}). Příkaz se dotazuje na jméno žádaného výstupního modulu. @end table @node Hláskování, Ostatní příkazy, Příkazy nastavující parametry, Příkazy @subsection Hláskování @cindex hláskování @cindex speechd-speak-spell-mode Hláskovat lze ve speechd-el dvěma způsoby. Prvním je zapnout pro daný buffer vedlejší mód @code{speechd-speak-spell-mode}. Tento mód je užitečný, pokud chcete hláskovat větší množství textu v@tie{}bufferu. Druhým způsobem hláskování je využití následujícího příkazu: @table @kbd @item C-e C-l @kindex C-e C-l @findex speechd-speak-spell Přinuť následující příkaz hláskovat jím čtený text (@code{speechd-speak-spell}). Například pokud chcete hláskovat slovo za kurzorem, můžete použít klávesový příkaz @kbd{C-e C-l C-e w}. @end table @node Ostatní příkazy, , Hláskování, Příkazy @subsection Ostatní příkazy @kindex C-x C-c V@tie{}případě, že se Emacs úplně zblázní a odmítá kvůli chybě speechd-el nebo uživatelské definici související s@tie{}řečovým výstupem provádět jakékoliv příkazy včetně @kbd{C-x C-c}, můžete jako poslední pokus o@tie{}pomoc vyzkoušet následující příkaz: @table @kbd @item C-e C-x @kindex C-e C-x @findex speechd-unspeak @cindex vzpamatování se Pokus se deaktivovat všechny módy, háčky a obálky instalované příkazem @code{speechd-speak} (@code{speechd-unspeak}). @end table Následující příkazy jsou používány jen velmi zřídka, povětšinou pro ladící účely: @table @kbd @item C-e z @kindex C-e z @findex speechd-repeat Zopakuj poslední text odeslaný do Speech Dispatcher (@code{speechd-repeat}). @item M-x speechd-say-text @findex speechd-say-text Zeptej se na text a přemluv jej. @end table @node Konfigurace, Pokročilá konfigurace, Příkazy, Uživatelská příručka @section Konfigurace @menu * Konfigurace serveru:: Kam se připojit. * Implicitní priority:: Priority různých druhů zpráv. * Základní mluvení:: Jednoduché volby. * Automatické mluvení bufferů:: Jak některé buffery rozmluvit ihned. * Oznamování stavu:: Přeříkávání změn stavu Emacsu. * Signalizace:: Signalizace prázdných zpráv, apod. * Vlastnosti textu:: Podpora faces a zvláštních částí textu. * Jazyky:: Používání více jazyků. * Hlasy:: Definice různých hlasů. * Hlasy spojení:: Nastavování parametrů spojení. * Více spojení:: Odlišné parametry pro některé módy a buffery. * Klávesy:: Přizpůsobení příkazových kláves. * Módy:: Háčky vedlejších módů. * Debugger:: Potlačení mluvení v@tie{}debuggeru. @end menu @node Konfigurace serveru, Implicitní priority, Konfigurace, Konfigurace @subsection Konfigurace spojení na Speech Dispatcher server Nastavení těchto proměnných umožňuje se připojit na Speech Dispatcher běžící na vzdáleném stroji nebo nestandardním portu. @vtable @code @item speechd-host @cindex server Jméno serveru, na kterém běží Speech Dispatcher, ke kterému se chcete připojit, zadané jako řetězec. Implicitní hodnotou je hodnota shellové proměnné @code{SPEECHD_HOST}, pokud je nastavena, jinak @code{"localhost"}. @item speechd-port @cindex port Číslo portu, na který se chcete připojit. Implicitní hodnotou je hodnota shellové proměnné @code{SPEECHD_PORT}, pokud je nastavena, jinak obvyklé číslo portu Speech Dispatcher. @item speechd-timeout @cindex timeout Maximální počet sekund, po které se má čekat na odpověď od Speech Dispatcher. Je-li tento čas překročen, speechd-el uzavře příslušné spojení. Za normálních okolností by Speech Dispatcher mělo odpovídat na příkazu protokolu okamžitě, avšak pokud se připojujete na Speech Dispatcher nějakým zvláštním způsobem po pomalé síti, můžete potřebovat tento limit zvýšit. @end vtable @node Implicitní priority, Základní mluvení, Konfigurace serveru, Konfigurace @subsection Implicitní priority @cindex priority Pošle-li nějaká funkce speechd-el na Speech Dispatcher zprávu bez explicitně specifikované priority dané zprávy, přiřadí se zprávě priorita dle obsahu níže uvedených proměnných. Změnou jejich hodnot můžete dosáhnout zajímavých efektů. Například změnou hodnoty proměnné @code{speechd-default-key-priority} z@tie{}@code{notification} na @code{message} zařídíte, že všechny napsané znaky budou řečeny a budou přerušovat obvyklé čtení textů. Všechny tyto proměnné mohou nabývat některé z@tie{}následujících hodnot: @code{important}, @code{message}, @code{text}, @code{notification}, @code{progress}. Tyto hodnoty odpovídají prioritám Speech Dispatcher, více podrobností naleznete v@tie{}manuálu Speech Dispatcher. @vtable @code @item speechd-default-text-priority Implicitní priorita většiny textových zpráv. @item speechd-default-sound-priority Implicitní priorita zvukových ikon. @item speechd-default-char-priority Implicitní priorita hláskovaných znaků. @item speechd-default-key-priority Implicitní priorita znaků napsaných na klávesnici. @end vtable @node Základní mluvení, Automatické mluvení bufferů, Implicitní priority, Konfigurace @subsection Základní konfigurace mluvení @vtable @code @item speechd-speak-deleted-char @cindex mazání Určuje, který znak má být přečten při mazání znaku. Je-li hodnotou něco jiného než @code{nil}, přečti smazaný znak, jinak přečti sousední znak. @item speechd-speak-buffer-name @cindex buffery Přepínáte-li se do jiného bufferu a hodnotou této proměnné je něco jiného než @code{nil}, je přečteno jméno nového bufferu. Je-li hodnotou proměnné symbol @code{text}, čte se kromě jména bufferu ještě text jeho řádku od pozice kurzoru do konce řádku. Je-li hodnotou proměnné @code{nil}, je přečten jen text, beze jména bufferu. @item speechd-speak-whole-line @cindex čtení řádků Je-li hodnotou proměnné něco jiného než @code{nil}, čti při přesunu na jinou pozici celý řádek. Jinak čti řádek jen od pozice kurzoru do konce řádku. @item speechd-speak-on-minibuffer-exit @cindex minibuffer Je-li hodnotou proměnné něco jiného než @code{nil}, speechd-el čte po návratu z@tie{}minibufferu nebo rekurzivní editační úrovně text okolo kurzoru, není-li ke čtení nic lepšího. @item speechd-speak-read-command-keys @cindex příkazové klávesy @cindex klávesy Tato proměnná definuje, v@tie{}jakých situacích jsou čteny příkazové klávesy aktuálního příkazu. Je-li hodnotou proměnné @code{t}, příkazové klávesy jsou čteny vždy. Je-li hodnotou proměnné @code{nil}, nejsou čteny nikdy. Je-li hodnotou proměnné seznam, může obsahovat jeden nebo více z@tie{}následujících symbolů identifikujících situace, za kterých mají být klávesy příkazu přečteny: @table @code @item movement Přečti příkazové klávesy, jestliže došlo k@tie{}přesunu kurzoru, ale nebyl modifikován obsah bufferu. @item modification Byl modifikován obsah bufferu, nedošlo k@tie{}přesunu kurzoru. @item movement-modification Byl modifikován obsah bufferu a došlo k@tie{}přesunu kurzoru. @end table Je-li hodnotou proměnné @code{t}, příkazové klávesy jsou čteny před provedením příkazu. Jinak jsou přeříkány až po provedení příkazu, protože je třeba nejprve zjistit, zda došlo k@tie{}modifikaci obsahu bufferu a přesunu kurzoru. @item speechd-speak-ignore-command-keys @cindex příkazové klávesy @cindex klávesy Seznam příkazů, u@tie{}nichž nemají být příkazové klávesy nikdy čteny. @item speechd-speak-read-command-name @cindex jméno příkazu Je-li hodnotou něco jiného než @code{nil}, čti v@tie{}situacích definovaných proměnnou @code{speechd-speak-read-command-keys} místo kláves příkazu jeho jméno. @item speechd-speak-message-time-interval @cindex hlášení @cindex opakování Minimální počet vteřin, po kterých smí být hlášení zopakováno. Je-li aktuální hlášení stejné jako hlášení předchozí, není přeříkáno, pokud neuplynul aspoň zde definovaný čas od posledního přeříkaného hlášení. @end vtable @node Automatické mluvení bufferů, Oznamování stavu, Základní mluvení, Konfigurace @subsection Automatické mluvení bufferů @cindex buffery @cindex vkládaný text Někdy je užitečné začít přemlouvat obsah bufferu i@tie{}bez explicitního požadavku uživatele. Například je-li vyvolán příkaz nápovědy, uživatel si obvykle chce ihned poté přečíst její text. Následující proměnné definují seznam jmen bufferů, které mají být automaticky přemluveny, jestliže jsou viditelné v@tie{}některém z@tie{}oken aktuálního rámce a jejich obsah byl během posledního uživatelského příkazu změněn. @vtable @code @item speechd-speak-auto-speak-buffers Obsah těchto bufferů je přemluven za výše uvedených podmínek po provedení příkazu, jestliže není k@tie{}přemluvení nic jiného (například pod kurzorem při přesunu kurzoru na jinou pozici). @item speechd-speak-force-auto-speak-buffers Stejné jako @code{speechd-speak-auto-speak-buffers} až na to, že obsah bufferu je přemluven vynuceně, i@tie{}když by mohlo být přemluveno něco jiného. @end vtable Následující proměnné určují, jak nakládat s@tie{}texty vloženými během provádění uživatelských příkazů. Týkají se pouze nově vložených textů, neovlivňují zpracování smazaných textů. Navíc tyto volby neovlivňují texty vložené během provádění příkazů, které speechd-el anebo uživatelské definice zpracovávají speciálním způsobem, jako je například případ příkazu @code{self-insert-command}. @vtable @code @item speechd-speak-buffer-insertions Určuje, zda má být automaticky čten text vkládaný v@tie{}aktuálním bufferu. Hodnotou proměnné může být některý z@tie{}následujících symbolů: @table @code @item nil Nečti žádné vložené texty. @item t Čti všechny vložené texty. @item one-line Čti pouze první řádky vložených textů. @item whole-buffer Pokud byl buffer jakkoliv modifikován, přečti jej celý. @end table @item speechd-speak-insertions-in-buffers Seznam jmen bufferů, ve kterých jsou vkládané texty čteny automaticky, bez ohledu na to, zda jde o@tie{}aktuální buffer a bez ohledu na hodnotu proměnné @code{speechd-speak-buffer-insertions}. @item speechd-speak-priority-insertions-in-buffers Seznam jmen bufferů, ve kterých jsou vkládané texty čteny automaticky okamžitě po svém vložení, ne až po dokončení prováděného příkazu, jako je tomu v@tie{}případě proměnné @code{speechd-speak-insertions-in-buffers}. Tato vlastnost je typicky užitečná v@tie{}comint bufferech. @item speechd-speak-align-buffer-insertions Je-li hodnotou proměnné něco jiného než @code{nil}, je vkládaný text před svým přečtením rozšířen k@tie{}začátku prvního slova, které je alespoň zčásti obsaženo ve vloženém textu. To je užitečné zejména v@tie{}případě doplňovacích funkcí. @end vtable Jestliže příkaz modifikoval aktuální buffer a přesunul kurzor na úplně jinou pozici, nová pozice kurzoru není v@tie{}řečovém výstupu nijak vyznačena. To lze změnit prostřednictvím následující proměnné: @vtable @code @item speechd-speak-movement-on-insertions Je-li hodnotou proměnné @code{t}, přečti text okolo nové pozice kurzoru, i@tie{}když byl aktuální buffer modifikován. Je-li hodnotou proměnné @code{read-only}, čti jej jen v@tie{}read-only bufferech. Je-li hodnotou @code{nil}, nečti jej. @end vtable @node Oznamování stavu, Signalizace, Automatické mluvení bufferů, Konfigurace @subsection Oznamování změn stavu speechd-el může číst informaci o@tie{}aktuálním stavu Emacsu, jako jméno aktuálního bufferu, hlavní a vedlejší módy nebo jiné atributy bufferu, viz @xref{Informující příkazy}. Změny stavu Emacsu mohou být oznamovány automaticky, v@tie{}závislosti na uživatelské konfiguraci: @vtable @code @item speechd-speak-state-changes Seznam identifikátorů změn stavu Emacsu, které mají být automaticky oznamovány. Jako identifikátory změny stavu lze použít následující symboly: @table @code @item buffer-name @item buffer-identification (jen v@tie{}Emacsu 21.4 nebo vyšším) @item buffer-modified @item buffer-read-only @item frame-name @item frame-identification (jen v@tie{}Emacsu 21.4 nebo vyšším) @item header-line (jen v@tie{}Emacsu 21.4 nebo vyšším) @item major-mode @item minor-modes @item buffer-file-coding @item terminal-coding @item input-method @item process @end table @item speechd-speak-display-modes Seznam vedlejších módů, u@tie{}nichž je místo jejich jména přeříkáván jejich zobrazený řetězec. To může být užitečné v@tie{}případech, kdy je zobrazený řetězec stručnější než jméno módu nebo když je zobrazený řetězec změněn, aniž by byl změněn samotný mód. @end vtable @node Signalizace, Vlastnosti textu, Oznamování stavu, Konfigurace @subsection Signalizace Některé situace mohou být signalizovány zvukovými ikonami. Následující proměnná zapíná nebo vypíná předdefinované signalizace. O@tie{}tom, jak si definovat vlastní signalizace, se můžete dočíst v@tie{}sekci @ref{Pokročilá konfigurace}. @vtable @code @item speechd-speak-signal-events Seznam symbolů, obsahující jména událostí, které mají být signalizovány zvukovou ikonou. Podporována jsou následující jména událostí: @table @code @item start Start nebo restart speechd-el. @item empty @cindex prázdný text Prázdný text v@tie{}různých situacích. @item beginning-of-line @cindex řádek @cindex začátek řádku Dosažení začátku řádku po příkazech @code{forward-char} a @code{backward-char}. @item end-of-line @cindex konec řádku Dosažení konce řádku po příkazech @code{forward-char} a @code{backward-char}. @item minibuffer Vstup do minibufferu. @item message Následují hlášení v@tie{}echo area. @end table @end vtable @node Vlastnosti textu, Jazyky, Signalizace, Konfigurace @subsection Vlastnosti textu @cindex vlastnosti textu @cindex faces @cindex kurzor @cindex pohyb Implicitní chování speechd-el je takové, že po příkazu, který způsobí přesun kurzoru na jinou pozici, přečte aktuální řádek. Pokud je však pozice kurzoru obklopena textem, který má nějaké vlastnosti (text properties), typicky face, ale může jít o@tie{}jakékoliv jiné vlastnosti, speechd-el dovede přečíst pouze tu část textu pod kurzorem, která má shodné vlastnosti. Pokud je navíc zapnut font lock mód, faces mohou být mapovány na různé hlasy. @vtable @code @item speechd-speak-by-properties-on-movement Metoda výběru části textu, která má být přečtena po přesunu kurzoru. Proměnná může nabývat některé z@tie{}následujících hodnot: @table @asis @item @code{nil} Vlastnosti textu (text properties) nejsou nijak zohledňovány. @item @code{t} Jsou zohledňovány všechny vlastnosti textu. @item seznam faces Z@tie{}vlastností textu jsou zohledňována pouze daná faces. @end table @item speechd-speak-by-properties-always Seznam příkazů, které vždy zohledňují vlastnosti textu, a@tie{}to i@tie{}v@tie{}případě že hodnota proměnné @code{speechd-speak-by-properties-on-movement} je @code{nil}. @item speechd-speak-by-properties-never Seznam příkazů, které nikdy nezohledňují vlastnosti textu, a@tie{}to ani v@tie{}případě že hodnota proměnné @code{speechd-speak-by-properties-on-movement} není @code{nil}. @item speechd-speak-faces Tato proměnná umožňuje zajistit vyvolání akcí v@tie{}případě, kdy kurzor po provedení uživatelského příkazu skončí na určitém face. Hodnotou proměnné je asociativní seznam s@tie{}prvky tvaru @code{(@var{face} . @var{akce})}. Jestliže příkaz přesouvající kurzor zanechá kurzor na @var{face} a na příkaz není explicitně navěšeno žádné mluvení, je vyvolána @var{akce}. Je-li @code{akce} řetězcem, je tento řetězec přemluven. Je-li @code{akce} funkcí, je tato funkce zavolána, bez argumentů. @item speechd-face-voices Mapování faces na hlasy. Hodnotou proměnné je asociativní seznam s@tie{}prvky tvaru @code{(@var{face} . @var{hlas})}, kde @var{face} je face a @var{hlas} je jméno hlasu definované v@tie{}proměnné @code{speechd-voices}, viz @xref{Hlasy}. Každé face je přemluveno odpovídajícím hlasem. Pokud pro nějaké face není hlas v@tie{}této proměnné definovat, je toto face přemluveno aktuálním hlasem. Pozor, toto mapování se uplatní jen tehdy, je-li zapnut font lock mód. @end vtable @node Jazyky, Hlasy, Vlastnosti textu, Konfigurace @subsection Používání více jazyků @cindex jazyky speechd-el je možno používat s@tie{}vícero jazyky. Nicméně proces volby jazyka nemůže být snadno automatizováno, protože běžný text neobsahuje žádnou informaci o@tie{}svém jazyce. Takže pokud chcete používat speechd-el s@tie{}výstupem ve více jazycích, musíte speechd-el napovídat. @vindex speechd-language @cindex RFC 1766 Základním prostředkem pro sdělení informace o@tie{}aktuálním jazyku je proměnná @code{speechd-language}. Pokaždé, když chce speechd-el říct nějaký text, podívá se na tuto proměnnou, zda neobsahuje kód jazyka. Pokud její hodnota není @code{nil}, musí to být řetězec obsahující kód jazyka dle RFC@tie{}1766 a speechd-el přečte text v@tie{}odpovídajícím jazyce. Většinou asi budete chtít nastavit tuto proměnnou v@tie{}konkrétním souboru, viz @ref{File Variables,,,emacs,GNU Emacs Manual}, nebo jako lokální proměnnou bufferu, viz @ref{Locals,,,emacs,GNU Emacs Manual}, v@tie{}různých mode hooks, see @ref{Hooks,,,emacs,GNU Emacs Manual}. @findex speechd-language @cindex text property @code{language} Pokud má text vlastnost (property) @code{language} obsahující kód jazyka dle RFC@tie{}1766, je přemluven v@tie{}odpovídajícím jazyce bez ohledu na všechna ostatní nastavení. K@tie{}dispozici je funkce @code{speechd-language}, která v@tie{}elispových programech umístí tuto textovou vlastnost na řetězec. Jinou dobrou cestou, jak používat více jazyků, je používat více spojení pro oddělení jazykově závislých bufferů nebo módů, viz @ref{Více spojení}, a nastavit pro každé z@tie{}těchto spojení parametr @code{language}, viz @ref{Hlasy spojení}. Pokud už není možná žádná lepší cesta, je možné jazyky nastavovat podle aktuální vstupní metody: @vtable @code @item speechd-speak-input-method-languages Asociativní seznam mapující vstupní metody na jazyky. Každý z@tie{}prvků seznamu má podobu @code{(@var{input-method-name} . @var{language})}, kde @var{input-method-name} je jméno metody jako řetězec a @var{language} je ISO kód jazyka akceptovaný SSIP. Jestliže je aktuální vstupní metoda v@tie{}seznamu přítomna, je vybrán odpovídající jazyk, není-li přebit jiným nastavením. @end vtable @node Hlasy, Hlasy spojení, Jazyky, Konfigurace @subsection Definice hlasů @cindex parametry Ve speechd-el lze definovat speciální hlasy, které pak mohou být využívány v@tie{}různých situacích, například pro přemlouvání různých faces různými hlasy (@pxref{Vlastnosti textu}) nebo pro nastavení různých režimů čtení interpunkce pro různé druhy bufferů (@pxref{Více spojení}). Hlasy ve speechd-el neurčují jen základní charakteristiku hlasu, ale také vlastnosti řeči jako výšku či rychlost a zvláštní vlastnosti jako režim čtení interpunkce nebo signalizaci velkých písmen. Definice hlasů je obsažena v@tie{}následující proměnné: @vtable @code @item speechd-voices Asociativní seznam identifikátorů hlasů a jejich parametrů. Každý prvek seznamu má podobu @code{(@var{voice-id} . @var{parameters})}, kde @var{voice-id} je symbo, pod kterým bude hlas dostupný a @var{parameters} je asociativní seznam identifikátorů parametrů a jejich hodnot. Přípustná jména parametrů jsou následující symboly: @code{language}, @code{gender}, @code{age}, @code{style}, @code{name}, @code{rate}, @code{pitch}, @code{volume}, @code{punctuation-mode}, @code{capital-character-mode}, @code{message-priority}, @code{output-module}. @code{name} je řetězec identifikující jméno hlasu Speech Dispatcher. Není-li uveden, pak jsou pro volbu hlasu rozhodující parametry @code{gender}, @code{age} a @code{style}. @code{gender} může být jeden ze symbolů @code{male}, @code{female}, @code{neutral}. @code{age} může být jeden ze symbolů @code{middle-adult}, @code{child}. @code{neutral}. @code{style} může být jedno z@tie{}čísel @code{1}, @code{2}, @code{3} (hodnoty parametru @code{style} se v@tie{}budoucnu pravděpodobně změní). Parametr @code{message-priority} nastavuje prioritu všech zpráv říkaných daných hlasem. Jeho hodnotou může být kterýkoliv ze symbolů identifikujících prioritu zprávy. Pro povolené hodnoty ostatních parametrů viz odpovídající @code{speechd-set-*} funkce. Hlas pojmenovaný @code{nil} je zvláštní, definuje implicitní hlas. Explicitní definice jeho parametrů je nepovinná. @end vtable @node Hlasy spojení, Více spojení, Hlasy, Konfigurace @subsection Hlasy spojení @cindex hlasy S@tie{}pomocí následující proměnné si můžete nechat automaticky nastavit různé parametry spojení, jako rychlost řeči, jazyk, atd. speechd-el může mít na Speech Dispatcher otevřeno více spojení, definovaných dle různých kritérií (@pxref{Více spojení}). Různým spojením pak můžete nastavit různé parametry, v@tie{}závislosti na jménu spojení, a@tie{}můžete také nastavit implicitní parametry společné pro všechna spojení. @vtable @code @item speechd-connection-parameters Asociativní seznam jmen spojení a odpovídajících hlasů. Každý prvek seznam má podobu @code{(@var{connection-name} . @var{voice})}, kde @var{connection-name} je jméno spojení ve formě řetězce a @var{voice} je identifikátor hlasu definovaného v@tie{}proměnné @code{speechd-voices}. Pro spojení, která nejsou v@tie{}této proměnné definována se používá implicitní hlas, jehož jméno je @code{nil}. @end vtable Aby se nastavení hodnoty této proměnné plně projevilo, musí být otevřená spojení znovuotevřena. Nepoužíváte-li konfigurační rozhraní Emacsu (customize), musíte pro zajištění znovuotevření spojení zavolat příkaz @kbd{C-u M-x speechd-speak}. Jako malou pomůcku pro nastavení hlasu spojení a jeho parametrů je možné použít tento příkaz: @table @kbd @item C-e C-a @kindex C-e C-a @findex speechd-add-connection-settings Ulož aktuální parametry spojení do zadaného hlasu v@tie{}proměnné @code{speechd-voices} s nastav tento hlas pro aktuální spojení v@tie{}proměnné @code{speechd-connection-voices}. Nezapomeňte, že pokud chcete zachovat nový obsah těchto proměnných, musíte si je sami uložit, příkaz to nedělá. @end table @node Více spojení, Klávesy, Hlasy spojení, Konfigurace @subsection Více spojení @cindex spojení speechd-el můžete říct, aby pro určité buffery nebo hlavní módy používalo oddělená spojení na Speech Dispatcher. To v@tie{}zásadě umožňuje nezávislé nastavení různých parametrů řečového výstupu pro tyto buffery a hlavní módy, jak ruční, tak prostřednictvím konfigurace (@pxref{Hlasy spojení}). Každé spojení na Speech Dispatcher má své vlastní jedinečné jméno. speechd-el implicitně používá spojení nazvané @code{"default"}. Pro vytvoření odděleného spojení stačí pouze nechat v@tie{}určitých situacích speechd-el vybrat jiné jméno spojení. Způsob výběru spojení je definován proměnnou @code{speechd-speak-connections}. @vtable @code @item speechd-speak-connections Asociativní seznam mapující hlavní módy a buffery na spojení. Každý prvek seznamu je tvaru @code{(@var{mód-nebo-buffer} . @var{jméno-spojení})}. Když chce speechd-el poslat zprávu, porovnává momentální prostředí s@tie{}@var{mód-nebo-buffer}. @var{mód-nebo-buffer} smí být jedním z@tie{}následujících objektů, od nejvyšší priority po nejnižší: @itemize @bullet @item seznam, reprezentující volání funkce, která musí vrátit jinou hodnotu než @code{nil}, právě když má být použit příslušný prvek asociativního seznamu @item jméno bufferu @item symbol @code{:minibuffer}, reprezentující minibuffer @item symbol hlavního módu @item @code{nil}, reprezentující nebufferové objekty, např. echo area @item @code{t}, reprezentující implicitní hodnotu, když není aplikovatelný žádný jiný prvek @end itemize Jestliže určité situaci odpovídá více prvků, je použit prvek s@tie{}nejvyšší prioritou. @var{jméno-spojení} je libovolný neprázdný řetězec určující jméno požadovaného spojení. Není-li otevřeno žádné spojení daného jména, je automaticky vytvořeno v@tie{}okamžiku, kdy do něj má být něco zasláno. @end vtable @node Klávesy, Módy, Více spojení, Konfigurace @subsection Klávesy @cindex klávesy @cindex prefixová klávesa @cindex klávesová mapa Příkazové klávesy speechd-el jsou definovány proměnnou @code{speechd-speak-prefix} a klávesovou mapou @code{speechd-speak-mode-map}. @vtable @code @item speechd-speak-prefix Tato proměnná definuje prefixovou klávesu příkazů speechd-el, kterou je implicitně @kbd{C-e}. Jestliže tuto proměnnou změníte až po nastartování mluvení prostřednictvím příkazu @code{speechd-speak} a nenastavujete ji prostřednictvím konfiguračního rozhraní Emacsu (customize), musíte, aby se změna projevila, příkaz @code{speechd-speak} spustit znovu. @item speechd-speak-mode-map Tato klávesová mapa určuje mapování kláves speechd-el následujících za prefixovou klávesou. Můžete v@tie{}ní klávesy nastavovat obvyklým způsobem, např. @lisp (define-key speechd-speak-mode-map "t" 'speechd-say-text) @end lisp přiřadí příkaz @code{'speechd-say-text} klávese @code{C-e t} (je-li prefixovou klávesou @code{C-e}). @end vtable @node Módy, Debugger, Klávesy, Konfigurace @subsection Háčky ve vedlejších módech @cindex vedlejší módy @cindex háčky speechd-el poskytuje vedlejší mód, který zapíná a vypíná mluvení, @xref{Spuštění řečového výstupu}. Prostřednictvím následujícího háčku si můžete nechat provést vlastní akce při vstupu do tohoto módu: @vtable @code @item speechd-speak-mode-hook Háček spuštěný při zapnutí vedlejšího módu speechd-speak. @end vtable @node Debugger, , Módy, Konfigurace @subsection Ladění speechd-el @cindex debugger @cindex ladění Pokud se pokoušíte řečový výstup ladit, můžete narazit na problém rekurzivního vyvolávání laděných funkcí v@tie{}elispových debuggerech. Tomu lze ve speechd-el zabránit zákazem mluvení v@tie{}debuggerech: @vtable @code @item speechd-speak-in-debugger Je-li hodnotou proměnné něco jiného než @code{nil}, funkce automatického řečového výstupu nemluví v@tie{}elispových debuggerech. @end vtable @node Pokročilá konfigurace, Potíže, Konfigurace, Uživatelská příručka @section Definice vlastních reakcí na příkazy @cindex rozšíření Psaní vlastních reakcí na příkazy obecně vyžaduje znalost programování v@tie{}Elispu. Nemusíte se však děsit, základní věci si můžete nastavit i@tie{}bez toho, stačí se řídit zde uvedenými instrukcemi. speechd-el umožňuje říct text, přehrát zvukovou ikonu nebo zavolat libovolný elispový výraz před nebo po provedení příkazu nebo funkce. Pro tyto účely jsou k@tie{}dispozici dvě makra, která zajistí, že se kromě vlastní akce provede vše, co je nutno: @ftable @code @item speechd-speak-command-feedback @var{příkaz} @var{pozice} @var{reakce} Definuj reakci na @var{příkaz}. @var{příkaz} je jméno interaktivní funkce (použijte @kbd{C-h C-c} pro zjištění jména příkazu navázaného na určitou klávesu). @var{pozice} může být jeden ze symbolů @code{before} nebo @code{after} pro vyvolání reakce před (@code{before}) nebo poté (@code{after}), co je příkaz proveden. @code{reakce} může být řetězec nebo jakýkoliv elispový výraz. Jedná-li se o@tie{}řetězec (text uzavřený v@tie{}uvozovkách), definuje text k@tie{}přeříkání nebo zvukovou ikonu k@tie{}přehrání. Jestliže řetězec začíná hvězdičkou (@code{*}), určuje jméno zvukové ikony (hvězdička není součástí jména), jinak se jedná o@tie{}normální text. Příklad: @cindex @code{suspend-emacs} @lisp (speechd-speak-command-feedback suspend-emacs before "Suspenduji Emacs!") @end lisp Tento řádek elispového kódu můžete vložit do svého @file{~/.emacs}, čímž si zajistíte upozornění o@tie{}vyvolání příkazu @code{suspend-emacs} (obvykle navázaného @kbd{C-z}). @item speechd-speak-function-feedback @var{funkce} @var{pozice} @var{reakce} Toto je stejné jako @code{speechd-speak-command-feedback} až na to, že @var{reakce} je vyvolána kdykoliv je vyvolána @code{funkce}, ať už interaktivně či nikoliv. Navíc @code{funkce} může být jakákoliv funkce, nejen interaktivní příkaz. @end ftable @emph{Prosím pozor:} @itemize @bullet @item Kvůli určitému nedostatku Emacsu nemusí popsaný mechanismus reakcí správně fungovat pro vestavěné funkce. @item Pokud si definujete vlastní reakce na funkce bez použití uvedených maker, buďte opatrní. Uvedená makra definují kód zajišťující, že se nic neříká v@tie{}případě vypnutého @code{speechd-speak-mode}, a@tie{}podobná opatření. Pokud tato makra nepoužíváte, musíte si tato opatření zajistit sami. @end itemize @node Potíže, Tipy, Pokročilá konfigurace, Uživatelská příručka @section Potíže, se kterými se můžete setkat @cindex potíže @itemize @bullet @cindex Info @item @emph{Proč se nepřeříkávají některé položky menu v@tie{}Info?} Je to způsobeno tím, jakým způsobem Emacs umisťuje faces na položky menu. Problém lze obejít nastavením hodnoty proměnné @code{Info-fontify-maximum-menu-size} na @code{0}. @cindex upozornění na události @cindex diář @item @emph{Jakým způsobem lze Emacs přimět k@tie{}přeříkávání upozornění na události (appointments)?} Nastavte proměnnou @code{appt-msg-window} na @code{nil}. Taktéž může být užitečné přidat do proměnné @code{speechd-speak-auto-speak-buffer} řetězec @code{"diary"}. @cindex w3m-el @cindex URL @item @emph{Jak zabránit vypisování URL při pohybu po lincích ve w3m-el?} Přidejte si do svého @file{~/.emacs} následující kód: @lisp (defadvice w3m-print-this-url (around my-w3m-print-this-url activate) (when (eq this-command 'w3m-print-this-url) ad-do-it)) @end lisp @cindex opakované čtení @item @emph{V@tie{}některých situacích, kdy je po provedení příkazu čten modifikovaný text, je tento text čten po kusech a některé z@tie{}těchto kusů jsou opakovány.} Obsah bufferu se v@tie{}elispových programech může měnit mnoha různými způsoby. speechd-el nemůže uspokojivě ošetřit všechny možné takové postupy. Pokud máte rozumný nápad, jak v@tie{}nějaké situaci vylepšit čtení změn textu v@tie{}bufferu, řekněte nám o@tie{}tom. Pokud na tento problém narazíte u@tie{}některého často prováděného příkazu, můžete si pro tyto příkazy definovat svoji vlastní řečovou odezvu. Více informací o@tie{}možnostech definic vlastní řečové odezvy naleznete v@tie{}sekci @ref{Pokročilá konfigurace}. @item @cindex prodlevy @cindex garbage collection @cindex @code{gc-cons-threshold} @emph{Předtím, než se po příkazu něco řekne, se občas objevuje malá prodleva (přibližně jednosekundová).} Možná, že Emacs během prodlevy provádí garbage collection. Zkuste zvýšit hodnotu proměnné @code{gc-cons-threshold}, třeba na 4000000. Může to celkový výkon zvýšit nebo snížit, v@tie{}závislosti na vašem prostředí a konkrétních požadavcích. Jste-li zkušeným elispovým hackerem a dokážete zjistit, proč speechd-el produkuje významné množství dat způsobujících zvýšení frekvence provádění garbage collection a jak něco v@tie{}tomto směru vylepšit, vaše pomoc je vítána! @item @emph{Při přidržení klávesy @kbd{C-n} obrazovka na chvíli zamrzne a kurzor se nepohybuje.} Je-li Emacs zaměstnaný nějakou činností, není obecně prováděna aktualizace obrazovku. speechd-el je v@tie{}kombinaci s@tie{}vyšší rychlostí automatického opakování kláves schopno dosáhnout takového stavu poměrně snadno. Představuje-li to pro vás skutečný problém, můžete si snížit rychlost autorepeatu nebo pořídit rychlejší počítač. Samozřejmě jsou vítány jakékoliv tipy, jak zvýšit rychlost speechd-el. @end itemize @node Tipy, Oznamování chyb, Potíže, Uživatelská příručka @section Užitečné emacsové tipy Nezapomeňte, že Elisp vám umožňuje definovat si spoustu užitečných funkcí. Typicky si můžete definovat příkazy oznamující nějaké informace, které jsou snadno identifikovatelné na emacsové obrazovce, ale které nejsou tak dobře rozpoznatelné v@tie{}řečovém výstupu. Několik příkladů: @itemize @bullet @item @emph{Oznamování aktuálního data v@tie{}kalendáři:} @cindex den v@tie{}kalendáři @lisp (defun report-day () (interactive) (message "%s" (calendar-date-string (calendar-cursor-to-date t)))) @end lisp @item @emph{Výpis aktuálních upozornění na události z@tie{}diáře:} @cindex upozornění na události @lisp (defun report-current-appointments () (interactive) (let ((appt-now-displayed nil)) (appt-check))) @end lisp @end itemize @node Oznamování chyb, , Tipy, Uživatelská příručka @section Jak oznamovat chyby speechd-el nebo Speech Dispatcher @cindex chyby Narazíte-li na chybu speechd-el, můžete pro její oznámení použít následující příkaz. Ale než tak učiníte, přečtěte si prosím celý text této sekce, aby vámi oznámená chyba mohla být řešena co nejefektivněji. @ftable @kbd @item M-x speechd-bug @findex speechd-bug Oznam chybu speechd-el nebo Speech Dispatcher. Příkaz se zeptá na určité informaci a pak se zeptá, zda chybu dokážete zreprodukovat. Pokud dokážete, odpovězte @kbd{y} a začněte chybu reprodukovat. Ihned, jakmile je chyba zreprodukována, stiskněte @kbd{C-e C-f}. Potom můžete (a@tie{}měli byste) dále zeditovat vygenerovaný e-mail a odeslat jej obvyklým způsobem. @item M-x speechd-bug-reproduce @findex speechd-bug-reproduce @kindex C-e C-f Zahaj reprodukci chyby speechd-el nebo Speech Dispatcher. Od tohoto okamžiku jsou sledovány všechny akce uživatele a Speech Dispatcher. Reprodukce chyby se ukončí stiskem kláves @kbd{C-e C-f}. Poté, co je ukončena, jsou do bufferu, kde byl příkaz @code{speechd-bug-reproduce} vyvolán, vloženy informace o@tie{}reprodukci chyby. Tento příkaz je užitečný v@tie{}případě, kdy chcete poskytnout informace o@tie{}chybě bez generování nového oznámení o@tie{}chybě. @end ftable Když oznamujete chyby, mějte prosím vždy na paměti následující pokyny: @itemize @bullet @item Napište o@tie{}chybě co nejvíce informací. Popište, co nefunguje, jaké je vámi očekávané chování, jaké akce chybu vyvolaly, co je zvláštního na vašem Emacsovém prostředí nebo konfiguraci Speech Dispatcher, atd. Nesnažte se příliš přemýšlet nad tím, která informace je důležitá a která není --- pro vývojáře může být důležitá každá informace, takže nezapomeňte uvést cokoli, co může být potenciálně důležité. Raději uvádějte informací více než méně. Chybějící informace může znamenat, že vývojáři nebudou schopni s@tie{}chybou nic udělat. @item Buďte co nejpřesnější. Neočekávajte, že vývojáři znají kontext nebo že ví, jakým způsobem Emacs a speechd-el používáte. Používejte přesné popisy --- místo pouhého ``když zavolám foo'' pište lépe ``když stisknu klávesy `M-x foo RET', čímž se vyvolá příkaz `foo' ''. Nebo místo ``neříká, co by mělo'' pište ``říká `bla bla' místo očekávaného `ble ble ble', přičemž `ble ble ble' je text celého čteného řádku''. @item Když reprodukujete chybu, snažte se mít zapnuto logování Speech Dispatcher na co nejvyšší úroveň --- nastavte v@tie{}konfiguračním souboru @file{speechd.conf} volbu @code{LogLevel} na hodnotu @code{5}. @item Když reprodukujete chybu, neprovádějte žádné nadbytečné akce a proveďte @kbd{C-e C-f} hned jak je chyba zreprodukována. Zabráníte tak tomu, aby se podstatné informace získané z@tie{}logovacích souborů utopily v@tie{}nadbytečném balastu. @item Můžete se také podívat na pokyny pro oznamování chyb Speech Dispatcher, viz @ref{Reporting Bugs,,,speechd,Speech Dispatcher}. @end itemize @c **************************************************************************** @node Elispová knihovna, Kontaktní informace, Uživatelská příručka, Top @chapter Elispová knihovna speechd-el Momentálně není ke knihovně k@tie{}dispozici žádný skutečný programátorský manuál. Podívejte se tedy prosím na dokumentační řetězce dostupných proměnných, funkcí a maker. Nicméně se můžete (a@tie{}měli byste) řídit následujícími radami: @itemize @bullet @item Nepoužívejte žádné funkce, proměnné nebo jiné lispové objekty, jejichž jména začínají prefixem @code{speechd--} nebo @code{speechd-speak--}. Tyto objekty jsou považovány za privátní a mohou se kdykoliv bez upozornění změnit nebo být zrušeny. @item @vindex speechd-client-name Jestliže chcete vybrat nebo vytvořit konkrétní spojení, udělejte to prostřednictvím nastavení hodnoty proměnné @code{speechd-client-name}: @lisp (let ((speechd-client-name "něco")) ... kód používající spojení "něco" ... ) @end lisp Mějte prosím na paměti, že obvykle není dobrým nápadem otevřít současně dvě spojení na Speech Dispatcher se shodným klientským jménem. @item Jinak by na vás neměly číhat žádná zvláštní překvapení a jakýkoliv rozumný kód by měl být bezproblémový. @end itemize Možná vás ještě může zajímat @ref{Pokročilá konfigurace}. @c **************************************************************************** @node Kontaktní informace, Kopírování tohoto manuálu, Elispová knihovna, Top @chapter Kontaktní informace @cindex autoři @cindex chyby @cindex kontakty Pokud chcete oznámit chybu speechd-el, zašlete nám kompletní informaci o@tie{}chybě na adresu @email{speechd-discuss@@nongnu.org}. Pokud nám chcete poslat záplatu speechd-el, můžete použít tutéž adresu. @emph{Prosíme}, před zasláním oznámení o@tie{}chybě si přečtěte pokyny pro oznamování chyb, see @ref{Oznamování chyb}. Budete-li se držet uvedenými radami, umožníte nám zpracovat vaše oznámení o@tie{}chybě efektivněji a tím pádem s@tie{}lepší a rychlejší odezvou. Máte-li jakékoliv otázky, náměty nebo cokoliv dalšího, co nám chcete sdělit, neváhejte se obrátit na adresu @email{speechd-discuss@@nongnu.org}. @c **************************************************************************** @node Kopírování tohoto manuálu, Index, Kontaktní informace, Top @appendix GNU Free Documentation License @cindex FDL, GNU Free Documentation License @center Version 1.2, November 2002 @include fdl.texi @c **************************************************************************** @node Index, , Kopírování tohoto manuálu, Top @unnumbered Index @printindex cp @bye @c LocalWords: chyph def ntprefix cs input comment of header documentlanguage @c LocalWords: documentencoding VERSION el value end copying quotation is and @c LocalWords: Permission granted distribute or modify this document under gc @c LocalWords: the terms Documentation License Version any later version with @c LocalWords: published Foundation Sections Cover Texts Back license section @c LocalWords: included entitled Sound Emacsové Dispatcher title subtitle tie @c LocalWords: author page contents node Elispová elispových chapter emacsový @c LocalWords: itemize bullet Elispovou emacsové emacsových elispovou file @c LocalWords: enumerate example make compile lisp speak nil code table ref @c LocalWords: global toggle speaking subsection read other window word char @c LocalWords: paragraph next previous last message cancel resume key rate @c LocalWords: predefined connection language punctuation all none some icon @c LocalWords: capital character spell voice number pitch output spelling say @c LocalWords: sound repeat faces localhost timeout default notification name @c LocalWords: important progress deleted buffers force self insert command @c LocalWords: insertions one comint align signal empty beginning backward @c LocalWords: properties face lock movement always never voices parameters @c LocalWords: property customize add connections minibuffer area define hook @c LocalWords: elispový feedback before after suspend emacs function garbage @c LocalWords: collection cons threshold elispovým autorepeatu client protect @c LocalWords: appendix November include unnumbered bye speechd-el-2.11/speechd-braille.el0000644000175000001440000001473614070023103015513 0ustar pdmusers;;; speechd-braille.el --- Emacs braille emulator driver -*- lexical-binding: t -*- ;; Copyright (C) 2012-2021 Milan Zamazal ;; Copyright (C) 2004-2008 Brailcom, o.p.s. ;; Author: Milan Zamazal ;; COPYRIGHT NOTICE ;; ;; 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 . ;;; Code: (require 'eieio) (require 'braille) (require 'mmanager) (require 'speechd-common) (require 'speechd-out) (defgroup speechd-braille () "speechd-el Braille output." :group 'speechd-el) (defcustom speechd-braille-display-time 3 "How many seconds to display a message before displaying the next one." :type 'number :group 'speechd-braille) (defvar speechd-braille--vetoed-icons '("message")) (defvar speechd-braille--paused-messages '()) (defvar speechd-braille--last-message nil) (defvar speechd-braille--last-message-time 0) (defvar speechd-braille--display-timer nil) (defun speechd-braille--time () (funcall (if (fboundp 'time-to-seconds) #'time-to-seconds ;; taken from time-date.el #'(lambda (time) (+ (* (car time) 65536.0) (cadr time) (/ (or (nth 2 time) 0) 1000000.0)))) (current-time))) (defun speechd-braille--display (manager message &optional sticky) (speechd-braille--stop manager) (apply (mmanager-get manager 'braille-display) message) (setq speechd-braille--last-message message) (setq speechd-braille--last-message-time (speechd-braille--time)) (unless sticky (setq speechd-braille--display-timer (run-at-time speechd-braille-display-time nil #'mmanager-next manager)))) (defun speechd-braille--stop (_manager) (when speechd-braille--display-timer (cancel-timer speechd-braille--display-timer)) (setq speechd-braille--display-timer nil)) (defun speechd-braille--pause (_manager) (push speechd-braille--last-message speechd-braille--paused-messages)) (defun speechd-braille--resume (manager) (let ((message (pop speechd-braille--paused-messages))) (when message (speechd-braille--display manager message)))) (defun speechd-braille--busy (_manager) (and speechd-braille--display-timer (< (- (speechd-braille--time) speechd-braille--last-message-time) speechd-braille-display-time))) (defun speechd-braille--create-manager (display-func) (let ((manager (mmanager-create display-func #'speechd-braille--stop #'speechd-braille--pause #'speechd-braille--resume #'speechd-braille--busy))) (mmanager-put manager 'braille-display #'braille-display) manager)) (defun speechd-braille--maybe-enqueue (driver text message) (with-slots (manager priority) driver (if speechd-update (mmanager-enqueue manager speechd-client-name (speechd-braille--make-message driver (speechd-out-update-text speechd-update) (speechd-out-update-cursor speechd-update)) priority (speechd-out-update-group speechd-update)) (unless (string= text "") (mmanager-enqueue manager speechd-client-name message priority))))) ;;; Interface functions (defclass speechd-braille-emu-driver (speechd-driver) ((name :initform 'braille-emu) (manager) (priority))) (cl-defmethod initialize-instance :after ((this speechd-braille-emu-driver) _slots) (progn (oset this priority speechd-default-text-priority) (oset this manager (speechd-braille--create-manager #'speechd-braille--display)))) (cl-defmethod speechd-braille--make-message ((_driver speechd-braille-emu-driver) text cursor) (list text cursor)) (cl-defmethod speechd.cancel ((driver speechd-braille-emu-driver) _all) (mmanager-cancel (slot-value driver 'manager) speechd-client-name)) (cl-defmethod speechd.stop ((driver speechd-braille-emu-driver) _all) (mmanager-next (slot-value driver 'manager))) (cl-defmethod speechd.pause ((_driver speechd-braille-emu-driver) _all) ;; do nothing ) (cl-defmethod speechd.resume ((_driver speechd-braille-emu-driver) _all) ;; do nothing ) (cl-defmethod speechd.repeat ((_driver speechd-braille-emu-driver)) ;; do nothing ) (cl-defmethod speechd.block ((driver speechd-braille-emu-driver) function) (mmanager-start-block (slot-value driver 'manager) speechd-client-name (slot-value driver 'priority)) (unwind-protect (funcall function) (mmanager-finish-block (slot-value driver 'manager) speechd-client-name))) (cl-defmethod speechd.text ((driver speechd-braille-emu-driver) text cursor _markers) (speechd-braille--maybe-enqueue driver text (speechd-braille--make-message driver text cursor))) (cl-defmethod speechd.icon ((driver speechd-braille-emu-driver) icon) (unless (member icon speechd-braille--vetoed-icons) (speechd-braille--maybe-enqueue driver icon (speechd-braille--make-message driver icon nil)))) (cl-defmethod speechd.char ((driver speechd-braille-emu-driver) char) (let ((text (char-to-string char))) (speechd-braille--maybe-enqueue driver text (speechd-braille--make-message driver text nil)))) (cl-defmethod speechd.key ((driver speechd-braille-emu-driver) key) (let ((key-string (if (numberp key) (key-description (list key)) (format "%s" key)))) (speechd-braille--maybe-enqueue driver key-string (speechd-braille--make-message driver key-string nil)))) (cl-defmethod speechd.set ((driver speechd-braille-emu-driver) parameter value) (when (eq parameter 'priority) (setf (slot-value driver 'priority) value))) (cl-defmethod speechd.shutdown ((_driver speechd-braille-emu-driver)) ;; do nothing ) (speechd-out-register-driver (make-instance 'speechd-braille-emu-driver)) ;;; Announce (provide 'speechd-braille) ;;; speechd-braille.el ends here speechd-el-2.11/speechd-out.el0000644000175000001440000002076514070023103014707 0ustar pdmusers;;; speechd-out.el --- Alternative output interface -*- lexical-binding: t -*- ;; Copyright (C) 2018-2021 Milan Zamazal ;; Copyright (C) 2004, 2005, 2006, 2008 Brailcom, o.p.s. ;; Author: Milan Zamazal ;; COPYRIGHT NOTICE ;; ;; 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 . ;;; Code: (require 'cl-lib) (require 'eieio) (require 'speechd-common) (defvar speechd-out--drivers '()) (defcustom speechd-out-active-drivers '(ssip brltty) "List of names of the drivers to send output to." :type '(repeat symbol) :group 'speechd-el) (defvar speechd-out--event-mapping '((empty . empty-text) (whitespace . whitespace) (beginning-of-line . beginning-of-line) (end-of-line . end-of-line) (start . start) (finish . finish) (minibuffer . prompt) (message . message))) ;;; Internal infrastructure (defmacro speechd-out--loop-drivers (var &rest body) (let ((var* (car var)) ($speechd-out-errors (gensym)) ($error (gensym)) ($error-data (gensym)) ($err (gensym))) `(let ((,$speechd-out-errors '())) (dolist (,var* speechd-out--drivers) (when (memq (speechd-driver.name ,var*) speechd-out-active-drivers) (condition-case ,$err (progn ,@body) (error (push ,$err ,$speechd-out-errors))))) (when ,$speechd-out-errors ;; How to signal all the errors? (cl-destructuring-bind (,$error . ,$error-data) (cl-first ,$speechd-out-errors) (setq ,$speechd-out-errors (cdr ,$speechd-out-errors)) (while (and ,$speechd-out-errors (eq (caar ,$speechd-out-errors) ,$error)) (setq ,$error-data (append ,$error-data (cdar ,$speechd-out-errors))) (setq ,$speechd-out-errors (cdr ,$speechd-out-errors))) (signal ,$error ,$error-data)))))) (defun speechd-out--loop-drivers-op (operation &rest args) (speechd-out--loop-drivers (driver) (apply operation driver args))) (defun speechd-out--icon-name (icon) (let ((mapping (cdr (assq icon speechd-out--event-mapping)))) (when mapping (symbol-name mapping)))) ;;; Driver API (defclass speechd-driver () ((name :initarg :name :reader speechd-driver.name))) (cl-defmethod initialize-instance :after ((this speechd-driver) _slots) (if (not (slot-boundp this 'name)) (error "Driver name not given"))) (defun speechd-out-register-driver (driver) (let ((class (eieio-object-class driver))) (cl-labels ((replace (list) (cond ((null list) (list driver)) ((eq (eieio-object-class (car list)) class) (cons driver (cdr list))) (t (cons (car list) (replace (cdr list))))))) (setq speechd-out--drivers (replace speechd-out--drivers))))) (cl-defmethod speechd.cancel ((_driver speechd-driver) _all)) (cl-defmethod speechd.stop ((_driver speechd-driver) _all)) (cl-defmethod speechd.pause ((_driver speechd-driver) _all)) (cl-defmethod speechd.resume ((_driver speechd-driver) _all)) (cl-defmethod speechd.repeat ((_driver speechd-driver))) (cl-defmethod speechd.block ((_driver speechd-driver) _function)) (cl-defmethod speechd.text ((_driver speechd-driver) _text _cursor _markers)) (cl-defmethod speechd.icon ((_driver speechd-driver) _icon)) (cl-defmethod speechd.char ((_driver speechd-driver) _char)) (cl-defmethod speechd.key ((_driver speechd-driver) _key)) (cl-defmethod speechd.set ((_driver speechd-driver) _parameter _value)) (cl-defmethod speechd.shutdown ((_driver speechd-driver))) (defvar speechd-update nil) ;;; Interface functions and variables (cl-defstruct speechd-out-update text cursor group) (defmacro speechd-out-with-updated-text (spec &rest body) `(let ((speechd-update ,spec)) ,@body)) (defun speechd-out-cancel (&optional all) (interactive "P") (speechd-out--loop-drivers-op #'speechd.cancel all)) (defun speechd-out-stop (&optional all) (interactive "P") (speechd-out--loop-drivers-op #'speechd.stop all)) (defun speechd-out-pause (&optional all) (interactive "P") (speechd-out--loop-drivers-op #'speechd.pause all)) (defun speechd-out-resume (&optional all) (interactive "P") (speechd-out--loop-drivers-op #'speechd.resume all)) (defun speechd-out-repeat () (interactive) (speechd-out--loop-drivers-op #'speechd.repeat)) (cl-defun speechd-out-icon (icon &key (priority speechd-default-sound-priority)) (let ((icon-name (speechd-out--icon-name icon))) (when icon-name (speechd-out--loop-drivers (driver) (speechd.set driver 'priority priority) (speechd.icon driver icon-name))))) (cl-defun speechd-out-char (char &key (priority speechd-default-char-priority) icon) (let ((icon-name (speechd-out--icon-name icon))) (speechd-out--loop-drivers (driver) (speechd.set driver 'priority priority) (let ((icon-name% icon-name) (driver% driver) (char% char)) (speechd.block driver (lambda () (when icon-name% (speechd.icon driver% icon-name%)) (speechd.char driver% char%))))))) (cl-defun speechd-out-keys (keys &key (priority speechd-default-key-priority) text) (speechd-out--loop-drivers (driver) (speechd.set driver 'priority priority) (let ((driver% driver) (keys% keys) (text% text)) (speechd.block driver (lambda () (dolist (k keys%) (speechd.key driver% k)) (when text% (speechd.text driver% text% nil nil))))))) (cl-defun speechd-out-text (text &key (priority speechd-default-text-priority) icon cursor markers) (let ((icon-name (speechd-out--icon-name icon))) (speechd-out--loop-drivers (driver) (speechd.set driver 'priority priority) (let ((icon-name% icon-name) (driver% driver) (text% text) (cursor% cursor) (markers% markers)) (speechd.block driver (lambda () (when icon-name% (speechd.icon driver% icon-name%)) (speechd.text driver% text% cursor% markers%))))))) (defun speechd-out-set (parameter value) (speechd-out--loop-drivers (driver) (speechd.set driver parameter value))) (defun speechd-out-shutdown (&optional inactive-only) (dolist (driver speechd-out--drivers) (when (or (not inactive-only) (not (memq (speechd-driver.name driver) speechd-out-active-drivers))) (speechd.shutdown driver)))) (defun speechd-out-enable-driver (driver) "Enable given driver." (interactive (list (intern (completing-read "Enable driver: " (mapcar 'list (mapcar 'symbol-name (cl-set-difference (mapcar 'speechd-driver.name speechd-out--drivers) speechd-out-active-drivers))) nil t)))) (unless (memq driver speechd-out-active-drivers) (push driver speechd-out-active-drivers))) (defun speechd-out-disable-driver (driver) "Disable given driver and disconnect from its output device." (interactive (list (intern (completing-read "Disable driver: " (mapcar 'list (mapcar 'symbol-name speechd-out-active-drivers)) nil t)))) (setq speechd-out-active-drivers (remove driver speechd-out-active-drivers)) (speechd-out-shutdown t)) ;;; Announce (provide 'speechd-out) ;;; speechd-out.el ends here speechd-el-2.11/speechd-ssip.el0000644000175000001440000000507314070023103015051 0ustar pdmusers;;; speechd-ssip.el --- SSIP driver -*- lexical-binding: t -*- ;; Copyright (C) 2018-2021 Milan Zamazal ;; Copyright (C) 2004-2018 Brailcom, o.p.s. ;; Author: Milan Zamazal ;; COPYRIGHT NOTICE ;; ;; 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 . ;;; Code: (require 'eieio) (require 'speechd) (require 'speechd-out) (defclass speechd-ssip-driver (speechd-driver) ((name :initform 'ssip) (host :initform speechd-host :initarg :host) (port :initform speechd-port :initarg :port))) (cl-defmethod speechd.cancel ((_driver speechd-ssip-driver) all) (speechd-cancel all)) (cl-defmethod speechd.stop ((_driver speechd-ssip-driver) all) (speechd-stop all)) (cl-defmethod speechd.pause ((_driver speechd-ssip-driver) all) (speechd-pause all)) (cl-defmethod speechd.resume ((_driver speechd-ssip-driver) all) (speechd-resume all)) (cl-defmethod speechd.repeat ((_driver speechd-ssip-driver)) (speechd-repeat)) (cl-defmethod speechd.block ((_driver speechd-ssip-driver) function) (speechd-block function)) (cl-defmethod speechd.text ((_driver speechd-ssip-driver) text _cursor markers) (speechd-say-text text :markers markers)) (cl-defmethod speechd.icon ((_driver speechd-ssip-driver) icon) (speechd-say-sound icon)) (cl-defmethod speechd.char ((_driver speechd-ssip-driver) char) (speechd-say-char char)) (cl-defmethod speechd.key ((_driver speechd-ssip-driver) key) (speechd-say-key key)) (defconst speechd-ssip--parameter-names (mapcar 'car speechd--parameter-names)) (cl-defmethod speechd.set ((_driver speechd-ssip-driver) parameter value) (when (eq parameter 'priority) (setq parameter 'message-priority)) (when (memq parameter speechd-ssip--parameter-names) (speechd--set-parameter parameter value))) (cl-defmethod speechd.shutdown ((_driver speechd-ssip-driver)) (speechd-close-all)) (speechd-out-register-driver (make-instance 'speechd-ssip-driver)) ;;; Announce (provide 'speechd-ssip) ;;; speechd-ssip.el ends here speechd-el-2.11/speechd-el.texi0000644000175000001440000022021614070023103015042 0ustar pdmusers\input texinfo @c -*-texinfo-*- @comment %**start of header @setfilename speechd-el.info @set VERSION 2.11 @settitle speechd-el @value{VERSION} @syncodeindex fn cp @syncodeindex ky cp @syncodeindex vr cp @comment %**end of header @copying This manual is for speechd-el, @value{VERSION}. Copyright @copyright{} 2012-2021 Milan Zamazal Copyright @copyright{} 2003-2010 Brailcom, o.p.s. @quotation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License.'' @end quotation You can also (at your option) distribute this manual under the GNU General Public License: @quotation Permission is granted to copy, distribute and/or modify this document 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. A copy of the license is included in the section entitled ``GNU General Public License''. @end quotation @end copying @dircategory Emacs @direntry * speechd-el: (speechd-el). Emacs interface to Speech Dispatcher and BRLTTY. @end direntry @titlepage @title speechd-el @subtitle for version @value{VERSION} @author Milan Zamazal @author Brailcom, o.p.s. @page @vskip 0pt plus 1filll @insertcopying @end titlepage @contents @ifnottex @node Top, Introduction, (dir), (dir) @top speechd-el @insertcopying @end ifnottex @menu * Introduction:: What is speechd-el and this manual about? * speechd-el User Manual:: Using Emacs speech output. * speechd-el Elisp Library:: Using speechd-el in Elisp programs. * Contact Information:: Bug reporting etc. * Copying This Manual:: GNU Free Documentation License. * Index:: Concept, function, variable and key index. @end menu @c **************************************************************************** @node Introduction, speechd-el User Manual, Top, Top @chapter Introduction speechd-el is an Emacs client to speech synthesizers, Braille displays and other alternative output interfaces. It provides full speech and Braille output environment for Emacs. It is aimed primarily at visually impaired users who need non-visual communication with Emacs, but it can be used by anybody who needs sophisticated speech or other kind of alternative output from Emacs. speechd-el can make Emacs a completely speech and BRLTTY enabled application suitable for visually impaired users or, depending on its configuration, it can only speak in certain situations or when asked, to serve needs of any Emacs user. Programming interfaces are available both to the user interface and for communication with the output devices. This manual describes the speech/Braille output user interface, how to customize and extend the interface, and the Emacs Lisp libraries. Some degree of familiarity with Speech Dispatcher or BRLTTY on the user level is recommended, although not absolutely necessary. @menu * Design Goals:: * Feature List:: * Components:: @end menu @node Design Goals, Feature List, Introduction, Introduction @section Design Goals speechd-el was designed considering our experience with other free accessibility technologies. We sometimes meet problems such as lack of maintenance power, duplicated efforts, making technology specific solutions instead of generally useful tools, important bugs. As other @uref{http://www.freebsoft.org/projects,Free(b)soft projects} speechd-el attempts to fill in an empty space in the accessibility area, in a way oriented towards future. speechd-el tries to offer technology that is useful, simple, supporting general accessibility architecture models and that effectively utilizes the limited accessibility development resources. The particular speechd-el design goals are: @itemize @bullet @item Providing advanced accessible user environment that works out of the box and utilizes standard Emacs features wherever possible. Emacs accessibility should work as much as possible on the general level without necessity to implement direct support for particular Emacs packages. speechd-el should also preferrably use standard Emacs features if possible instead of implementing its own solutions. @item Implementing just the necessary functionality, without duplicating features presented in other components such as Speech Dispatcher, speech synthesizers or Braille APIs. Emacs accessibility solutions should share features, configuration, code, etc. with other applications to the highest possible extent in order to make life of both users and developers easier. @item Simple and clean source code that requires only minimum maintenance and allows future extensions. @item As little modifications to standard Emacs environment as possible, with the possibility to make additional customizations if needed, either shared or private. Emacs should work the same way whether it speaks or not. Of course optional customizations can be made and the generally useful ones should be included as optional parts of the distribution. @item Ability to work well in a multilingual environment. @item Completely Free Software architecture, without requiring any proprietary component. @end itemize @node Feature List, Components, Design Goals, Introduction @section Feature List Major speechd-el features are: @cindex features @itemize @bullet @item Speech output. @item Braille display output and input, mostly identical to the speech output. @item Both automated and explicit reading. You can let Emacs read everything and/or you can ask it to read some parts of the text (such as current line, current buffer, last message, etc.). @item Message priorities ensuring you don't miss important messages while you needn't listen to or view unimportant messages. @item ``Intelligent'' and customizable selection of text to be read based on lines, text properties, buffer contents changes and other criteria. @item Support for changing speech parameters (such as language, voice, rate, pitch, volume, speech synthesizer). Different speech parameters can be used in different buffers, major modes, faces, etc. @item Support for events (such as sound icons). @item Emacs status changes reporting (such as mode, keyboard, process changes, etc.). @item Multilingual environment support. speechd-el works well with languages other than English and offers support for current language selection based on the kind of texts, selected keyboard, etc. @item Reasonable immediate speech and Braille output in most Emacs packages. @item No significant changes of the standard Emacs behavior. @item Speech and Braille output can be enabled/disabled independently to each other and they can be enabled/disabled for the whole Emacs session or just for particular buffers. @item Speech synthesizer independence, you can use all speech synthesizers supported by Speech Dispatcher (such as Festival, Flite, eSpeak, Epos, Dectalk, IBM TTS, Cicero, etc.) and you can use multiple speech synthesizers inside a single Emacs session. @item Braille displays are handled through BRLTTY drivers and APIs. @item Programming libraries for those who want to extend speechd-el facilities or who just want to talk to speech synthesizers, Braille display or other output/input devices. @item Special features for speechd-el developers such as silence in debugger, debugging variables, possibility to disable speechd-el hooks, etc. @item Small code size. @end itemize See @uref{http://www.freebsoft.org/speechd-el,speechd-el web page} if you are interested in comparison with Emacspeak. @node Components, , Feature List, Introduction @section Components speechd-el design is strictly modular. It contains several components layered each on top of other. Lower layer functions can be used independently of higher level features. @cindex SSIP @cindex BrlAPI The lowest level components are access libraries to output devices, especially to SSIP (the Speech Dispatcher TCP communication protocol for speech output) and BrlAPI (interface to BRLTTY drivers for communication with Braille displays). They can be used to talk to the output devices directly from Elisp programs. The next level implements common access to all the devices. Instead of talking to each device independently one can use this layer to output device independent messages that are processed and sent to the output devices as defined in the user configuration. This is the preferred way of communication with the output devices. On the highest level there is the user interface frontend that makes Emacs read texts and events automatically, defines the corresponding minor modes, key bindings and most of the interactive commands. There are some other auxiliary components, look into speechd-el source code if interested. @c **************************************************************************** @node speechd-el User Manual, speechd-el Elisp Library, Introduction, Top @chapter speechd-el User Manual speechd-el allows you to use Emacs without looking at screen, with speech or Braille output only. The main usage area is by blind and visually impaired people, but generally you can use at least the speech output for many purposes, according to your wishes and needs. You can download the latest released version of speechd-el from @url{http://www.freebsoft.org/pub/projects/speechd-el/}. speechd-el uses Speech Dispatcher for the speech output, so working Speech Dispatcher installation is necessary to produce any speech output. Please look at @url{http://www.freebsoft.org/speechd} for more information about Speech Dispatcher. @cindex BRLTTY For the Braille output BRLTTY is used through its BrlAPI interface. To make the Braille output work, BRLTTY must be running and properly configured. Please look at @url{http://www.mielke.cc/brltty/} for more information about BRLTTY. @menu * Installation:: Installing speechd-el. * Starting Alternative Output:: Making it speak etc. * Commands:: Usage. * Customization:: Basic customization. * Advanced Customization:: Writing your own command feedbacks. * Problems:: Strange behavior. * Tips:: Useful Emacs tips. * Bug Reporting:: speechd-el and Speech Dispatcher bugs. @end menu @node Installation, Starting Alternative Output, speechd-el User Manual, speechd-el User Manual @section Installation speechd-el installation consists of the following steps: @enumerate @item If you use Emacs older than 23.2 then install the @samp{eieio} Elisp library, available from @url{http://cedet.sourceforge.net/eieio.shtml} or perhaps your favorite operating system distribution. @item Copy the speechd-el @file{*.el} files contained in the distribution package somewhere to your Emacs load path. @item If you like, byte compile the @file{*.el} files. Byte compilation is recommended, because it speeds up speechd-el significantly. You can byte compile the @file{*.el} files using the command @example make compile @end example Then install the compiled files to an Emacs load path location as well. @item Install the @file{speechd-log-extractor} somewhere to your shell PATH, e.g. @file{/usr/local/bin/}. Installing this script is optional, it is used only for bug reporting. @item Add the following line to your @file{~/.emacs}: @lisp (autoload 'speechd-speak "speechd-speak" nil t) @end lisp @end enumerate @cindex Speech Dispatcher To receive speech output, Speech Dispatcher must be installed and running. Speech Dispatcher version 0.5 or higher is recommended. @cindex BRLTTY To receive Braille output, BRLTTY must be installed and running. BRLTTY version 3.7 or higher is required. @node Starting Alternative Output, Commands, Installation, speechd-el User Manual @section Starting Speech and Braille Output After installation of the @file{*.el} files and restarting Emacs, you can set up speechd-speak using the @kbd{M-x speechd-speak} command. If you want to happen it automatically each time Emacs is started, put the following line to your @file{~/.emacs} after the autoload line: @lisp (speechd-speak) @end lisp @table @kbd @item M-x speechd-speak @findex speechd-speak @kindex C-e C-s Set up Emacs for alternative output and start speaking or communicating with the Braille display. Please don't forget Speech Dispatcher must be running in order to get any speech output and BRLTTY must be running in order to get Braille output! After the initial setup, the command can be used again to restart the speech or Braille output when needed. Especially, you must run it again if Speech Dispatcher or BRLTTY gets restarted. After the first invocation, the command is available under the @kbd{C-e C-s} key. @end table @cindex minor modes Once the setup is done, enabling and disabling the alternative output is controlled by the speechd-speak and global-speechd-speak minor modes. Usually the mode commands are not used directly, you use the @code{speechd-speak-toggle-speaking} command (@pxref{Control Commands}), but if you need them, they are available. @table @kbd @item M-x speechd-speak-mode @findex speechd-speak-mode Enable or disable speaking and Braille output in the current buffer. With no argument, this command toggles the mode. Non-null prefix argument turns on the mode. Null prefix argument turns off the mode. @item M-x global-speechd-speak-mode @findex global-speechd-speak-mode Enable or disable alternative output globally. With no argument, this command toggles the mode. With prefix argument, turn alternative output on if and only if the argument is positive. @end table @node Commands, Customization, Starting Alternative Output, speechd-el User Manual @section Commands The basic speechd-el commands are all accessible through a common special prefix key, which is @kbd{C-e} by default (you can change it, @pxref{Customization}). If this prefix conflicts with a global Emacs command, the original command is available by double pressing the prefix key. For instance, with the default prefix, the @code{end-of-line} command, normally available under the @kbd{C-e} key, can be invoked as @kbd{C-e C-e}. In the following subsections we use the term @emph{reading} to indicate any kind of output enabled in speechd-el (such as speaking or Braille output). @menu * Reading Commands:: Reading pieces of text. * Informatory Commands:: Information about buffer, modes, etc. * Control Commands:: Stopping, setting speech rate, etc. * Parameter Setting Commands:: Modifying speech output. * Spelling:: How to spell a piece of text. * Other Commands:: Auxiliary commands. @end menu @node Reading Commands, Informatory Commands, Commands, Commands @subsection Reading Commands @table @kbd @item C-e l @kindex C-e l @cindex truncate-lines @findex speechd-speak-read-line Read current line (@code{speechd-speak-read-line}). With the prefix argument, read the line only from the current cursor position to the end of line. If @code{truncate-lines} is @code{nil}, read the line only to its visual end. @item C-e b @kindex C-e b @findex speechd-speak-read-buffer Read current buffer (@code{speechd-speak-read-buffer}). @item C-e > @kindex C-e > @findex speechd-speak-read-rest-of-buffer Read current buffer from the cursor to the buffer end (@code{speechd-speak-read-rest-of-buffer}). @item C-e o @kindex C-e o @findex speechd-speak-read-other-window Read buffer of the other window, if any is present (@code{speechd-speak-read-other-window}). @item C-e r @kindex C-e r @findex speechd-speak-read-region Read current region (@code{speechd-speak-read-region}). @item C-e C-r @kindex C-e C-r @findex speechd-speak-read-rectangle Read text in the rectangle-region (@code{speechd-speak-read-rectangle}). @item C-e w @kindex C-e w @findex speechd-speak-read-word Read the next word after cursor (@code{speechd-speak-read-word}). @item C-e . @kindex C-e . @findex speechd-speak-read-sentence Read current sentence (@code{speechd-speak-read-sentence}). @item C-e @{ @kindex C-e @{ @findex speechd-speak-read-paragraph Read the next paragraph after cursor (@code{speechd-speak-read-paragraph}). @item C-e [ @kindex C-e [ @findex speechd-speak-read-page Read the next page after cursor (@code{speechd-speak-read-page}). @item C-e ' @kindex C-e ' @findex speechd-speak-read-sexp Read the next symbolic expression after cursor (@code{speechd-speak-read-sexp}). @item C-e c @kindex C-e c @findex speechd-speak-read-char Read the character at the cursor position (@code{speechd-speak-read-char}). @item C-e C-n @kindex C-e C-n @findex speechd-speak-read-next-line Read the next line (@code{speechd-speak-read-next-line}). @item C-e C-p @kindex C-e C-p @findex speechd-speak-read-previous-line Read the previous line (@code{speechd-speak-read-previous-line}). @item C-e m @kindex C-e m @findex speechd-speak-last-message Read last seen Emacs message (@code{speechd-speak-last-message}). @item C-e RET @cindex mode line @kindex C-e RET @findex speechd-speak-read-mode-line Read the mode line (@code{speechd-speak-read-mode-line}). Note: This command works only in Emacs@tie{}22 or higher. @item C-e i @kindex C-e i @findex speechd-speak-last-insertions Read last output buffer insertions (@code{speechd-speak-last-insertions}). That is the text read in auto-reading buffers, see @xref{Auto-Reading Buffers}. @end table @cindex character reading prompts @cindex read-char A few Emacs commands get you stuck in a character reading prompt, a typical example is @code{ispell-word}. If you miss what was read before you are prompted for action, you can use the following keystrokes at the prompt to repeat the output texts: @table @kbd @item C-e @findex speechd-speak-last-message The same as the @kbd{C-e m} command above (@code{speechd-speak-last-message}). @item C-a @findex speechd-speak-last-insertions The same as the @kbd{C-e i} command above (@code{speechd-speak-last-insertions}). @end table If you don't like such character reading prompt behavior, you can disable it using the following variable: @vtable @code @item speechd-speak-allow-prompt-commands If non-@code{nil}, allow the speechd-speak commands mentioned above in read-char prompts. @end vtable @node Informatory Commands, Control Commands, Reading Commands, Commands @subsection Informatory Commands @table @kbd @item C-e C-i b @findex speechd-speak-buffer-info @cindex buffer Read information about current buffer (@code{speechd-speak-buffer-info}). @item C-e C-i f @findex speechd-speak-frame-info @cindex frame Read information about current frame (@code{speechd-speak-frame-info}). @item C-e C-i h @findex speechd-speak-header-line-info @cindex header line Read contents of the header line (@code{speechd-speak-header-line-info}). Note: This command works only in Emacs@tie{}22 or higher. @item C-e C-i m @findex speechd-speak-mode-info @cindex modes Read information about current major and minor modes (@code{speechd-speak-mode-info}). @item C-e C-i c @findex speechd-speak-coding-info @cindex coding systems Read information about current coding systems (@code{speechd-speak-coding-info}). @item C-e C-i i @findex speechd-speak-input-method-info @cindex input method Read information about current input method (@code{speechd-speak-input-method-info}). @item C-e C-i p @findex speechd-speak-process-info @cindex process Read status of the process associated with the current buffer (@code{speechd-speak-process-info}). @end table @node Control Commands, Parameter Setting Commands, Informatory Commands, Commands @subsection Control Commands @table @kbd @item C-e q @kindex C-e q @findex speechd-speak-toggle-speaking @cindex shutting up Toggle reading globally (@code{speechd-speak-toggle-speaking}). With a prefix argument, toggle it in the current buffer only. @item C-e s @kindex C-e s @findex speechd-stop @cindex stop Stop reading current message (@code{speechd-stop}). Other queued messages will still be read. If the prefix argument is given, stop reading the current message of any client, not just of the current connection. @item C-e x @kindex C-e x @findex speechd-cancel @cindex stop Stop reading all the queued messages of the current connection and of the connections listed in @var{speechd-cancelable-connections}. If the universal prefix argument is given, stop reading all the messages of all connections. If a numeric prefix argument is given, stop all the messages of the current Emacs session. @item C-e p @kindex C-e p @findex speechd-pause @cindex pause Pause reading --- just be quiet for now and postpone current reading until the resume command is invoked (@code{speechd-pause}). If the prefix argument is given, pause reading of all clients. @item C-e SPC @kindex C-e SPC @findex speechd-resume @cindex resume Resume paused reading (@code{speechd-resume}). If the prefix argument is given, resume reading of all clients. @item C-e 1 @itemx C-e 2 @itemx C-e 3 @itemx C-e 4 @itemx C-e 5 @itemx C-e 6 @itemx C-e 7 @itemx C-e 8 @itemx C-e 9 @kindex C-e 1 @kindex C-e 2 @kindex C-e 3 @kindex C-e 4 @kindex C-e 5 @kindex C-e 6 @kindex C-e 7 @kindex C-e 8 @kindex C-e 9 @findex speechd-speak-key-set-predefined-rate @cindex rate Set one of the predefined speech rates (@code{speechd-speak-key-set-predefined-rate}). @kbd{C-e 1} sets the slowest rate, @kbd{C-e 5} sets the medium rate, and @kbd{C-e 9} sets the fastest rate. @end table @node Parameter Setting Commands, Spelling, Control Commands, Commands @subsection Parameter Setting Commands @cindex parameters These commands set various properties of the speech output. They all apply on the current Speech Dispatcher connection (for more information about Speech Dispatcher connections, @pxref{Connection Voices}), unless there are invoked with a prefix argument. With a numeric prefix argument they apply on all speechd-el connections, with a universal prefix argument they apply on all Speech Dispatcher connections. Commands affecting basic parameters of the text-to-speech process: @table @kbd @item C-e d l @kindex C-e d l @findex speechd-speak-set-language @cindex language Set default language of the connection. Specify it as an RFC 1766 language code (e.g. @code{en}, @code{cs}, etc.). @item C-e d . @kindex C-e d . @findex speechd-set-punctuation-mode @cindex punctuation mode Specify how to handle punctuation, whether to read it or ignore it. @code{all} mode reads all punctuation characters, @code{none} mode skips them all quietly, and @code{some} mode reads a selected subset of punctuation characters specified in the Speech Dispatcher configuration. @item C-e d c @kindex C-e d c @findex speechd-set-capital-character-mode @cindex capital character mode Set capital letter indication mode. @code{icon} means signal them with a sound icon, @code{spell} means spell them using a special spelling table, and @code{none} means no indication. @end table Commands affecting speech output properties: @table @kbd @item C-e d v @kindex C-e d v @findex speechd-set-voice @cindex voice Set default voice to be used by the synthesizer (@code{speechd-set-voice}). You may select one from the voice set offered by your Speech Dispatcher installation. @item C-e d C-v @kindex C-e d C-v @findex speechd-set-synthesizer-voice @cindex voice Set default voice to be used by the synthesizer directly by its synthesizer dependent name (@code{speechd-set-synthesizer-voice}). You may select one from the voice set offered by the currently selected Speech Dispatcher output module. This works only with Speech Dispatcher 0.6.3 or higher and not all Speech Dispatcher output modules support this function. @item C-e d r @kindex C-e d r @findex speechd-set-rate @cindex rate Set exact speech rate, ranging from -100 (slowest) to 100 (fastest) (@code{speechd-set-rate}). Most often you will probably want to use the @code{speechd-speak-key-set-predefined-rate} command bound to @kbd{C-e @var{number}} instead, see @ref{Control Commands}. @item C-e d p @kindex C-e d p @findex speechd-set-pitch @cindex pitch Set voice pitch, ranging from -100 (lowest) to 100 (highest) (@code{speechd-set-pitch}). @item C-e d V @kindex C-e d V @findex speechd-set-volume @cindex volume Set voice volume, ranging from -100 (lowest) to 100 (highest) (@code{speechd-set-volume}). @end table Commands affecting the speech synthesizer: @table @kbd @item C-e d o @kindex C-e d o @findex speechd-set-output-module @cindex output module Switch Speech Dispatcher to the given output module (@code{speechd-set-output-module}). Give the module name when you are prompted for the argument. @end table @node Spelling, Other Commands, Parameter Setting Commands, Commands @subsection Spelling @cindex spelling @cindex speechd-speak-spell-mode There are two ways to use spelling in speechd-el. The first one is the @code{speechd-speak-spell-mode}, which is a minor mode that you can enable for a buffer. The mode is useful if you want to spell more of the buffer contents. The second spelling method is using the following command: @table @kbd @item C-e C-l @kindex C-e C-l @findex speechd-speak-spell Cause the following command to spell the text it reads (@code{speechd-speak-spell}). For instance, if you want to spell the word after the cursor, you can type @kbd{C-e C-l C-e w}. @end table @node Other Commands, , Spelling, Commands @subsection Other Commands @kindex C-x C-c In case Emacs gets completely crazy and refuses to run commands including @kbd{C-x C-c} because of a bug in speechd-el or in an alternative output related custom definition, you can try to invoke the following command as the last resort: @table @kbd @item C-e C-x @kindex C-e C-x @findex speechd-unspeak @cindex recovery Try to disable all modes, hooks and wrappers installed by @code{speechd-speak} (@code{speechd-unspeak}). @end table The following commands are rarely used, mostly for diagnosing purposes: @table @kbd @item C-e z @kindex C-e z @findex speechd-repeat Repeat the last output text (@code{speechd-repeat}). @item M-x speechd-say-text @findex speechd-say-text Prompt for a text and read it. @end table @node Customization, Advanced Customization, Commands, speechd-el User Manual @section Customization All the customization options described below are accessible in the customization group @samp{speechd-el} and its subgroups. @menu * Driver Selection:: Choosing output devices. * Connection Setup:: Where to connect to. * Default Priorities:: Priorities of various kinds of messages. * Basic Speaking:: Simple options. * Auto-Reading Buffers:: Making certain buffers speak automatically. * Reading State:: Speaking Emacs state changes. * Signalling:: Signalling empty lines, etc. * Text Properties:: Handling faces and special pieces of text. * Index marking:: Moving cursor when speaking. * Languages:: Using multiple languages. * Voices:: Defining different voices. * Connection Voices:: Setting connection parameters. * Multiple Connections:: Different parameters for some modes & buffers. * Keys:: Customizing command keys. * Braille Display Keys:: Binding actions to Braille display keys. * Modes:: Minor mode hooks. * Debugging:: Make debugger quiet. @end menu @node Driver Selection, Connection Setup, Customization, Customization @subsection Selecting Drivers By default speechd-el speaks to @code{ssip} and @code{brltty} drivers. You can change the set of active drivers by customizing the following variable: @vtable @code @item speechd-out-active-drivers List of names of active output drivers. @end vtable If a driver that does not work is present in the variable (e.g. the list contains the @code{brltty} symbol while BRLTTY is not actually running), you receive an error message. To prevent the error message, remove the driver from this variable. When you want to enable or disable some driver temporarily, you can use the following commands: @ftable @kbd @item M-x speechd-out-enable-driver @findex speechd-out-enable-driver Enable the given output driver. @item M-x speechd-out-disable-driver @findex speechd-out-disable-driver Disable the given output driver. @end ftable @node Connection Setup, Default Priorities, Driver Selection, Customization @subsection Speech Dispatcher Connection Configuration Connection configuration variables allow you connect to Speech Dispatcher or BRLTTY running on a remote host or a non-default port and to specify other TCP connection parameters. Speech Dispatcher connection options: @vtable @code @item speechd-connection-method Connection method to Speech Dispatcher. Possible values are symbols @code{unix-socket} for Unix domain sockets and @code{inet-socket} for Internet sockets on a given host and port. @item speechd-host @cindex host Name of the host running Speech Dispatcher to connect to, given as a string. Default is either the contents of the shell variable @code{SPEECHD_HOST} variable if set, or @code{"localhost"}. Value of this variable matters only when Internet sockets are used for communication with Speech Dispatcher. @item speechd-port @cindex port Port number to connect to. Default is either the contents of the shell variable @code{SPEECHD_PORT} if set, or the default Speech Dispatcher port. Value of this variable matters only when Internet sockets are used for communication with Speech Dispatcher. @item speechd-autospawn If non-@code{nil}, Emacs will attempt to automatically start Speech Dispatcher. This means that if speechd-el gets a speech request and the Speech Dispatcher server is not running already, speechd-el will launch it. @item speechd-timeout @cindex timeout Maximum number of seconds to wait for a Speech Dispatcher answer. If it is exceeded, speechd-el closes the connection. Normally, Speech Dispatcher should answer protocol commands immediately, but if you talk to a Speech Dispatcher in a strange way through a lagging network, you may want to increase the limit. @end vtable BRLTTY connection options: @vtable @code @item brltty-default-host Name of the host running BRLTTY to connect to, given as a string. Default is @code{"localhost"}. @item brltty-default-port Port number to connect to. It can be either a single number or a list of numbers; in the latter case the given port numbers are attempted in the order they are given until Emacs connects to something. Default is the list of the standard BrlAPI ports. @item brltty-authentication-file File containing the BrlAPI authentication key. It is important to set the variable properly, otherwise the connection to BRLTTY gets rejected. Default is @code{"/etc/brlapi.key"}. @item brltty-coding Coding in which texts should be sent to BRLTTY. Default is @code{iso-8859-1}; if you use non-Western language, you may need to change it to display its characters correctly on the Braille display. @item brltty-tty Number of the Linux console on which speechd-el runs. If this value is not set correctly, speechd-el may not interact well with other applications communicating with BRLTTY. speechd-el tries to find the correct value itself, if this doesn't work, set this variable properly or set the @code{CONTROLVT} environment variable. @item brltty-timeout Maximum number of seconds to wait for a BRLTTY answer. If it is exceeded, speechd-el closes the connection. Normally, BRLTTY should answer protocol commands immediately, but if you talk to BrlAPI in a strange way through a lagging network, you may want to increase the limit. @end vtable @node Default Priorities, Basic Speaking, Connection Setup, Customization @subsection Default Priorities @cindex priorities If a speechd-el function sends a message to the output device without an explicitly specified priority, the priorities defined by the following variables are used. By changing the values, you can achieve interesting effects. For instance, changing the value of @code{speechd-default-key-priority} from @code{notification} to @code{message} makes all typed characters to be echoed and makes them to interrupt common text reading. The valid values of all the variables here are: @code{important}, @code{message}, @code{text}, @code{notification}, @code{progress}. They correspond to Speech Dispatcher priorities, see the Speech Dispatcher manual for more details. @vtable @code @item speechd-default-text-priority Default priority of most text messages. @item speechd-default-sound-priority Default priority of sound icons. @item speechd-default-char-priority Default priority of spelled characters. @item speechd-default-key-priority Default priority of typed keys. @end vtable @node Basic Speaking, Auto-Reading Buffers, Default Priorities, Customization @subsection Basic Customization of Speaking @vtable @code @item speechd-speak-echo @cindex echoing Symbol determining how to read typed characters. It can have one of the following values: @table @code @item character Read characters when they are typed. @item word Read only whole words once they are written. @item nil Don't echo anything on typing. @end table @item speechd-speak-deleted-char @cindex deletions Defines which character to speak when deleting a character. If non-@code{nil}, speak the deleted character, otherwise speak the adjacent character. @item speechd-speak-buffer-name @cindex buffer names When you switch to another buffer and this variable is non-@code{nil}, read the new buffer name. If the variable value is the symbol @code{text}, read the text from the cursor position to the end of line in the new buffer as well. If the variable is @code{nil}, read the text without speaking the buffer name. @item speechd-speak-whole-line @cindex line reading If non-@code{nil}, read whole line on movement by default. Otherwise read from the point to the end of line on movement by default. @item speechd-speak-on-minibuffer-exit @cindex minibuffer When this variable is non-@code{nil}, speechd-el reads the text around cursor after exiting from minibuffer or its recursive level if there is nothing else to read. @item speechd-speak-read-command-keys @cindex command keys @cindex keys This variable defines in which situations command keys should be read when their command is performed. If @code{t}, the command keys are always read. If @code{nil}, they are never read. If list, it may contain one or more of the following symbols describing the situations in which the keys should be read: @table @code @item movement Read the command keys if the cursor has moved, no buffer modification happened. @item modification Buffer was modified, the cursor hasn't moved. @item movement-modification Buffer was modified and the cursor was moved. @end table If the variable value is @code{t}, the command keys are read before the command is performed. Otherwise, their reading is delayed after the command is executed, since the buffer changes and cursor movement must be detected first. @item speechd-speak-ignore-command-keys @cindex command keys @cindex keys List of commands that should never echo their command keys. @item speechd-speak-read-command-name @cindex command name If non-@code{nil}, read the command name instead of the command keys in the situations defined by the variable @code{speechd-speak-read-command-keys}. @item speechd-speak-message-time-interval @cindex messages @cindex repeating Minimum time in seconds, after which the same message may be repeated. If the message is the same as the last one, it is not spoken unless the number of seconds defined here has passed from the last spoken message. @end vtable @node Auto-Reading Buffers, Reading State, Basic Speaking, Customization @subsection Auto-Reading Buffers @cindex buffers @cindex inserted text It sometimes useful to start reading some buffers without user's explicit request. For instance, if a help command is invoked, the user usually wants to read the help text immediately. The following variables contain lists of names of the buffers that may be read automatically if they get changed by the last command and are visible in some window of the current frame. @vtable @code @item speechd-speak-auto-speak-buffers Content of these buffers is read after the command on the above conditions if nothing else (e.g. text around a new cursor position) is to be read. @item speechd-speak-force-auto-speak-buffers Like @code{speechd-speak-auto-speak-buffers} except that the buffer content is read forcibly, even when something else could be read. @end vtable The following variables define how to handle texts inserted during performing user commands. Only newly inserted text is read, the options don't affect processing of deleted text. Also, the options don't affect insertions within commands processed in a special way by speechd-el or user definitions, like @code{self-insert-command}. @vtable @code @item speechd-speak-buffer-insertions Defines whether insertions in the current buffer should be read automatically. The value may be one of the following symbols: @table @code @item nil Don't read the inserted texts. @item t Read all the inserted texts. @item one-line Read only the first lines of inserted texts. @item whole-buffer Read whole buffer if it was modified in any way. @end table @item speechd-speak-insertions-in-buffers List of names of buffers, in which insertions are automatically read, whether the buffer is current or not and regardless the @code{speechd-speak-buffer-insertions} variable. @item speechd-speak-priority-insertions-in-buffers List of names of buffers, in which insertions are automatically read immediately as they appear, not only after a command is evaluated as with @code{speechd-speak-insertions-in-buffers}. This is typically useful in comint buffers. @item speechd-speak-align-buffer-insertions If non-@code{nil}, the insertion text to be read is extended to the beginning of the first word affected by the insertion. This is particularly useful in completion functions. @end vtable If the last command modified the current buffer and moved its cursor to a completely different position, the new cursor position is not indicated in the alternative output. You can change it through the following variable: @vtable @code @item speechd-speak-movement-on-insertions If @code{t}, read the text around new cursor position even when the current buffer was modified. If @code{read-only}, read it only in read-only buffers. If @code{nil}, don't read it. @end vtable @node Reading State, Signalling, Auto-Reading Buffers, Customization @subsection Reading State Changes speechd-el can read information about current Emacs state, like current buffer name, major and minor modes or other buffer attributes, see @xref{Informatory Commands}. Changes in the Emacs state information can be reported automatically, according to the user configuration: @vtable @code @item speechd-speak-state-changes List of identifiers of the Emacs state changes to be automatically reported. The following symbols are recognized as state change identifiers: @table @code @item buffer-name @item buffer-identification (only in Emacs@tie{}22 or higher) @item buffer-modified @item buffer-read-only @item frame-name @item frame-identification (only in Emacs@tie{}22 or higher) @item header-line (only in Emacs@tie{}22 or higher) @item major-mode @item minor-modes @item buffer-file-coding @item terminal-coding @item input-method @item process @end table @item speechd-speak-display-modes List of minor modes to be read by their display string rather than name. To use the display form of a mode identification may be useful in cases when the display form is more concise than the mode name or when the display form changes without actual change of the mode. @end vtable @node Signalling, Text Properties, Reading State, Customization @subsection Signalling @cindex icons Certain situations may be signalled by icons. @dfn{Icon} is typically a short sound or a special indication on a Braille display@footnote{Icons are not yet implemented this way in the Braille library, plain texts are displayed instead.} signalling some event (such as displaying a message, entering prompt, or reaching an empty line). The following variable enables or disables the predefined indications. To learn how to define your own indications, @xref{Advanced Customization}. @vtable @code @item speechd-speak-signal-events List of symbols, containing names of events to signal with an icon. The following event names are supported: @table @code @item start Start or restart of speechd-el. @item empty @cindex empty text Empty text in various situations. @item beginning-of-line @cindex line @cindex beginning of line Reaching beginning of line after the @code{forward-char} and @code{backward-char} commands. @item end-of-line @cindex end of line Reaching end of line after the @code{forward-char} and @code{backward-char} commands. @item minibuffer Entering minibuffer. @item message Messages in echo area follow. @end table @end vtable @node Text Properties, Index marking, Signalling, Customization @subsection Text Properties @cindex text properties @cindex faces @cindex cursor @cindex movement By default, after a movement command speechd-el reads the current line. But if the cursor position is surrounded by a text having text properties (typically faces, but any text properties count), speechd-el may read just the piece of the text around the cursor having uniform properties. Also, if font lock mode is enabled, faces may be mapped to different voices. @vtable @code @item speechd-speak-by-properties-on-movement Method of selection of the piece of text to be read on movement. The variable may take one of the following values. @table @asis @item @code{nil} Text properties are not considered at all. @item @code{t} All text properties are considered. @item list of faces Only the named faces are considered. @end table @item speechd-speak-by-properties-always List of commands that always consider text properties, even when the @code{speechd-speak-by-properties-on-movement} variable is @code{nil}. @item speechd-speak-by-properties-never List of commands that never consider text properties, even when the @code{speechd-speak-by-properties-on-movement} variable is non-@code{nil}. @item speechd-speak-faces This variable allows you to invoke actions when the cursor ends up on a certain face after a user command is performed. The variable value is an alist with elements of the form @code{(@var{face} . @var{action})}. If a movement command leaves the cursor on a @var{face} and there is no explicit reading bound to the command, @var{action} is invoked. If @var{action} is a string, that string is read. If @var{action} is a function, it is invoked, with no arguments. @item speechd-face-voices Mapping of faces to voices. The variable value is an alist with elements of the form @code{(@var{face} . @var{voice})} where @var{face} is a face and @var{voice} is a voice identifier defined in @code{speechd-voices}, see @ref{Voices}. Each face is spoken in the corresponding voice. If there's no item for a given face in this variable, the face is spoken in the current voice. Note that the mapping takes the effect only if font lock mode is enabled. @end vtable @node Index marking, Languages, Text Properties, Customization @subsection Index marking @cindex index marking @cindex cursor movement Reading a text with index marking means the cursor is moved over the text as the text is read, whenever an inserted index mark is reached. Index marking is switched off by default but you can set it up for @code{speechd-speak-read-buffer} and @code{speechd-speak-read-rest-of-buffer} commands using the following variables: @vtable @code @item speechd-speak-use-index-marks If non-@code{nil}, index marking is enabled for @code{speechd-speak-read-buffer} and @code{speechd-speak-read-rest-of-buffer} commands. @item speechd-speak-index-mark-regexp Regular expression defining the places where to put index marks to. An index mark is put at the end of the regexp at each of the places. If the regular expression is empty (the default), it's taken from @code{sentence-end} variable. If @code{sentence-end} is @code{nil}, a default regular expression matching common punctuation is used. @end vtable @node Languages, Voices, Index marking, Customization @subsection Using multiple languages @cindex languages You can use speechd-el with multiple languages. However, the process can't be easily automated, since ordinary text does not contain any information about its language. So if you want to use speechd-el with the output being spoken in multiple languages, you must provide speechd-el some hints. The language settings described below currently apply only to the spoken output, to select the proper voice. They don't affect the Braille output; but you may want to set language coding for Braille, @xref{Connection Setup}. @vindex speechd-language @cindex RFC 1766 The basic means for providing language information to speechd-el is the variable @code{speechd-language}. Each time speechd-el is about to speak a piece of text, it checks the variable for the language code and if it is non-@code{nil}, it speaks the text in the corresponding language. The non-@code{nil} value must be a string of the RFC 1766 language code (e.g. @code{en}, @code{cs}, etc.). Most often you will probably want to set the variable in a particular file, see @ref{File Variables,,,emacs,GNU Emacs Manual}, or as a buffer local variable, see @ref{Locals,,,emacs,GNU Emacs Manual}, in mode hooks, see @ref{Hooks,,,emacs,GNU Emacs Manual}. @findex speechd-language @cindex @code{language} text property If a piece of the text has the @code{language} property containing the RFC 1766 language code, it is spoken in the corresponding language, regardless of other settings. You can use the @code{speechd-language} function to put the property on a string in your Elisp programs. Another good way of using multiple languages is to use multiple connections for separating language dependent buffers or modes, see @ref{Multiple Connections}, and to set the @code{language} parameter for each such a connection, see @ref{Connection Voices}. If nothing helps better, you can select languages according to the current input method: @vtable @code @item speechd-speak-input-method-languages Alist mapping input methods to languages. Each of the alist elements is of the form @code{(@var{input-method-name} . @var{language})}, where @var{input-method-name} is a string naming the input method and @var{language} is an RFC 1766 language code accepted by SSIP (e.g. @code{en}, @code{cs}, etc.). If the current input method is present in the alist, the corresponding language is selected unless overridden by another setting. @end vtable @vindex speechd-speak-emacs-language Some texts in Emacs, such as messages, minibuffer prompts or completions, are typically in English. speechd-el reads them in English by default, but it can be instructed to use another language for them: @vtable @code @item speechd-speak-emacs-language Language to use for texts originating from Emacs. It's a string containing an RFC 1766 language code accepted by SSIP, @code{en} by default. It can be also @code{nil}, meaning the language should be unchanged and the current language should be used. @end vtable @node Voices, Connection Voices, Languages, Customization @subsection Defining voices @cindex voices @cindex parameters You can define special voices in speechd-el that can be used in different situations, e.g. to speak different faces in different voices (@pxref{Text Properties}) or to set different punctuation modes for different kinds of buffers (@pxref{Multiple Connections}). speechd-el voices define not only basic voice characteristics, but also speech characteristics like pitch or rate and special properties like punctuation reading or capital character signalization. Voice definition is contained in the following variable: @vtable @code @item speechd-voices Alist of voice identifiers and their parameters. Each element of the list is of the form @code{(@var{voice-id} . @var{parameters})}, where @var{voice-id} is a symbol under which the voice will be accessed and @var{parameters} is an alist of parameter identifiers and parameter values. Valid parameter names are the following symbols: @code{language}, @code{gender}, @code{age}, @code{style}, @code{name}, @code{rate}, @code{pitch}, @code{volume}, @code{punctuation-mode}, @code{capital-character-mode}, @code{message-priority}, @code{output-module}. Please note that any parameter entry present will change the corresponding parameter, even if the parameter value is @code{nil} or empty; if you don't want to change the parameter in any way by the voice, don't put it to the list (and don't enable its entry in customize). @code{name} value is a string identifying Speech Dispatcher voice name. If it is not given, the parameters @code{gender}, @code{age}, and @code{style} are considered to select a Speech Dispatcher voice. @code{gender} value can be one of the symbols @code{male}, @code{female}, @code{neutral}. @code{age} can be one of the symbols @code{middle-adult}, @code{child}. @code{neutral}. @code{style} can be one of the numbers @code{1}, @code{2}, @code{3} (@code{style} values are likely to be changed in future). The @code{message-priority} parameter sets priority of any message of the voice. Its value is any of the message priority symbols. See the corresponding @code{speechd-set-*} functions for valid values of other parameters. The voice named @code{nil} is special, it defines a default voice. Explicit definition of its parameters is optional. @end vtable @node Connection Voices, Multiple Connections, Voices, Customization @subsection Connection Voices @cindex voices With the help of the following variable you can let set various connection parameters, like speech rate, language, etc., automatically. speechd-el can open multiple connections according to various criteria (@pxref{Multiple Connections}), you can set different parameters to different connections, based on their names. @vtable @code @item speechd-connection-voices Alist of connection names and corresponding voices. Each list element is of the form @code{(@var{connection-name} . @var{voice})}, where @var{connection-name} is a connection name given as a string and @var{voice} is a voice identifier defined in the variable @code{speechd-voices}. The default voice (named @code{nil}) is used for connections that are not present in this variable. @end vtable So that changing the value of the variable could take the full effect, the open connections must be reopened. Unless you use the customization interface, you must invoke the @kbd{C-u M-x speechd-speak} command to ensure this. There is a command to help you with setting connection voice and its parameters: @table @kbd @item C-e C-a @kindex C-e C-a @findex speechd-add-connection-settings Store the current connection parameters to a specified voice in the @code{speechd-voices} variable and set that voice for the current connection in the @code{speechd-connection-voices} variable. Please note you are still responsible to save the variables if you want to use them in future sessions. @end table @node Multiple Connections, Keys, Connection Voices, Customization @subsection Multiple Connections @cindex connections You can arrange speechd-el to use separate connections to Speech Dispatcher for certain buffers or major modes. This is basically useful to allow independent parameter setting for those buffers and major modes, both by hand and through the configuration (@pxref{Connection Voices}). Each Speech Dispatcher connection has its unique name. By default, speechd-el uses a connection named @code{"default"}. All you need to create a separate connection is to let speechd-el choose a different connection name in certain situations. The process of connection name selection is driven by the @code{speechd-speak-connections} variable. @vtable @code @item speechd-speak-connections Alist mapping major modes and buffers to Speech Dispatcher connections. Each element of the alist is of the form @code{(@var{mode-or-buffer} . @var{connection-name})}. When speechd-el wants to send a message, it tests the current environment against the @var{mode-or-buffer} entries. @var{mode-or-buffer} may be one of the following objects, in the order of priority from the highest to the lowest: @itemize @bullet @item a list, representing a function call that should return a non-@code{nil} value if and only if the element should be applied @item regular expression matching desired buffer names @item the symbol @code{:minibuffer}, representing minibuffers @item major mode symbol @item @code{nil}, representing non-buffer areas, e.g. echo area @item @code{t}, representing the default value if nothing else matches @end itemize If more entries match in some situation, the entry with the highest priority is used. @var{connection-name} is an arbitrary non-empty string naming the corresponding connection. If no connection with such a name is open in the running speechd-el, it is automatically created when there's something to send to it. @item speechd-cancelable-connections @cindex stop List of names of connections that are cancelled by default when a cancel function is called. @end vtable @node Keys, Braille Display Keys, Multiple Connections, Customization @subsection Keys @cindex keys @cindex prefix key @cindex key map The command keys of speechd-el are defined by the @code{speechd-speak-prefix} variable and the @code{speechd-speak-mode-map} key map. @vtable @code @item speechd-speak-prefix This variable defines the prefix key of the speechd-el commands, which is @kbd{C-e} by default. If you change the variable value after speaking has already been started through the @code{speechd-speak} command and you do not set it through the customization interface, you must rerun the @code{speechd-speak} so that the change took any effect. @item speechd-speak-mode-map This key map holds the mapping of the keys following the prefix key. You can set keys here in the usual way, e.g. @lisp (define-key speechd-speak-mode-map "t" 'speechd-say-text) @end lisp to get the @code{speechd-say-text} command bound to the @code{C-e t} key (assuming @code{C-e} is the prefix key). @end vtable @node Braille Display Keys, Modes, Keys, Customization @subsection Braille Display Keys @cindex Braille keys When using Braille display output, speechd-el can bind actions to the Braille display keys. The Braille key bindings are defined in the following variables: @vtable @code @item speechd-braille-key-functions Alist of Braille display key codes and corresponding Emacs functions. If the given key is pressed, the corresponding function is called with a @code{speechd-brltty-driver} instance as its single argument (read the source code for information about speechd-el output drivers). The key codes are either integers (for BRLTTY 3.7 and older) or lists containing three integers (for BRLTTY 3.8 and newer). See the default variable value for examples of possible key codes. The assigned functions needn't be interactive. Actually as the functions may be invoked by asynchronous events any time at any place, they shouldn't modify current environment in any inappropriate way. For this reason it is recommended @emph{not} to assign user commands to the keys here. @file{speechd-brltty.el} contains some predefined functions that can be assigned to the Braille display keys here: @cindex Braille functions @ftable @code @item speechd-brltty-scroll-left Scroll towards the beginning of the currently displayed message. @item speechd-brltty-scroll-right Scroll towards the end of the currently displayed message. @item speechd-brltty-scroll-to-bol Scroll to the beginning of the currently displayed message. @item speechd-brltty-scroll-to-eol Scroll to the end of the currently displayed message. @item speechd-brltty-scroll-to-cursor Scroll to the cursor position (if any) in the displayed message. @item speechd-brltty-finish-message Stop displaying the current message and display the next one. @item speechd-brltty-cancel Stop displaying the current message and discard all messages waiting in the queue. @item speechd-brltty-previous-message Display the previous message from the history. @item speechd-brltty-next-message Display the next message from the history. @item speechd-brltty-first-message Display the first message in the history. @item speechd-brltty-last-message Display the last message in the history. @end ftable Additionally, the following macro is provided: @ftable @code @item speechd-brltty-command-key-function @var{key} Insert function for handling @var{key} as a general input key. This is useful for handling Braille keys acting as general character input keys. @end ftable The @code{speechd-braille-key-functions} variable contains some default bindings initially, but as the keys and their codes differ a lot for various Braille displays, you probably need to adjust it for your particular device. You can figure out the display key codes by setting the @code{speechd-braille-show-unknown-keys} variable to @code{t} and pressing the display keys. @item speechd-braille-show-unknown-keys If non-@code{nil}, show codes of the pressed Braille keys that have no function assigned in @code{speechd-braille-key-functions}. This is useful to figure out the Braille key codes. @end vtable With BrlTTY 3.8 and higher BrlTTY can handle many braille keys itself in X environment. So speechd-el doesn't try to handle most keys itself by default. Instead it handles only keys assigned in @code{speechd-braille-key-functions}. If this is a problem, typically when looking for braille key codes, the following command can be useful: @table @kbd @item C-e C-b k @kindex C-e C-b k @findex speechd-speak-toggle-braille-keys Toggle handling braille keys by speechd-el. If BrlTTY handles the keys (this is the default behavior), speechd-el receives only keys which are assigned to commands in @code{speechd-braille-key-functions}. If speechd-el handles the keys, then BrlTTY sends all the pressed keys to speechd-el without processing them itself. @end table @node Modes, Debugging, Braille Display Keys, Customization @subsection Minor mode hooks @cindex minor modes @cindex hooks speechd-el provides a minor mode that enables and disables the reading, @xref{Starting Alternative Output}. You can let perform custom actions on entering it through the following hook. @vtable @code @item speechd-speak-mode-hook Hook run when speechd-speak minor mode is enabled. @end vtable @node Debugging, , Modes, Customization @subsection Debugging speechd-el @cindex debugging When you try to debug speechd-speak functions, you can experience the problem of recursive reading in the Elisp debugger. To avoid it, you can instruct speechd-el to be quiet in Elisp debuggers: @vtable @code @item speechd-speak-in-debugger If @code{nil}, speechd-speak functions won't be reading in Elisp debuggers. @end vtable @node Advanced Customization, Problems, Customization, speechd-el User Manual @section Defining Your Own Command Feedbacks @cindex extensions Writing your own feedback definitions generally requires knowledge of Elisp programming. But don't be afraid, you can set basic things without it, just following instructions here. speechd-el allows you to say a text, output an icon, or call any Elisp expression before or after a command or a function is invoked. There are two macros that allow you to do it, while ensuring everything is set up properly: @ftable @code @item speechd-speak-command-feedback @var{command} @var{position} @var{feedback} Install feedback invocation on @var{command}. @code{command} is a name of an interactive function (use @kbd{C-h C-c} to get a name of the command bound to a given key). @var{position} may be one of the symbols @code{before} and @code{after} to call the feedback before or after the command is invoked. @code{feedback} may be a string or any Elisp expression. If it is a string (a text enclosed in double quotes), it defines a text to be spoken or a sound icon to be played. If the string starts with an asterisk (@code{*}), it names a sound icon (the asterisk is not a part of the name), otherwise it is a normal text. Example: @cindex @code{suspend-emacs} @lisp (speechd-speak-command-feedback suspend-emacs before "Suspending Emacs!") @end lisp You can put this line of Elisp code to your @file{~/.emacs} to ensure you are informed when you invoke the @code{suspend-emacs} command (usually bound to @kbd{C-z}). @item speechd-speak-function-feedback @var{function} @var{position} @var{feedback} This is the same as @code{speechd-speak-command-feedback}, except it is called anytime the given function is invoked, whether interactively or not. Also, @var{function} may be any function, not only an interactive command. @end ftable @emph{Please note:} @itemize @bullet @item Due to Emacs deficiency, the feedback mechanism may not work on built-in functions. @item Be careful if you want to install function feedbacks without help of the macros above. The macros install code ensuring nothing is spoken if @code{speechd-speak-mode} is disabled and other similar precautions. If you do not use them, you should make those precautions yourself. @end itemize @node Problems, Tips, Advanced Customization, speechd-el User Manual @section Problems You May Encounter @cindex problems @itemize @bullet @cindex Info @item @emph{Why are some menu items in Info not read?} This is due the way how Emacs fontifies the menu items. Try to set the @code{Info-fontify-maximum-menu-size} variable to @code{0} to avoid the problem. @cindex appointments @cindex diary @item @emph{How to make appointments read their notifications?} Set the variable @code{appt-msg-window} to @code{nil}. Also, adding @code{"diary"} to the @code{speechd-speak-auto-speak-buffer} variable may be useful. @cindex w3m-el @cindex URL speaking @item @emph{How to avoid printing URL when moving through links in w3m-el?} Add the following code to your @file{~/.emacs}: @lisp (defadvice w3m-print-this-url (around my-w3m-print-this-url activate) (when (eq this-command 'w3m-print-this-url) ad-do-it)) @end lisp @cindex TAB characters @item @emph{How to avoid excessive occurrences of TAB (C-i) and NL (C-j) characters on a Braille display in some buffers (e.g. @code{*Completion*} buffer)?} Braille displays generally display exact content, which is usually what you want. But sometimes TAB characters are inserted to Emacs buffers for the sole purpose of visual formatting. You can tell Emacs to suppress this behavior when possible by adding the following code to your @file{~/.emacs}: @lisp (setq-default indent-tabs-mode nil) @end lisp @cindex repeated reading @item @emph{In some situations, when a modified text is read after performing a command, the text is read in separate pieces and some of the pieces are repeated.} Buffer modifications can be performed by many different ways in Elisp programs. speechd-el is unable to track them always satisfactory. If you have a reasonable idea how to improve buffer modification reading, please tell us. As a workaround, if you encounter this problem when performing some often used commands, you might want to define your own speaking feedbacks of those commands. @xref{Advanced Customization}, for more details. @cindex delays @cindex garbage collection @cindex @code{gc-cons-threshold} @item @emph{There are sometimes small delays (about 1 second) before something is read after a command.} Maybe Emacs is garbage collecting in the meantime. Try to increase the value of the @code{gc-cons-threshold} variable, e.g. to 4000000. It may increase or reduce the performance, depending on your environment and particular requirements. If you didn't byte compile the source @file{*.el} files, do so. If you are an experienced Elisp hacker and you can find out why speechd-el produces significant amount of data increasing the frequency of garbage collection and how to make the things better, your help is welcome! @item @emph{During holding down the @kbd{C-n} key, the screen gets frozen and the cursor doesn't move for a while.} Emacs redisplay routines are generally not invoked when Emacs is busy. speechd-el combined with your autorepeat may achieve such a state quite easily. If that's a real problem to you, you can reduce your autorepeat rate or buy a faster computer. Also, if you didn't byte compile the source @file{*.el} files, do so. Certainly, any tips increasing speechd-el performance are welcome. @end itemize @node Tips, Bug Reporting, Problems, speechd-el User Manual @section Useful Emacs tips Don't forget that Elisp allows you to define many useful functions. Typically, you may want to define commands reporting some information, which can be easily identified on the Emacs screen, but which is not so easily provided in the standard speech output interface. Some examples: @itemize @bullet @item @emph{Reporting current date in calendar:} @cindex day in calendar @lisp (defun report-day () (interactive) (message "%s" (calendar-date-string (calendar-cursor-to-date t)))) @end lisp @item @emph{Reporting current diary appointments:} @cindex appointments @lisp (defun report-current-appointments () (interactive) (let ((appt-now-displayed nil)) (appt-check))) @end lisp @item @emph{Reviewing ispell choices} @cindex ispell When you invoke the @code{ispell-word} command and the checked word is mispelled, ispell offers you the list of alternative spellings. You can let speechd-el repeat the list by pressing @kbd{C-a} in the ispell prompt. When you want to review the choices closely, press @kbd{C-r} to enter recursive edit and then switch to the @code{*Choices*} window with @kbd{C-x o}. After you review the choices, you can return back to the ispell prompt by pressing @kbd{C-M-c}. @end itemize @node Bug Reporting, , Tips, speechd-el User Manual @section How to Report speechd-el or Speech Dispatcher Bugs @cindex bug reporting When you encounter a speechd-el bug, you can report it to us using the following command. Before doing it, please read the whole text of this section to allow handling your bug report in a more efficient way. @ftable @kbd @item M-x speechd-bug @findex speechd-bug Report a speechd-el or Speech Dispatcher bug. The command asks you for some information and then asks you whether you can reproduce the bug. If you can, answer @kbd{y} and start reproducing the bug immediately. As soon as the bug is reproduced, type @kbd{C-e C-f}. Then you can (and should) further edit the generated mail and send it in the usual way. @item M-x speechd-bug-reproduce @findex speechd-bug-reproduce @kindex C-e C-f Start reproducing a speechd-el or Speech Dispatcher bug. All user and Speech Dispatcher actions are watched from this moment. Bug reproduction is finished by pressing the @kbd{C-e C-f} keys. After the bug reproduction is finished, information about it is inserted into the buffer where the @code{speechd-bug-reproduce} command was invoked. This command is useful when you want to provide information about a bug without generating new bug report. @end ftable When reporting the bugs, please always remember the following instructions: @itemize @bullet @item Write as much information about the problem as possible. Describe what doesn't work, what's the expected behavior, what actions have triggered the bug, what's special about your Emacs environment or Speech Dispatcher configuration, etc. Don't try to analyze too much which information is important and which is not --- everything may be important to the developers, so try not to forget to mention anything that might be important, better more than less. Missing information may cause the developers won't be able to handle the bug at all. @item Be as much precise as possible. Don't expect the developers to know the context or to know the way you typically use Emacs and speechd-el. Write in exact terms --- instead of just writing ``when I invoke foo'' write better ``when I press the keys `M-x foo RET', thus invoking the `foo' command''; or instead of writing ``doesn't speak what I expect'' write like ``speaks `blah blah' instead of `bleh bleh bleh' what is I expect, since `bleh bleh bleh' is the text of the whole line''. @item When reproducing the bug, try to have the Speech Dispatcher logging enabled to the highest level --- set the @code{LogLevel} option to @code{5} in your @file{speechd.conf} configuration file. @item When reproducing the bug, don't do any extra actions and invoke @kbd{C-e C-f} as soon as the bug is reproduce. Thus you avoid losing the relevant information of the automatically extracted log files in an unnecessary garbage. @item You can also look at the Speech Dispatcher bug reporting instructions, see @ref{Reporting Bugs,,,speechd,Speech Dispatcher}. @end itemize @c **************************************************************************** @node speechd-el Elisp Library, Contact Information, speechd-el User Manual, Top @chapter speechd-el Emacs Lisp Library The speechd-el code can be classified into several parts: @itemize @bullet @item Low-level libraries for Speech Dispatcher and BrlAPI access implemented in the files @file{speechd.el} and @file{brltty.el}. @item General device independent output mechanism defined in the @file{speechd-out.el} file. Its particular device implementations are in the files @file{speechd-ssip.el} and @file{speechd-brltty.el}. @item User interface implemented in @file{speechd-speak.el}. @end itemize You can use the libraries to communicate with Speech Dispatcher, BRLTTY or other devices in your own programs. Right now, there's no real programmer's manual to the libraries. Please read docstrings of available variables, functions and macros. Nevertheless, here are some instructions you can and should follow: @itemize @bullet @item Don't use any functions, variables or other Lisp objects, names of which start with prefixes separated by double dashes (such as @code{speechd--} or @code{speechd-speak--}). These objects are considered private and may change incompatibly or disappear at any time without notice. @item @vindex speechd-client-name If you want to select or create a particular SSIP connection, do so by binding the @code{speechd-client-name} variable: @lisp (let ((speechd-client-name "something")) ... the code using the connection "something" ... ) @end lisp Please note it's usually bad idea to open two concurrent Speech Dispatcher connections sharing the same client name. @item Otherwise there should be no special pitfalls and you should be safe to do anything what makes sense. @end itemize You can also look at @ref{Advanced Customization}. @c **************************************************************************** @node Contact Information, Copying This Manual, speechd-el Elisp Library, Top @chapter Contact Information @cindex authors @cindex bugs @cindex contact If you want to report a bug on speechd-el, send complete information regarding the bug to the bug tracking address @email{speechd-discuss@@nongnu.org}. If you have a patch to speechd-el, you can send it to the same address. @emph{Please}, before sending us any bug report, read the bug reporting instructions, see @ref{Bug Reporting}. Thus you allow us to process your bug report more efficiently, resulting in a better response to the report and faster resolving of the issue. If you have any questions, suggestions, or anything else to tell us, feel free to contact us at the e-mail address @email{speechd-discuss@@nongnu.org}. @c **************************************************************************** @node Copying This Manual, Index, Contact Information, Top @appendix Copying Conditions of This Manual @menu * GNU Free Documentation License:: * GNU General Public License:: @end menu @node GNU Free Documentation License, GNU General Public License, Copying This Manual, Copying This Manual @section GNU Free Documentation License @cindex FDL, GNU Free Documentation License @center Version 1.2, November 2002 @include fdl.texi @node GNU General Public License, , GNU Free Documentation License, Copying This Manual @section GNU General Public License @cindex GPL, GNU General Public License @center Version 3, 29 June 2007 @include gpl.texi @c **************************************************************************** @node Index, , Copying This Manual, Top @unnumbered Index @printindex cp @bye @c LocalWords: texinfo setfilename speechd settitle syncodeindex fn cp ky vr @c LocalWords: Brailcom dircategory direntry titlepage vskip pt filll dir url @c LocalWords: insertcopying ifnottex cindex Elib autoload kbd findex kindex @c LocalWords: pxref sexp SPC itemx var unspeak vtable xref asis alist ftable @c LocalWords: docstrings minibuffers emph vindex fdl texi printindex gc foo @c LocalWords: RET bleh LogLevel conf comint localhost speechd-el-2.11/braille.el0000644000175000001440000001076214070023103014075 0ustar pdmusers;;; braille.el --- Simple Emacs braille display emulator -*- lexical-binding: t -*- ;; Copyright (C) 2012-2021 Milan Zamazal ;; Copyright (C) 2004 Brailcom, o.p.s. ;; Author: Milan Zamazal ;; COPYRIGHT NOTICE ;; ;; 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 . ;;; Commentary: ;;; Code: (require 'cl-lib) (defvar braille-buffer-name "*braille-monitor*") (defvar braille-table '((? . ()) (?! . (2 3 4 6)) (?\" . (5)) (?# . (3 4 5 6)) (?$ . (1 2 4 6)) (?% . (1 4 6)) (?& . (1 2 3 4 6)) (?' . (3)) (?\( . (1 2 3 5 6)) (?\) . (2 3 4 5 6)) (?* . (1 6)) (?+ . (3 4 6)) (?, . (6)) (?- . (3 6)) (?. . (4 6)) (?/ . (3 4)) (?0 . (3 5 6)) (?1 . (2)) (?2 . (2 3)) (?3 . (2 5)) (?4 . (2 5 6)) (?5 . (2 6)) (?6 . (2 3 5)) (?7 . (2 3 5 6)) (?8 . (2 3 6)) (?9 . (3 5)) (?0 . (1 5 6)) (?\; . (5 6)) (?< . (1 2 6)) (?= . (1 2 3 4 5 6)) (?> . (3 4 5)) (?? . (1 4 5 6)) (?@ . (4 7)) (?A . (1 7)) (?B . (1 2 7)) (?C . (1 4 7)) (?D . (1 4 5 7)) (?E . (1 5 7)) (?F . (1 2 4 7)) (?G . (1 2 4 5 7)) (?H . (1 2 5 7)) (?I . (2 4 7)) (?J . (2 4 5 7)) (?K . (1 3 7)) (?L . (1 2 3 7)) (?M . (1 3 4 7)) (?N . (1 3 4 5 7)) (?O . (1 3 5 7)) (?P . (1 2 3 4 7)) (?Q . (1 2 3 4 5 7)) (?R . (1 2 3 5 7)) (?S . (2 3 4 7)) (?T . (2 3 4 5 7)) (?U . (1 3 6 7)) (?V . (1 2 3 6 7)) (?W . (2 4 5 6 7)) (?X . (1 3 4 6 7)) (?Y . (1 3 4 5 6 7)) (?Z . (1 3 5 6 7)) (?\[ . (2 4 6 7)) (?\\ . (1 2 5 6 7)) (?\] . (1 2 4 5 6 7)) (?^ . (4 5 7)) (?_ . (4 5 6)) (?` . (4)) (?a . (1)) (?b . (1 2)) (?c . (1 4)) (?d . (1 4 5)) (?e . (1 5)) (?f . (1 2 4)) (?g . (1 2 4 5)) (?h . (1 2 5)) (?i . (2 4)) (?j . (2 4 5)) (?k . (1 3)) (?l . (1 2 3)) (?m . (1 3 4)) (?n . (1 3 4 5)) (?o . (1 3 5)) (?p . (1 2 3 4)) (?q . (1 2 3 4 5)) (?r . (1 2 3 5)) (?s . (2 3 4)) (?t . (2 3 4 5)) (?u . (1 3 6)) (?v . (1 2 3 6)) (?w . (2 4 5 6)) (?x . (1 3 4 6)) (?y . (1 3 4 5 6)) (?z . (1 3 5 6)) (?{ . (2 4 6)) (?| . (1 2 5 6)) (?} . (1 2 4 5 6)) (?~ . (4 5)) (t . (4 5 6 7))) "Alist mapping characters to braille codes. Each braille code is represented by a list of numbers idenitifying the dot positions. The entry with the symbol t as its car maps to the default code to display instead of undefined characters.") (define-derived-mode braille-display-mode fundamental-mode "Braille" "Mode for displaying braille display emulator." (setq buffer-read-only t) (setq truncate-lines t) (defvar speechd-speak-mode) (set (make-local-variable 'speechd-speak-mode) nil)) (defun braille-display (string &optional cursor-position) (with-current-buffer (get-buffer-create braille-buffer-name) (braille-display-mode) (let ((inhibit-read-only t)) (erase-buffer) (insert "\n\n\n\n\n") (dolist (c (append string nil)) (let ((code (cdr (or (assoc c braille-table) (assq t braille-table))))) (when cursor-position (if (= cursor-position 0) (setq code (cons 8 code) cursor-position nil) (cl-decf cursor-position))) (cl-flet ((display-dot (dot suffix) (end-of-line) (insert (if (member dot code) "o" " ") suffix) (forward-line))) (goto-char (point-min)) (mapc #'(lambda (d) (display-dot d " ")) '(1 2 3 7)) (goto-char (point-min)) (mapc #'(lambda (d) (display-dot d " ")) '(4 5 6 8)))) (goto-char (point-max)) (insert (format " %c " c))) (when (equal cursor-position 0) (end-of-line -1) (insert " o"))))) ;;; Announce (provide 'braille) ;;; braille.el ends here speechd-el-2.11/brltty.el0000644000175000001440000005313014070023103013777 0ustar pdmusers;;; brltty.el --- Interface to BRLTTY -*- lexical-binding: t -*- ;; Copyright (C) 2012-2021 Milan Zamazal ;; Copyright (C) 2004-2008 Brailcom, o.p.s. ;; Author: Milan Zamazal ;; COPYRIGHT NOTICE ;; ;; 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 . ;;; Commentary: ;;; Code: (require 'cl-lib) (require 'speechd-common) ;;; User configuration and commands (defgroup brltty () "BRLTTY interface." :group 'speechd-el) (defcustom brltty-default-host "localhost" "Default BRLTTY host to connect to." :type 'string :group 'brltty) (defcustom brltty-default-port '(4101 4102 4103 4104 35751) "Default BRLTTY port to connect to. If it is a list, the given port numbers are attempted in the order they are given until Emacs connects to something." :type 'integer :group 'brltty) (defcustom brltty-authentication-file "/etc/brlapi.key" "File containing the BrlAPI authentication key." :type '(file :must-match t) :group 'brltty) (defcustom brltty-coding 'iso-8859-1 "Coding in which texts should be sent to BRLTTY." :type 'coding-system :group 'brltty) (defcustom brltty-tty (car (read-from-string (or (let ((value (ignore-errors (shell-command-to-string "xprop -root XFree86_VT")))) (and value (string-match "= *\\([0-9]+\\)" value) (match-string 1 value))) (getenv "CONTROLVT") "0"))) "Number of the Linux console on which brltty.el runs. The default value is taken from the XFree86_VT root window property or, if not available, from the environment variable CONTROLVT." :type 'integer :group 'brltty) (defcustom brltty-timeout 3 "Maximum number of seconds to wait for a BRLTTY answer." :type 'integer :group 'brltty) ;;; Internal functions and data (defconst brltty--emacs-accept-ok (condition-case _ (progn (accept-process-output nil 0 0 1) t) (error))) (defconst brltty--emacs-process-ok (fboundp 'process-put)) (defconst brltty--supported-protocol-versions '(8 7)) (defconst brltty--protocol-version-error 13) (defconst brltty--errors '((1 . "Not enough memory") (2 . "A connection is already running in this tty") (3 . "A connection is already using RAW or suspend mode") (4 . "Not implemented in protocol") (5 . "Forbiden in current mode") (6 . "Out of range or have no sense") (7 . "Invalid size") (8 . "Connection refused") (9 . "Operation not supported") (10 . "Getaddrinfo error") (11 . "Libc error") (12 . "Couldn't find out the tty number") (13 . "Bad protocol version") (14 . "Unexpected end of file") (15 . "Key file empty") (16 . "Packet returned by driver too large") (17 . "Authentication failed"))) (defconst brltty--packet-types '(;; commands (version . ?v) (auth . ?a) (authkey . ?K) ; protocol version < 8 (gettty . ?t) (leavetty . ?L) (getdisplaysize . ?s) (write . ?w) (ignorekeyranges . ?m) (acceptkeyranges . ?u) ;; answers (ack . ?A) (err . ?e) (key . ?k))) (defconst brltty--authentication-codes '((?N . none) (?K . key) (?C . credentials))) (cl-defstruct brltty--connection process (protocol-version nil) (display-width nil) (output "") (key-handler nil) (answers '()) (terminal-spec nil)) (defun brltty--add-answer (connection answer) (setf (brltty--connection-answers connection) (append (brltty--connection-answers connection) (list answer))) answer) (defun brltty--next-answer (connection) (pop (brltty--connection-answers connection))) (unless brltty--emacs-process-ok (defvar brltty--process-connections '())) (let ((last-selected-frame 'uninitialized) (last-terminal-spec 'uninitialized)) (defun brltty--terminal-spec () (if (eq (selected-frame) last-selected-frame) last-terminal-spec (prog1 (setq last-terminal-spec (brltty--terminal-spec*)) (setq last-selected-frame (selected-frame)))))) (defun brltty--terminal-spec* () (let ((terminal-spec '())) (cond ((or (getenv "WINDOWPATH") (getenv "WINDOWSPATH")) (save-match-data (dolist (number (split-string (or (getenv "WINDOWPATH") (getenv "WINDOWSPATH")) ":")) (push (string-to-number number) terminal-spec)))) ((eq window-system 'x) (push brltty-tty terminal-spec))) (cond ((eq window-system 'x) (push (string-to-number (frame-parameter (selected-frame) 'outer-window-id)) terminal-spec)) ((getenv "WINDOWID") (push (string-to-number (getenv "WINDOWID")) terminal-spec)) ((file-readable-p "/proc/self/stat") (with-temp-buffer (let ((standard-input (current-buffer))) (push (or (ignore-errors (with-speechd-coding-protection (insert-file-contents "/proc/self/stat") (goto-char (point-min)) (dotimes (_ 6) (read)) (let ((tty (read))) (if (and tty (= (/ tty 256) 4)) ; major (mod tty 256) ; minor 0)))) 0) terminal-spec)))) (t (push 0 terminal-spec))) (nreverse terminal-spec))) (defun brltty--open-connection (host port key-handler) (let ((process nil) (ports (or port brltty-default-port)) (host* (or host brltty-default-host))) (unless (consp ports) (setq ports (list port))) (while (and (not process) ports) (condition-case err (setq process (open-network-stream "brltty" nil host* (car ports))) (error (if (cdr ports) (setq ports (cdr ports)) (signal (car err) (cdr err)))))) (when process (set-process-coding-system process 'binary 'binary) (if (fboundp 'set-process-query-on-exit-flag) (set-process-query-on-exit-flag process nil) (set-process-query-on-exit-flag process nil)) (let ((connection (make-brltty--connection :process process :key-handler key-handler))) (if brltty--emacs-process-ok (process-put process 'brltty-connection connection) (push (cons process connection) brltty--process-connections)) (set-process-filter process #'brltty--process-filter) connection)))) (defun brltty--process-connection (process) (if brltty--emacs-process-ok (process-get process 'brltty-connection) (cdr (assq process brltty--process-connections)))) (defun brltty--disable-connection (connection error) (let ((process (brltty--connection-process connection))) (when process (delete-process process) (setf (brltty--connection-process connection) nil))) (error "Error in communication with BRLTTY: %s" error)) (defun brltty--process-filter* (process output) (let ((connection (brltty--process-connection process))) (setf (brltty--connection-output connection) (concat (brltty--connection-output connection) output)))) (defun brltty--process-filter (process output) (set-process-filter process #'brltty--process-filter*) (unwind-protect (let ((connection (brltty--process-connection process))) (brltty--process-filter* process output) (while (not (string= (brltty--connection-output connection) "")) (brltty--read-input connection))) (set-process-filter process #'brltty--process-filter))) (defun brltty--accept-process-output (process) (if brltty--emacs-accept-ok (accept-process-output process brltty-timeout nil 1) (accept-process-output process brltty-timeout))) (defun brltty--read-integer (string) (+ (* 256 256 256 (aref string 0)) (* 256 256 (aref string 1)) (* 256 (aref string 2)) (aref string 3))) (defun brltty--read-integer64 (string) (list (+ (* 256 (aref string 0)) (aref string 1)) (+ (* 256 256 (aref string 2)) (* 256 (aref string 3)) (aref string 4)) (+ (* 256 256 (aref string 5)) (* 256 (aref string 6)) (aref string 7)))) (defun brltty--read-packet (connection) (condition-case err (let ((process (brltty--connection-process connection))) (cl-flet ((read-enough-output (size) (while (< (length (brltty--connection-output connection)) size) (brltty--accept-process-output process))) (read-integer () (let ((output (brltty--connection-output connection))) (prog1 (brltty--read-integer output) (setf (brltty--connection-output connection) (substring output 4)))))) (read-enough-output 8) (let* ((size (read-integer)) (type (car (rassoc (read-integer) brltty--packet-types))) (data (progn (read-enough-output size) (let ((output (brltty--connection-output connection))) (setf (brltty--connection-output connection) (substring output size)) (substring output 0 size))))) (cons type data)))) (error (brltty--disable-connection connection err)))) (defun brltty--read-input (connection) (cl-destructuring-bind (type . data) (brltty--read-packet connection) (cl-case type (err (let ((err-number (brltty--read-integer data))) (if (= err-number brltty--protocol-version-error) (brltty--add-answer connection (list type err-number)) (error (format "BRLTTY error %d: %s" err-number (cdr (assoc err-number brltty--errors))))))) (key (let ((handler (brltty--connection-key-handler connection))) (when handler (funcall handler (funcall (if (> (length data) 4) #'brltty--read-integer64 #'brltty--read-integer) data))))) (authkey (let ((version (brltty--read-integer (substring data 0 4))) (auth-methods '()) (len (length data)) (n 4)) (while (< n len) (push (cdr (assoc (brltty--read-integer (substring data n (+ n 4))) brltty--authentication-codes)) auth-methods) (setq n (+ n 4))) (brltty--add-answer connection (list type version auth-methods)))) (auth (let ((auth-methods '()) (len (length data)) (n 0)) (while (< n len) (push (cdr (assoc (brltty--read-integer (substring data n (+ n 4))) brltty--authentication-codes)) auth-methods) (setq n (+ n 4))) (brltty--add-answer connection (cons type auth-methods)))) (version (let ((version (brltty--read-integer (substring data 0 4)))) (brltty--add-answer connection (list type version)))) (nil ;; unknown packet type -- ignore ) (getdisplaysize (brltty--add-answer connection (list type (brltty--read-integer (substring data 0 4)) (brltty--read-integer (substring data 4 8))))) (t (brltty--add-answer connection (list type data)))))) (defun brltty--read-answer (connection packet-id &optional none-ok) (let ((process (brltty--connection-process connection)) (answer '(nothing-yet))) (while (and answer (not (eq (car answer) packet-id))) ;; The answer may be already present in answers (setq answer (brltty--next-answer connection)) (unless answer (brltty--accept-process-output process) (setq answer (brltty--next-answer connection)))) (when (and (not answer) (not none-ok)) (error "BRLTTY answer not received")) (cdr answer))) (defun brltty--send-packet (connection answer packet-id &rest data-list) (let ((length (cl-reduce #'+ data-list :initial-value 0 :key #'(lambda (data) (cond ((integerp data) 4) ((consp data) (cl-ecase (car data) (integer64 8))) (t (length data)))))) (process (brltty--connection-process connection))) (when process (with-speechd-coding-protection (condition-case err (cl-flet ((send-integer (n) (process-send-string process (encode-coding-string (apply #'format "%c%c%c%c" (funcall #'reverse (cl-loop for i from 1 to 4 for x = n then (/ x 256) for rem = (% x 256) collect rem))) brltty-coding)))) (send-integer length) (send-integer (cdr (assoc packet-id brltty--packet-types))) (dolist (data data-list) (cond ((integerp data) (send-integer data)) ((vectorp data) (dotimes (i (length data)) (process-send-string process (encode-coding-string (format "%c" (aref data i)) brltty-coding)))) ((consp data) (cl-destructuring-bind (n1 n2 n3) (cdr data) (cl-ecase (car data) (integer64 (process-send-string process (encode-coding-string (format "%c%c%c%c%c%c%c%c" (/ n1 256) (% n1 256) (/ n2 (* 256 256)) (% (/ n2 256) 256) (% n2 256) (/ n3 (* 256 256)) (% (/ n3 256) 256) (% n3 256)) brltty-coding)))))) (t (process-send-string process data)))) (when answer (brltty--read-answer connection answer))) (error (brltty--disable-connection connection err))))))) (defun brltty--authentication-key () (with-temp-buffer (insert-file-contents brltty-authentication-file) (buffer-substring (point-min) (point-max)))) (defun brltty--update-terminal-spec (connection) (let ((terminal-spec (brltty--terminal-spec)) (orig-terminal-spec (brltty--connection-terminal-spec connection))) (unless (cl-equalp terminal-spec orig-terminal-spec) (when orig-terminal-spec (brltty--send-packet connection 'ack 'leavetty)) (apply 'brltty--send-packet (append (list connection 'ack 'gettty (length terminal-spec)) terminal-spec (list [0]))) (setf (brltty--connection-terminal-spec connection) terminal-spec)))) ;;; Public functions and data (put 'brltty-connection-error 'error-conditions '(error speechd-connection-error brltty-connection-error)) (put 'brltty-connection-error 'error-message "Error on opening BRLTTY connection") (defun brltty-open (&optional host port key-handler) "Open and return connection to a BRLTTY server running on HOST and PORT. If HOST or PORT is nil, `brltty-default-host' or `brltty-default-port' is used respectively." (condition-case err ;; In protocol >= 8 server initiates communication, let's look if ;; there is any (let* ((connection (brltty--open-connection host port key-handler)) (version (or (cl-first (brltty--read-answer connection 'version t)) 7))) (if (> version 7) (progn (unless (member version brltty--supported-protocol-versions) (setq version (apply 'max brltty--supported-protocol-versions))) (let ((auth-methods (brltty--send-packet connection 'auth 'version version))) (cond ((memq 'none auth-methods) nil) ((memq 'key auth-methods) (brltty--send-packet connection 'ack 'auth (car (rassoc 'key brltty--authentication-codes)) (brltty--authentication-key))) (t (signal 'brltty-connection-error "No supported BrlAPI authentication method"))))) ;; No server initial message, assume protocol version 7 (older ;; versions are not supported) (let ((answer (brltty--send-packet connection 'ack 'authkey version (brltty--authentication-key)))) (when (equal answer brltty--protocol-version-error) (signal 'brltty-error answer)))) (setf (brltty--connection-protocol-version connection) version) (brltty--update-terminal-spec connection) connection) (error (signal 'brltty-connection-error err)))) (defun brltty-close (connection) "Close BRLTTY CONNECTION." (when connection (when (brltty--connection-terminal-spec connection) (brltty--send-packet connection 'ack 'leavetty)) (let ((process (brltty--connection-process connection))) (unless brltty--emacs-process-ok (setq brltty--process-connections (remove (assq process brltty--process-connections) brltty--process-connections))) (when process (delete-process process))))) (defun brltty-display-size (connection) "Return the size of the display as the list (WIDTH HEIGHT)." (when connection (or (brltty--connection-display-width connection) (let ((size (brltty--send-packet connection 'getdisplaysize 'getdisplaysize))) ;; BrlAPI may report zero size when the display is off. ;; We shouldn't return nor cache such a value. (when (> (car size) 0) (setf (brltty--connection-display-width connection) size)))))) (defun brltty-write (connection text &optional cursor) "Display TEXT in BRLTTY accessed through CONNECTION. TEXT is encoded in the coding given by `brltty-coding' before it is sent. CURSOR, if non-nil, is a position of the cursor on the display, starting from 0." (when connection (let ((display-width (car (brltty-display-size connection)))) (when display-width (let* ((text* (if (> (length text) display-width) (substring text 0 display-width) ;; We must be careful with FORMAT because of formatting ;; of TAB characters (concat text (format (format "%%-%ds" (- display-width (length text))) "")))) (protocol-version (brltty--connection-protocol-version connection)) (text-coding brltty-coding) (encoded-text (with-speechd-coding-protection (encode-coding-string text* text-coding))) (arguments (list connection nil 'write (if (< protocol-version 8) 38 102) 1 display-width (length encoded-text) encoded-text ;; Cursor position may not be too high, ;; otherwise BRLTTY breaks the connection (if cursor (1+ (min cursor display-width)) 0)))) (when (>= protocol-version 8) (let ((charset (symbol-name text-coding))) (setf arguments (append arguments (list (vector (length charset)) (upcase charset)))))) (apply #'brltty--send-packet arguments)))))) (defun brltty-ignore-keys (connection) "Let BrlTTY handle all keys itself." (when connection (brltty--send-packet connection nil 'ignorekeyranges '(integer64 0 0 0) '(integer64 #xFFFF #xFFFFFF #xFFFFFF)))) (defun brltty-accept-keys (connection &optional keys) "Let BrlTTY send all keys to us. If optional argument KEYS is non-nil, allow to send us only the given keys. Then KEYS must be a list of key codes represented by integer triplets." (when connection (let ((key-ranges (if keys (mapcar #'(lambda (key) (cons (cons 'integer64 key) (cons 'integer64 key))) keys) (list (cons '(integer64 0 0 0) '(integer64 #xFFFF #xFFFFFF #xFFFFFF)))))) (dolist (range key-ranges) (brltty--send-packet connection nil 'acceptkeyranges (car range) (cdr range)))))) ;;; Announce (provide 'brltty) ;;; brltty.el ends here speechd-el-2.11/ANNOUNCE0000644000175000001440000000506214070023103013267 0ustar pdmusersspeechd-el 2.11 released ======================== * What is speechd-el? speechd-el is an Emacs client to speech synthesizers, Braille displays and other alternative output interfaces. It provides full speech and Braille output environment for Emacs using the Speech Dispatcher and BRLTTY backends. It is focused especially on (but not limited to) the blind and visually impaired users. It allows the user to work with Emacs without looking on the screen, by listening to speech output produced by the speech synthesizers supported in Speech Dispatcher and watching Braille output on Braille displays supported by BRLTTY. Key speechd-el features are: - Speech output and Braille input/output. - Automated "intelligent" reading of most Emacs messages and actions. Additional commands for explicit reading. - Message priorities, voice parameter changes, sound icons and other features provided by Speech Dispatcher. - Multilingual support. - Almost no change of the standard Emacs behavior, no interference with user settings. - Highly configurable. - Possibility to add support for other alternative output methods. - Elisp libraries for generic speech, Braille and other kinds of output as well as for alternative user interface programming. - Small code size. - Free Software, distributed under the GPL. More information about speechd-el (including comparison with Emacspeak) can be found on http://devel.freebsoft.org/speechd-el . * What is new in the 2.11 version? ** Index marking support Set speechd-speak-use-index-marks variable to `t' to enable index marking. Note that it may have performance or other issues. How well index marking actually works is also dependent on the speech synthesizer used. ** Improvement of reading wrapped lines If truncate-lines is nil, lines are read only to their visual ends (thanks to Nicolas Graner). ** Internal cleanup The code has been updated to match current Emacs practices and all compilation warnings have been resolved. * Where to get it? The easiest way to install speechd-el is to use the package from MELPA (http://melpa.milkbox.net/) or from Debian (if you use Debian or one of its derivatives). You'll also need Speech Dispatcher and/or BRLTTY. The source code is available on GitHub: https://github.com/brailcom/speechd-el The source package of the released version is available at https://github.com/brailcom/speechd-el/releases/download/speechd-el-2.11/speechd-el-2.11.tar.gz . Local Variables: fill-column: 72 End: speechd-el-2.11/Makefile0000644000175000001440000000415214070023103013575 0ustar pdmusers# Makefile for speechd-el # Copyright (C) 2012-2021 Milan Zamazal # Copyright (C) 2003-2010 Brailcom, o.p.s. # COPYRIGHT NOTICE # # 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 . EMACS = emacs NAME = speechd-el VERSION = 2.11 DISTDIR = $(NAME)-$(VERSION) TARFILE = $(NAME)-$(VERSION).tar .PHONY: all compile install install-strip uninstall \ clean distclean mostlyclean maintainer-clean TAGS info dvi dist check all: compile info compile: braille.elc brltty.elc mmanager.elc speechd.elc speechd-braille.elc \ speechd-brltty.elc speechd-bug.elc speechd-common.elc \ speechd-out.elc speechd-speak.elc speechd-ssip.elc %.elc: %.el $(EMACS) --batch -l speechd-compile.el -f speechd-compile --kill install: install-strip: $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install uninstall: mostlyclean: rm -f *.aux *.cp *.cps *.fn *.ky *.log *.pg *.toc *.tp *.vr *~ clean: mostlyclean rm -f *.dvi *.elc speechd-el.pdf *.ps distclean: clean rm -rf $(DISTDIR) $(TARFILE)* *.orig *.rej TAGS maintainer-clean: distclean rm -f *.info* dir TAGS: etags *.el doc: info pdf info: speechd-el.info dir %.info: %.texi makeinfo $< dir: speechd-el.info install-info $< dir info-cs: speechd-el.cs.info pdf: speechd-el.pdf %.pdf: %.texi texi2pdf $< ps: speechd-el.ps %.ps: %.texi texi2ps $< dist: maintainer-clean info mkdir $(DISTDIR) chmod 755 $(DISTDIR) install -m 644 `find . -maxdepth 1 -type f -name '[a-zA-Z]*'` \ $(DISTDIR) (cd $(DISTDIR); $(MAKE) distclean) tar cvf $(TARFILE) $(DISTDIR) gzip -9 $(TARFILE) check: speechd-el-2.11/NEWS0000644000175000001440000001627714070023103012647 0ustar pdmusersUser-visible changes to speechd-el: * Changes in speechd-el 2.11 ** Index marking support Set speechd-speak-use-index-marks variable to `t' to enable index marking. Note that it may have performance or other issues. How well index marking actually works is also dependent on the speech synthesizer used. ** Improvement of reading wrapped lines If truncate-lines is nil, lines are read only to their visual ends (thanks to Nicolas Graner). ** Internal cleanup The code has been updated to match current Emacs practices and all compilation warnings have been resolved. * Changes in speechd-el 2.10 ** New user option speechd-speak-emacs-language. It sets the language for messages read in English by default. ** Bug fixes. * Changes in speechd-el 2.9 ** Bug fixes. * Changes in speechd-el 2.8 ** XDG_RUNTIME_DIR environment variable is honored now. Thanks to Alain Kalker for this change. * Changes in speechd-el 2.7 ** Minor bug fixes. Thanks to Alain Kalker for help. * Changes in speechd-el 2.6 ** Minor bug fixes. Thanks to Kevin Ryde for identifying the bugs. ** Packaging support. * Changes in speechd-el 2.5 This is a maintenance release, primarily fixing problems with newer Emacs versions. * Changes in speechd-el 2.4 ** Support for new Speech Dispatcher autospawn mechanism. speechd-el uses Speech Dispatcher autospawn feature by default, see `speechd-autospawn' user option. ** Support for new Unix socket communication with Speech Dispatcher. Unix socket communication is used by default, see `speechd-connection-method' user option. ** Isearch reading adjustments. ** New user option speechd-speak-echo. It allows you to set what speechd-el speaks when you type characters. * Changes in speechd-el 2.3 ** Buffer names in speechd-speak-connections are regexps now. ** Braille key handling improvements. ** Automatic restarts of broken SSIP and BrlAPI connections. * Changes in speechd-el 2.2 ** Support for new BrlAPI protocol introduced in BRLTTY 3.8. speechd-el now works with BRLTTY 3.8 final version and BRLTTY 3.9. Additionally BRLTTY error reporting cleanup was made. ** New BRLTTY key handler for general character input. New macro `speechd-brltty-command-key-function' is provided to assign actions to Braille display general input keys, such as letters. ** New command speechd-set-synthesizer-voice. It allows setting speech synthesizer voice directly by its name. Note this only works with Speech Dispatcher 0.6.3 or higher. ** Moved to GPL3. * Changes in speechd-el 2.1 ** Invisible text is no longer read. ** Support for BRLTTY 3.8. BRLTTY uses 64-bit key codes. They are represented as two-number lists in speechd-braille-key-functions. ** WINDOWPATH BRLTTY environment variable is recognized. The WINDOWSPATH environment variable should be named WINDOWPATH now. This speechd-el version uses whichever of those two is defined. * Changes in speechd-el 2.0 ** Output mechanism modularized. speechd-el is output device independent now, it no longer depends on speech output and SSIP. It is now possible (and sufficiently simple) to add new output modules for alternative output devices, such as Braille displays, etc. ** BRLTTY input/output added. speechd-el now supports Braille output to BRLTTY with basically the same functionality as in the speech output. It is possible to use speech output, Braille output, or both. You can use sophisticated speechd-el features such as message priorities and text property handling instead of screen reading. Additionally it is possible to bind functions to the Braille display keys. ** Braille display emulator added. There is another output module available: Braille display emulator in an Emacs buffer. Useful only for development purposes. ** Message manager added. Message manager for managing messages and priorities was added. It works in a way similar to the Speech Dispatcher message mechanism. * Changes in speechd-el 1.0 ** The top customization group is called speechd-el now. * Changes in speechd-el 0.5 ** Messages from built-in functions can be read now. ** New user option speechd-speak-message-time-interval. It allows you to control speaking of repeated messages. ** Mode line can be read in CVS versions of Emacs. See the command speechd-speak-read-mode-line bound to the `C-e RET' key. ** New commands providing basic information about current environment. Type `C-e C-i C-h' to see the list of those commands. ** Some state changes can be automatically reported now. See the variable speechd-speak-state-changes. ** The SPEECHD_HOST environment variable is honored now. ** Changes in communication with Speech Dispatcher. Former socket based asynchronous communication with Speech Dispatcher was unreliable and could cause errors in some situations. This has been fixed for CVS Emacs versions. In Emacs 21.3, two alternative workarounds are available: either one-way communication with Speech Dispatcher (the default) or using the spdsend utility (if the speechd-spdsend variable is set). ** speechd-connection-parameters removed. This obsolete variable is no longer available, use speechd-connection-voices instead. * Changes in speechd-el 0.4 ** Whitespace signalization added. It allows you, among others, to distinguish between empty lines and lines containing only whitespace. ** Repetition of last speakings possible in character reading prompts. For instance, it is possible to repeat Ispell choices in ispell-word now. ** Language selection based on currently selected input method is possible. See the new variable speechd-speak-input-method-languages. ** Asynchronous action handling reworked. The former mechanism of speaking in asynchronous actions, such as process outputs or timers, was broken. It should be fixed now. ** Responsiveness improved. speechd-el is now much more responsive when speaking many small pieces of text. * Changes in speechd-el 0.3 ** Connection parameters are handled in a different way. Connection parameters are configured as voices in the speechd-voices variable now. Each specific voice can then be assigned to a connection or face, see the variables speechd-connection-voices and speechd-face-voices. The variable speechd-connection-parameters is obsoleted and shouldn't be used anymore. ** Bug reporting changes. Bug reproduction finishing key was changed from `C-e C-z' to `C-e C-f'. New command speechd-bug-reproduce allowing to reproduce a bug any time. Log extraction speed up. ** Volume setting added. You can use the `C-e d V' command with Speech Dispatcher 0.3 or higher to adjust speech volume. ** The *Completion* buffer is spoken now. ** You can shut up speechd-el in debugger. See the new variable speechd-speak-in-debugger. * Changes in speechd-el 0.2 ** read-event prompts are spoken now. ** Spelling support added. You can now use speechd-speak-spell-mode to enable spelling in a buffer or the `C-e C-l' keys to cause the next command to spell the text it reads. ** Choosing widget values improved. The variable widget-menu-minibuffer-flag is now automatically set to t when speechd-speak-mode is enabled, thus the widget value is chosen using usual minibuffer completions. ** Bug reproduction finishing key was changed from `C-e .' to `C-e C-z'. Local variables: mode: outline end: speechd-el-2.11/speechd-el-pkg.el0000644000175000001440000000177314070023103015255 0ustar pdmusers;;; speechd-el-pkg.el --- speechd-el package definition -*- lexical-binding: t -*- ;; Copyright (C) 2013-2021 Milan Zamazal ;; Author: Milan Zamazal ;; COPYRIGHT NOTICE ;; ;; 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 . ;;; Code: (define-package "speechd-el" "2.11" "Client to speech synthesizers and Braille displays.") ;;; Announce (provide 'speechd-el-pkg) ;;; speechd-el-pkg.el ends here speechd-el-2.11/mmanager.el0000644000175000001440000002224214070023103014246 0ustar pdmusers;;; mmanager.el --- Message manager -*- lexical-binding: t -*- ;; Copyright (C) 2021 Milan Zamazal ;; Copyright (C) 2004, 2005 Brailcom, o.p.s. ;; Author: Milan Zamazal ;; COPYRIGHT NOTICE ;; ;; 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 . ;;; Code: (require 'cl-lib) ;;; User customization (defgroup message-manager () "Message queue management." :group 'speechd-el) (defcustom mmanager-history-size 12 "Maximum number of message stored in the message history." :type 'integer :group 'message-manager) ;;; Data structures (cl-defstruct mmanager--manager (queue '()) (current-message nil) (message-blocks '()) (paused nil) (last-group nil) display-f stop-f pause-f resume-f busy-f properties (history '()) (history-cursor nil)) (cl-defstruct mmanager--message messages priority client group) ;;; Calls to the driver functions (defun mmanager--busy (manager) (funcall (mmanager--manager-busy-f manager) manager)) (defun mmanager--stop (manager) (when (mmanager--busy manager) (funcall (mmanager--manager-stop-f manager) manager))) (defun mmanager--pause (manager) (when (and (mmanager--busy manager) (not (mmanager--manager-paused manager))) (funcall (mmanager--manager-pause-f manager) manager)) (setf (mmanager--manager-paused manager) t)) (defun mmanager--resume (manager) (when (mmanager--manager-paused manager) (funcall (mmanager--manager-resume-f manager) manager) (setf (mmanager--manager-paused manager) nil))) (defun mmanager--display (manager message) (when message (mmanager--add-history manager message) (funcall (mmanager--manager-display-f manager) manager message))) ;;; Utility functions (defun mmanager--make-message (message priority client group) (make-mmanager--message :messages (and message (list message)) :priority priority :client client :group group)) (defun mmanager--current-priority (manager) (let ((current (mmanager--manager-current-message manager))) (and current (mmanager--message-priority current)))) (defun mmanager--client-block (manager client) (cdr (assoc client (mmanager--manager-message-blocks manager)))) ;;; Queue management (defun mmanager--prune-queue (manager condition) (setf (mmanager--manager-queue manager) (cl-remove-if condition (mmanager--manager-queue manager)))) (defun mmanager--update-queue (manager message* priority) (let* ((queue (mmanager--manager-queue manager)) (last (car (last queue)))) (when (and last (eq (mmanager--message-priority last) 'progress) (not (eq priority 'important))) (setf (mmanager--message-priority last) 'message)) (setf (mmanager--manager-queue manager) (if (eq priority 'important) (cl-labels ((add (list) (if (and list (eq (mmanager--message-priority (car list)) 'important)) (cons (car list) (add (cdr list))) (cons message* (cdr list))))) (add queue)) (append queue (list message*)))))) (defun mmanager--enqueue* (manager message* priority) (when (mmanager--message-messages message*) (cl-ecase priority (important (mmanager--pause manager)) ((message text) (mmanager--prune-queue manager #'(lambda (m) (memq (mmanager--message-priority m) '(text notification)))) (when (not (memq (mmanager--current-priority manager) '(important message))) (mmanager--stop manager))) (notification (when (and (or (not (mmanager--busy manager)) (eq (mmanager--current-priority manager) 'notification)) (not (mmanager--manager-queue manager))) (mmanager--stop manager))) (progress (mmanager--prune-queue manager #'(lambda (m) (eq (mmanager--message-priority m) 'progress))))) (mmanager--update-queue manager message* priority) (mmanager-next manager))) (defun mmanager--add-history (manager message) (let ((history (mmanager--manager-history manager))) (when (= (length history) mmanager-history-size) (setq history (cdr history))) (setf (mmanager--manager-history manager) (append history (list message))) (setf (mmanager--manager-history-cursor manager) message))) ;;; Public functions (defun mmanager-create (display-f stop-f pause-f resume-f busy-f) (make-mmanager--manager :display-f display-f :stop-f stop-f :pause-f pause-f :resume-f resume-f :busy-f busy-f)) (defun mmanager-next (manager) (let* ((current (mmanager--manager-current-message manager)) (messages (and current (mmanager--message-messages current)))) (if messages (let ((m (car messages)) (g (mmanager--message-group current))) (when (or (not (mmanager--busy manager)) (and g (eq g (mmanager--manager-last-group manager)))) (mmanager--display manager m) (setf (mmanager--manager-last-group manager) g) (setf (mmanager--message-messages current) (cdr messages)) (mmanager-next manager))) (let* ((queue (mmanager--manager-queue manager)) (message (car queue))) (if (and message (mmanager--manager-paused manager) (not (eq (mmanager--message-priority message) 'important))) (mmanager--resume manager) (setf (mmanager--manager-queue manager) (cdr queue)) (setf (mmanager--manager-current-message manager) message) (when message (mmanager-next manager))))))) (defun mmanager-cancel (manager client) (mmanager--stop manager) (mmanager--prune-queue manager (if client #'(lambda (m) (string= (mmanager--message-client m) client)) #'identity)) (setf (mmanager--manager-current-message manager) nil) (dolist (block% (mmanager--manager-message-blocks manager)) (setcdr block% 'canceled))) (defun mmanager-enqueue (manager client message priority &optional group) (let ((message-block (and message (mmanager--client-block manager client)))) (if message-block (unless (eq message-block 'canceled) (setf (mmanager--message-messages message-block) (append (mmanager--message-messages message-block) (list message))) (when group (setf (mmanager--message-group message-block) group))) (mmanager--enqueue* manager (mmanager--make-message message priority client group) priority)))) (defun mmanager-start-block (manager client priority) (unless (mmanager--client-block manager client) (push (cons client (mmanager--make-message nil priority client nil)) (mmanager--manager-message-blocks manager)))) (defun mmanager-finish-block (manager client) (let ((message (mmanager--client-block manager client))) (when message (setf (mmanager--manager-message-blocks manager) (cl-remove client (mmanager--manager-message-blocks manager) :key #'car :test #'string=)) (unless (eq message 'canceled) (mmanager--enqueue* manager message (mmanager--message-priority message)))))) (defun mmanager-get (manager property) (plist-get (mmanager--manager-properties manager) property)) (defun mmanager-put (manager property value) (setf (mmanager--manager-properties manager) (plist-put (mmanager--manager-properties manager) property value))) (defun mmanager-history (manager which) (let ((history (mmanager--manager-history manager)) (cursor (mmanager--manager-history-cursor manager))) (cl-ecase which (current (cl-find cursor history :test #'eq)) (next (let ((next (cl-rest (cl-member cursor history :test #'eq)))) (when next (setf (mmanager--manager-history-cursor manager) (cl-first next))))) (previous (let ((pos (cl-position cursor history :test #'eq))) (when (and pos (> pos 0)) (setf (mmanager--manager-history-cursor manager) (nth (1- pos) history))))) (first (setf (mmanager--manager-history-cursor manager) (cl-first history))) (last (setf (mmanager--manager-history-cursor manager) (car (last history))))))) ;;; Announce (provide 'mmanager) ;;; mmanager.el ends here speechd-el-2.11/speechd-brltty.el0000644000175000001440000002456614070023103015423 0ustar pdmusers;;; speechd-brltty.el --- BRLTTY output driver -*- lexical-binding: t -*- ;; Copyright (C) 2021 Milan Zamazal ;; Copyright (C) 2004-2008 Brailcom, o.p.s. ;; Author: Milan Zamazal ;; COPYRIGHT NOTICE ;; ;; 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 . ;;; Commentary: ;;; Code: (require 'cl-lib) (require 'brltty) (require 'mmanager) (require 'speechd-braille) ;;; User configuration (defcustom speechd-braille-key-functions '((1 . speechd-brltty-previous-message) ((0 32 1) . speechd-brltty-previous-message) (2 . speechd-brltty-next-message) ((0 32 2) . speechd-brltty-next-message) (11 . speechd-brltty-last-message) ((0 32 25) . speechd-brltty-last-message) (12 . speechd-brltty-first-message) ((0 32 26) . speechd-brltty-first-message) (23 . speechd-brltty-scroll-left) ((0 32 23) . speechd-brltty-scroll-left) (24 . speechd-brltty-scroll-right) ((0 32 24) . speechd-brltty-scroll-right) (25 . speechd-brltty-scroll-to-bol) ((0 32 27) . speechd-brltty-scroll-to-bol) (26 . speechd-brltty-scroll-to-eol) ((0 32 28) . speechd-brltty-scroll-to-bol) (29 . speechd-brltty-scroll-to-cursor) ((0 32 29) . speechd-brltty-scroll-to-cursor) (8204 . speechd-brltty-finish-message) ((0 32 72) . speechd-brltty-finish-message) (8205 . speechd-brltty-cancel) ((0 32 71) . speechd-brltty-cancel)) "Alist of Braille display key codes and corresponding Emacs functions. If the given key is pressed, the corresponding function is called with a `speechd-brltty-driver' instance as its single argument. Please note the functions may be called asynchronously any time. So they shouldn't modify current environment in any inappropriate way. Especially, it is not recommended to assign or call user commands here." :type '(alist :key-type (sexp :tag "Key code") :value-type function) :group 'speechd-braille) (defcustom speechd-braille-show-unknown-keys t "If non-nil, show Braille keys not assigned in `speechd-braille-key-functions'." :type 'boolean :group 'speechd-braille) ;;; Driver utilities (defun speechd-brltty--create-manager () (let ((manager (speechd-braille--create-manager #'speechd-brltty--display))) (mmanager-put manager 'braille-display #'brltty-write) manager)) (defvar speechd-brltty--retry-time 1.0) (defun speechd-brltty--connection (driver &optional dont-open) (let ((connection (slot-value driver 'brltty-connection)) (connection-error nil)) (when (or (eq connection 'uninitialized) (and (not connection) (> (- (float-time) (slot-value driver 'brltty-last-try-time)) speechd-brltty--retry-time))) (let ((first-time (eq connection 'uninitialized))) (if dont-open (setq connection nil) (let ((driver driver)) (setq connection (condition-case err (brltty-open nil nil (lambda (key) (speechd-brltty--handle-key driver key))) (brltty-connection-error (setq connection-error err) nil)))) (setf (slot-value driver 'brltty-connection) connection) (when (and connection-error first-time) (signal (car connection-error) (cdr connection-error))) (speechd-brltty--ignore-most-keys connection)))) connection)) (defun speechd-brltty--display (manager message &optional scroll) (cl-multiple-value-bind (connection text cursor) message (let ((display-width (car (brltty-display-size connection)))) (when display-width (when (and cursor (>= cursor display-width) (not scroll)) (mmanager-put manager 'scrolling (* (/ cursor display-width) display-width)) (setq scroll t)) (if scroll (let ((scrolling (mmanager-get manager 'scrolling))) (setq text (substring text scrolling)) (when cursor (setq cursor (- cursor scrolling)) (when (or (< cursor 0) (> cursor display-width)) (setq cursor nil)))) (mmanager-put manager 'scrolling 0))) (speechd-braille--display manager (list connection text cursor))))) ;;; Braille key handling (defun speechd-brltty--handle-key (driver key) (let ((function (cdr (assoc key speechd-braille-key-functions)))) (cond (function (funcall function driver)) (speechd-braille-show-unknown-keys (message "Braille key pressed: %s" key))))) (defun speechd-brltty-finish-message (driver) "Stop displaying the current message and display the next one." (let ((manager (slot-value driver 'manager))) (speechd-braille--stop manager) (mmanager-next manager))) (defun speechd-brltty-scroll-left (driver &optional bolp) "Scroll towards the beginning of the currently displayed message." (let* ((manager (slot-value driver 'manager)) (scrolling (mmanager-get manager 'scrolling))) (when (and scrolling (> scrolling 0)) (speechd-braille--stop manager) (mmanager-put manager 'scrolling (if bolp 0 (let ((display-size (car (brltty-display-size (speechd-brltty--connection driver))))) (max (- scrolling (or display-size 0)) 0)))) (speechd-brltty--display manager (mmanager-history manager 'current) t)))) (defun speechd-brltty-scroll-to-bol (driver) "Scroll to the beginning of the currently displayed message." (speechd-brltty-scroll-left driver t)) (defun speechd-brltty-scroll-right (driver &optional eolp) "Scroll towards the end of the currently displayed message." (let* ((manager (slot-value driver 'manager)) (scrolling (mmanager-get manager 'scrolling)) (message (mmanager-history manager 'current))) (when scrolling (speechd-braille--stop manager) (cl-destructuring-bind (connection text _cursor) message (let ((display-width (or (car (brltty-display-size connection)) 0))) (when display-width (setq scrolling (if eolp (max (- (length text) display-width) 0) (+ scrolling display-width)))) (when (< scrolling (length text)) (mmanager-put manager 'scrolling scrolling)))) (speechd-brltty--display manager message t)))) (defun speechd-brltty-scroll-to-eol (driver) "Scroll to the end of the currently displayed message." (speechd-brltty-scroll-right driver t)) (defmacro speechd-brltty--message-from-history (which) `(let* ((manager (slot-value driver 'manager)) (message (mmanager-history manager ,which))) (when message (speechd-brltty--display manager message)))) (defun speechd-brltty-scroll-to-cursor (driver) "Scroll to the cursor position (if any) in the displayed message." (speechd-brltty--message-from-history 'current)) (defun speechd-brltty-previous-message (driver) "Display the previous message from the history." (speechd-brltty--message-from-history 'previous)) (defun speechd-brltty-next-message (driver) "Display the next message from the history." (speechd-brltty--message-from-history 'next)) (defun speechd-brltty-first-message (driver) "Display the first message in the history." (speechd-brltty--message-from-history 'first)) (defun speechd-brltty-last-message (driver) "Display the last message in the history." (speechd-brltty--message-from-history 'last)) (defun speechd-brltty-cancel (driver) "Discard all messages from the display queue." (speechd.cancel driver 'all)) (defun speechd-brltty-command-key (_driver key) "Put given key to the command queue." (setq unread-command-events (append unread-command-events (list key)))) (defmacro speechd-brltty-command-key-function (key) "Insert BRLTTY function handling general character KEY event." `(lambda (driver) (speechd-brltty-command-key driver ,key))) (defun speechd-brltty--ignore-most-keys (connection) (brltty-ignore-keys connection) (when speechd-braille-key-functions (brltty-accept-keys connection (mapcar (lambda (key-spec) (let ((key (car key-spec))) (when (numberp key) (setq key (list 0 0 key))) key)) speechd-braille-key-functions)))) ;;; Driver definition, methods and registration (defclass speechd-brltty-driver (speechd-braille-emu-driver) ((name :initform 'brltty) (manager) (brltty-connection :initform 'uninitialized) (brltty-last-try-time :initform 0))) (cl-defmethod initialize-instance :after ((this speechd-brltty-driver) _slots) (oset this manager (speechd-brltty--create-manager))) (cl-defmethod speechd-braille--make-message ((driver speechd-brltty-driver) text message) (list (speechd-brltty--connection driver) text message)) (cl-defmethod speechd.set ((driver speechd-brltty-driver) parameter value) (cond ((eq parameter 'brltty-accept-keys) (let ((connection (speechd-brltty--connection driver))) (when connection (funcall (if value 'brltty-accept-keys 'speechd-brltty--ignore-most-keys) connection)))) (t (cl-call-next-method)))) (cl-defmethod speechd.shutdown ((driver speechd-brltty-driver)) (mmanager-cancel (slot-value driver 'manager) nil) (brltty-close (speechd-brltty--connection driver t)) (setf (slot-value driver 'brltty-connection) 'uninitialized)) (speechd-out-register-driver (make-instance 'speechd-brltty-driver)) ;;; Announce (provide 'speechd-brltty) ;;; speechd-brltty.el ends here speechd-el-2.11/speechd-bug.el0000644000175000001440000002340214070023103014644 0ustar pdmusers;;; speechd-bug.el --- reporting speechd-el and speechd bugs -*- lexical-binding: t -*- ;; Copyright (C) 2012, 2021 Milan Zamazal ;; Copyright (C) 2003, 2004, 2005 Brailcom, o.p.s. ;; Author: Milan Zamazal ;; COPYRIGHT NOTICE ;; ;; 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 . ;;; Code: (require 'cl-lib) (require 'reporter) (require 'speechd-speak) (defvar speechd-bug--log-extractor "speechd-log-extractor") (defvar speechd-bug--finish-repro-key "\C-f") (defvar speechd-bug-packages '(("festival-czech") ("festival-freebsoft-utils") ("sbts") ("speech-dispatcher") ("speechd-el") ("unknown"))) (defvar speechd-bug--repro-id nil) (defvar speechd-bug--marker nil) (defvar speechd-bug--dribble-file nil) ;;; Utility functions (defun speechd-bug--ensure-empty-line () (goto-char (point-min)) (while (not (re-search-forward "\n\n\\'" nil t)) (goto-char (point-max)) (insert "\n") (goto-char (point-min)))) (defun speechd-bug--insert (&rest args) (goto-char (point-max)) (unless (looking-at "^") (insert "\n") (goto-char (point-max))) (apply #'insert args) (goto-char (point-max)) (insert "\n") (goto-char (point-max))) (defun speechd-bug--look-for-file (file directories) (let ((found nil)) (while (and (not found) directories) (let ((file-name (concat (car directories) "/" file))) (if (file-readable-p file-name) (setq found file-name) (setq directories (cdr directories))))) found)) ;;; General information insertion (defun speechd-bug--insert-program-version (program) (speechd-bug--ensure-empty-line) (speechd-bug--insert (format "Version of `%s':" program)) (shell-command (format "%s --version | head -1" program) t)) (defun speechd-bug--insert-config-file (file directories comment-prefix) (speechd-bug--ensure-empty-line) (speechd-bug--insert "===" file ":begin===") (let ((file-name (or (speechd-bug--look-for-file file directories) (condition-case _c (read-file-name (format "Configuration file `%s' not found, please type its location manually: " file)) (quit))))) (if file-name (let ((point (point))) (insert-file-contents file-name) (flush-lines (format "^[ \t]*\\(%s.*\\)?$" comment-prefix) point (point-max-marker))) (speechd-bug--insert "---not-found---"))) (speechd-bug--insert "===" file ":end===")) (defun speechd-bug--insert-general-info () (dolist (p '("speech-dispatcher" "festival")) (speechd-bug--insert-program-version p)) (speechd-bug--insert-config-file "speechd.conf" '("/etc/speechd" "/etc/speech-dispatcher") "#") (speechd-bug--insert-config-file "festival.conf" '("/etc/speechd/modules" "/etc/speech-dispatcher/modules") "#") (speechd-bug--insert-config-file "festival.scm" '("/etc") ";")) (defun speechd-bug--insert-dribble-file () (speechd-bug--ensure-empty-line) (speechd-bug--insert "===dribble:begin===") (insert-file-contents speechd-bug--dribble-file) (speechd-bug--insert "===dribble:end===") (delete-file speechd-bug--dribble-file) (setq speechd-bug--dribble-file nil)) ;;; Log insertion (defun speechd-bug--insert-log-file (file-name) (speechd-bug--ensure-empty-line) (speechd-bug--insert "===" file-name ":logbegin===") (shell-command (format "%s on%s off%s --compress < %s | uuencode %s.compressed" speechd-bug--log-extractor speechd-bug--repro-id speechd-bug--repro-id file-name (file-name-nondirectory file-name)) t) (speechd-bug--insert "===" file-name ":logend===")) (defun speechd-bug--dotconf-option (file-name option) (with-current-buffer (find-file-noselect file-name) (save-match-data (goto-char (point-min)) (when (re-search-forward (concat "^[ \t]*" option "[ \t]+\"\\(.*\\)\"") nil t) (match-string 1))))) (defun speechd-bug--insert-logs () ;; speechd (let ((file-name (speechd-bug--look-for-file "speechd.conf" '("/etc/speechd" "/etc/speech-dispatcher" "/usr/local/etc/speechd")))) (when file-name (dolist (option '("LogFile" "CustomLogFile[ \t]+\"protocol\"")) (let ((f (speechd-bug--dotconf-option file-name option))) (when f (save-match-data (when (string-match "^/" f) (speechd-bug--insert-log-file f))))))) ;; Festival (let* ((file-name (speechd-bug--look-for-file "festival.conf" '("/etc/speechd/modules" "/etc/speech-dispatcher/modules" "/usr/local/etc/speechd/modules"))) (festival-server (or (speechd-bug--dotconf-option file-name "FestivalServerHost") "localhost")) (festival-port (string-to-number (or (speechd-bug--dotconf-option file-name "FestivalServerPort") "1314"))) (festival-module-log (speechd-bug--dotconf-option file-name "DebugFile"))) (when festival-module-log (speechd-bug--insert-log-file festival-module-log)) (let ((process (open-network-stream "speechd-festival" nil festival-server festival-port)) (output "") (log-file nil)) (when process (unwind-protect (progn (set-process-filter process #'(lambda (_p str) (setq output (concat output str)))) (process-send-string process "server_log_file\n") (while output (if (accept-process-output nil 1) (save-match-data (when (string-match "^LP\r?\n\\(.*\\)\n" output) (setq log-file (match-string 1 output)) (setq output nil))) (setq output nil)))) (delete-process process)) (save-match-data (when (and log-file (string-match "\"\\(/.*\\)\"" log-file)) (speechd-bug--insert-log-file (concat (match-string 1 log-file) "-e"))))))))) ;;; Reproducing bug (defun speechd-bug--generate-repro-id () (let ((time (current-time))) (format "speechd-el-%d-%d-%d" (cl-first time) (cl-second time) (cl-third time)))) (defun speechd-bug-reproduce () "Start reproducing a speechd-el or Speech Dispatcher bug. All user and speechd actions are watched from this moment. Bug reproduction is finished by pressing the `C-e C-f' keys. After the bug reproduction is finished, information about it is inserted into the buffer where the `speechd-bug-reproduce' command was invoked. This command is useful when you want to provide information about a bug without generating new bug report." (interactive) (setq speechd-bug--marker (point-marker)) (setq speechd-bug--repro-id (speechd-bug--generate-repro-id)) (speechd-say-sound (concat "_debug_on" speechd-bug--repro-id) :priority 'important) (setq speechd-bug--dribble-file (make-temp-file "speechd-bug")) (open-dribble-file speechd-bug--dribble-file) (define-key speechd-speak-mode-map speechd-bug--finish-repro-key 'speechd-bug--finish-repro)) (defun speechd-bug--finish-repro () "Finish reproducing a bug." (interactive) (speechd-say-sound (concat "_debug_off" speechd-bug--repro-id) :priority 'important) (define-key speechd-speak-mode-map speechd-bug--finish-repro-key 'undefined) (sit-for 1) ; wait a little for flushing the logs (switch-to-buffer (marker-buffer speechd-bug--marker)) (let ((speechd-speak-mode nil)) (speechd-bug--insert-dribble-file) (speechd-bug--insert-logs)) (goto-char (marker-position speechd-bug--marker)) (setq speechd-bug--marker nil) (setq speechd-bug--repro-id nil) (message "OK, now describe the bug and send the mail with C-c C-c.")) ;;; The command ;;;###autoload (defun speechd-bug () "Send a bug report on speechd-el or Speech Dispatcher." (interactive) (let ((package (completing-read "Package: " speechd-bug-packages)) (reporter-prompt-for-summary-p t)) (reporter-submit-bug-report "speechd-discuss@nongnu.org" package (append '(speechd-speak--debug) (apropos-internal "^speechd\\(-[a-z]+\\)+$" 'boundp))) (ignore-errors (save-excursion (speechd-bug--insert-general-info))) (if (y-or-n-p "Can you reproduce the bug now? ") (progn (message "Reproduce the bug now and finish it with `%s %s'" (key-description speechd-speak-prefix) (key-description speechd-bug--finish-repro-key)) (speechd-bug-reproduce)) (save-excursion (speechd-bug--ensure-empty-line) (speechd-bug--insert "The bug was not reproduced.")) (message "Please describe the bug as precisely as possible.")))) ;;; Announce (provide 'speechd-bug) ;;; speechd-bug.el ends here speechd-el-2.11/speechd-common.el0000644000175000001440000000513714070023103015364 0ustar pdmusers;;; speechd-common.el --- Code common to all parts of speechd-el -*- lexical-binding: t -*- ;; Copyright (C) 2004, 2005, 2008 Brailcom, o.p.s. ;; Author: Milan Zamazal ;; COPYRIGHT NOTICE ;; ;; 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 . ;;; Code: (defgroup speechd-el () "Speechd-el alternative output system." :group 'environment) (defcustom speechd-default-text-priority 'text "Default Speech Dispatcher priority of sent texts." :type 'speechd-priority-tag :group 'speechd-el) (defcustom speechd-default-sound-priority 'message "Default Speech Dispatcher priority of sent sound icons." :type 'speechd-priority-tag :group 'speechd-el) (defcustom speechd-default-char-priority 'notification "Default Speech Dispatcher priority of sent single letters." :type 'speechd-priority-tag :group 'speechd-el) (defcustom speechd-default-key-priority 'notification "Default Speech Dispatcher priority of sent symbols of keys." :type 'speechd-priority-tag :group 'speechd-el) (defvar speechd-client-name "default" "String defining current client name. This variable's value defines which connection is used when communicating with Speech Dispatcher, each connection has its own client name. Usually, you select the proper client (connection) by assigning a value to this variable locally through `let'.") (defvar speechd-language nil "If non-nil, it is an RFC 1766 language code, as a string. If text is read and this variable is non-nil, the text is read in the given language.") (defun speechd-language (string language) "Put language property LANGUAGE on whole STRING. Language should be a string recognizable by Speech Dispatcher as a language code." (put-text-property 0 (length string) 'language language string) string) (defmacro with-speechd-coding-protection (&rest body) "Ensure BODY doesn't mess with Emacs dirty coding hacks." `(let ((last-coding-system-used last-coding-system-used)) ,@body)) ;;; Announce (provide 'speechd-common) ;;; speechd-common.el ends here speechd-el-2.11/speechd-compile.el0000644000175000001440000000235614070023103015524 0ustar pdmusers;;; speechd-compile.el --- Maintenance utilities -*- lexical-binding: t -*- ;; Copyright (C) 2004, 2013, 2021 Milan Zamazal ;; Author: Milan Zamazal ;; COPYRIGHT NOTICE ;; ;; 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 . ;;; Code: (require 'cl-lib) (defun speechd-compile () (let ((load-path (cons default-directory load-path))) (dolist (file (directory-files "." nil "\\.el$")) (unless (member file '("speechd-compile.el" "speechd-el-pkg.el")) (load file) (byte-compile-file file))))) ;;; Announce (provide 'speechd-compile) ;;; speechd-compile.el ends here speechd-el-2.11/speechd-speak.el0000644000175000001440000026202114070023103015174 0ustar pdmusers;;; speechd-speak.el --- simple speechd-el based Emacs client -*- lexical-binding: t -*- ;; Copyright (C) 2012-2021 Milan Zamazal ;; Copyright (C) 2003-2010 Brailcom, o.p.s. ;; Author: Milan Zamazal ;; COPYRIGHT NOTICE ;; ;; 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 . ;;; Commentary: ;; This is an Emacs client to speechd. Some ideas taken from the Emacspeak ;; package (http://emacspeak.sourceforge.net) by T. V. Raman. ;;; Code: (require 'cl-lib) (require 'wid-edit) (require 'speechd) (require 'speechd-common) (require 'speechd-out) (require 'speechd-brltty) (require 'speechd-ssip) ;;; User options (defgroup speechd-speak () "Speechd-el user client customization." :group 'speechd-el) (defcustom speechd-speak-echo 'character "Symbol determining how to read typed characters. It can have one of the following values: `character' -- read characters when they are typed `word' -- read only whole words when they are written `nil' -- don't echo anything on typing" :type '(choice (const :tag "Characters" character) (const :tag "Words" word) (const :tag "Nothing" nil)) :group 'speechd-speak) (defcustom speechd-speak-deleted-char t "If non-nil, speak the deleted char, otherwise speak the adjacent char." :type 'boolean :group 'speechd-speak) (defcustom speechd-speak-buffer-name 'text "If non-nil, speak buffer name on a buffer change. If the value is the symbol `text', speak the text from the cursor position in the new buffer to the end of line as well. If nil, speak the text only, not the buffer name." :type '(choice (const :tag "Buffer name and buffer text" text) (const :tag "Buffer name" t) (const :tag "Buffer text" nil)) :group 'speechd-speak) (defcustom speechd-speak-on-minibuffer-exit t "If non-nil, always try to speak something when exiting the minibuffer." :type 'boolean :group 'speechd-speak) (defcustom speechd-speak-auto-speak-buffers '("*Help*") "List of names of other-window buffers to speak if nothing else fits. If nothing else is to be spoken after a command and a visible window in the current frame displaying a buffer with a name contained in this list is changed, the contents of the window buffer is spoken." :type '(repeat (string :tag "Buffer name")) :group 'speechd-speak) (defcustom speechd-speak-force-auto-speak-buffers '() "List of names of other-window buffers to speak on visible changes. Like `speechd-speak-auto-speak-buffers' except that the window content is spoken even when there are other messages to speak." :type '(repeat (string :tag "Buffer name")) :group 'speechd-speak) (defcustom speechd-speak-buffer-insertions 'one-line "Defines whether insertions in a current buffer should be read automatically. The value is a symbol and can be from the following set: - nil means don't speak them - t means speak them all - `one-line' means speak only first line of any change - `whole-buffer' means speak whole buffer if it was changed in any way Only newly inserted text is read, the option doesn't affect processing of deleted text. Also, the option doesn't affect insertions within commands processed in a different way by speechd-speak or user definitions." :type '(choice (const :tag "Never" nil) (const :tag "One-line changes only" one-line) (const :tag "Always" t) (const :tag "Read whole buffer" whole-buffer)) :group 'speechd-speak) (defcustom speechd-speak-insertions-in-buffers '(" widget-choose" "*Choices*") "List of names of buffers, in which insertions are automatically spoken. See also `speechd-speak-buffer-insertions'." :type '(repeat (string :tag "Buffer name")) :group 'speechd-speak) (defcustom speechd-speak-priority-insertions-in-buffers '() "List of names of buffers, in which insertions are spoken immediately. Unlike `speechd-speak-insertions-in-buffers', speaking is not delayed until a command is completed. This is typically useful in comint buffers." :type '(repeat (string :tag "Buffer name")) :group 'speechd-speak) (defcustom speechd-speak-align-buffer-insertions t "If non-nil, read insertions aligned to the beginning of the first word." :type 'boolean :group 'speechd-speak) (defcustom speechd-speak-movement-on-insertions 'read-only "If t, speak the text around moved cursor even in modified buffers. If nil, additional cursor movement doesn't cause speaking the text around the new cursor position in modified buffers. If `read-only', speak the text around cursor in read-only buffers only." :type '(choice (const :tag "Always" t) (const :tag "Never" nil) (const :tag "In read-only buffers" read-only)) :group 'speechd-speak) (defcustom speechd-speak-read-command-keys t "Defines whether command keys should be read after their command. If t, always read command keys, before the command is performed. If nil, never read them. Otherwise it is a list, consisting of one or more of the following symbols: `movement' -- read the keys if the cursor has moved without any buffer change `modification' -- read the keys if the buffer was modified without moving the cursor `modification-movement' -- read the keys if the buffer was modified and the cursor has moved and the keys are read after the command is performed." :type '(choice (const :tag "Always" t) (const :tag "Never" nil) (set :tag "Sometimes" (const movement) (const modification) (const modification-movement))) :group 'speechd-speak) (defcustom speechd-speak-allow-prompt-commands t "If non-nil, allow speechd-speak commands in read-char prompts." :type 'boolean :group 'speechd-speak) (defcustom speechd-speak-ignore-command-keys '(forward-char backward-char right-char left-char next-line previous-line delete-char comint-delchar-or-maybe-eof delete-backward-char backward-delete-char-untabify delete-forward-char c-electric-backspace c-electric-delete-forward) "List of commands for which their keys are never read." :type '(repeat function) :group 'speechd-speak) (defcustom speechd-speak-read-command-name nil "If non-nil, read command name instead of command keys." :type 'boolean :group 'speechd-speak) (defcustom speechd-speak-use-index-marks nil "If non-nil, move point over text in spoken buffers." :type 'boolean :group 'speechd-speak) (defcustom speechd-speak-index-mark-regexp "" "Regular expression defining the places where to put index marks to. An index mark is put at the end of the regexp at each of the places. If the regexp is empty, `sentence-end' is used. If `sentence-end' is nil, a default regexp matching common punctuation is used." :type 'regexp :group 'speechd-speak) (defcustom speechd-speak-by-properties-on-movement t "Method of selection of the piece of text to be spoken on movement. Unless a command provides its speechd feedback in a different way, it speaks the current line by default if the cursor has moved. However, if this variable is t, it speaks the uniform text around the cursor, where \"uniform\" means the maximum amount of text without any text property change. If the variable is a list of faces, uniform text is spoken only when the cursor is on one of the named faces. Speaking uniform text only works if font-lock-mode is enabled for the current buffer. See also `speechd-speak-by-properties-always' and `speechd-speak-by-properties-never'." :type '(choice (const :tag "Always" t) (repeat :tag "On faces" (face :tag "Face"))) :group 'speechd-speak) (defcustom speechd-speak-by-properties-always '() "List of commands to always speak by properties on movement. The elements of the list are command names, symbols. See `speechd-speak-by-properties-on-movement' for more information about property speaking." :type '(repeat (function :tag "Command" :match (lambda (w val) (commandp val)))) :group 'speechd-speak) (defcustom speechd-speak-by-properties-never '() "List of commands to never speak by properties on movement. The elements of the list are command names, symbols. See `speechd-speak-by-properties-on-movement' for more information about property speaking." :type '(repeat (function :tag "Command" :match (lambda (w val) (commandp val)))) :group 'speechd-speak) (defcustom speechd-speak-faces '() "Alist of faces and speaking functions. Each element of the list is of the form (FACE . ACTION). If a movement command leaves the cursor on a FACE and there is no explicit speaking bound to the command, ACTION is invoked. If ACTION is a string, the string is spoken. If ACTION is a function, it is invoked, with no arguments." :type '(alist :key-type face :value-type (choice (string :tag "String to speak") (function :tag "Function to call" :match (lambda (w val) (commandp val))))) :group 'speechd-speak) (defcustom speechd-speak-display-modes '(gnus-agent-mode) "List of minor modes to be spoken by their display string rather than name." :type '(repeat symbol) :group 'speechd-speak) (defcustom speechd-speak-whole-line nil "If non-nil, speak whole line on movement by default. Otherwise speak from the point to the end of line on movement by default." :type 'boolean :group 'speechd-speak) (defcustom speechd-speak-separator-regexp nil "If non-nil don't read parts of a line separated by the given regexp. This is typically useful in w3m where columns are separated only by whitespace. \" \" may be good value of this variable in such a case." :type 'regexp :group 'speechd-speak) (defcustom speechd-speak-message-time-interval 30 "Minimum time in seconds, after which the same message may be repeated. If the message is the same as the last one, it is not spoken unless the number of seconds defined here has passed from the last spoken message." :type 'integer :group 'speechd-speak) (defcustom speechd-speak-connections '() "Alist mapping major modes and buffers to speechd connection. By default, there's a single connection to speechd, named \"default\". This variable can define special connections for particular major modes and buffers. Each element of the alist is of the form (MODE-OR-BUFFER . CONNECTION-NAME). MODE-OR-BUFFER may be, in the order of preference from the highest to the lowest: - a list, representing a function call returning non-nil iff the element should be applied - buffer name - the symbol `:minibuffer', representing minibuffers - major mode symbol - nil, representing non-buffer areas, e.g. echo area - t, representing the default value if nothing else matches CONNECTION-NAME is an arbitrary non-empty string naming the corresponding connection. If connection with such a name doesn't exist, it is automatically created." :type '(alist :key-type (choice :tag "Matcher" :value nil (const :tag "Default" t) (const :tag "Non-buffers" nil) (const :tag "Minibuffer" :value :minibuffer) (symbol :tag "Major mode" :value fundamental-mode) (regexp :tag "Buffer name regexp" :value "") (restricted-sexp :tag "Function call" :match-alternatives (listp))) :value-type (string :tag "Connection name")) :group 'speechd-speak) (defcustom speechd-speak-signal-events '(empty whitespace beginning-of-line end-of-line start finish minibuffer message) "List of symbolic names of events to signal with a standard icon. The following actions are supported: `empty', `whitespace', `beginning-of-line', `end-of-line', `start', `finish', `minibuffer', `message'." :type '(set (const empty) (const whitespace) (const beginning-of-line) (const end-of-line) (const start) (const finish) (const minibuffer) (const message)) :group 'speechd-speak) (defcustom speechd-speak-input-method-languages '() "Alist mapping input methods to languages. Each of the alist element is of the form (INPUT-METHOD-NAME . LANGUAGE), where INPUT-METHOD-NAME is a string naming the input method and LANGUAGE is an ISO language code accepted by SSIP. If the current input method is present in the alist, the corresponding language is selected unless overridden by another setting." :type '(alist :key-type (string :tag "Input method") :value-type (string :tag "Language code")) :group 'speechd-speak) (defcustom speechd-speak-emacs-language "en" "Language to use for texts originating from Emacs. Messages, minibuffer prompts, completions often contain English texts, so it is desirable to speak them in English. This variable allows to speak them in English, in another language or in the current language. The value is an ISO language code string accepted by SSIP. If nil, use the current language." :type '(choice (string :tag "Language code") (const :tag "Current" nil)) :group 'speechd-speak) (defcustom speechd-speak-in-debugger t "If nil, speechd-speak functions won't speak in Elisp debuggers. This may be useful when debugging speechd-el itself." :type 'boolean :group 'speechd-speak) (defcustom speechd-speak-prefix "\C-e" "Default prefix key used for speechd-speak commands." :set (lambda (name value) (set-default name value) (speechd-speak--build-mode-map)) :initialize 'custom-initialize-default :type 'sexp :group 'speechd-speak) (defcustom speechd-speak-hook nil "Hook run in the `speechd-speak' function." :options '((lambda () (require 'speechd-ssip)) (lambda () (require 'speechd-brltty))) :type 'hook :group 'speechd-speak) ;;; Internal constants and variables (defconst speechd-speak--c-buffer-name "*Completions*") (defvar speechd-speak--info) ;;; Debugging support (defvar speechd-speak--debug ()) (defvar speechd-speak--max-debug-length 12) (defvar speechd-speak--debug-all nil) (defvar speechd-speak--debug-mark nil) (defun speechd-speak--debug (info &optional optional) (when (or (not optional) speechd-speak--debug-all) (setq speechd-speak--debug (cons info (if (and (not speechd-speak--debug-all) (>= (length speechd-speak--debug) speechd-speak--max-debug-length)) (butlast speechd-speak--debug) speechd-speak--debug))))) ;;; Control functions (defvar speechd-speak--predefined-rates '((1 . -100) (2 . -75) (3 . -50) (4 . -25) (5 . 0) (6 . 25) (7 . 50) (8 . 75) (9 . 100))) (defun speechd-speak-set-predefined-rate (level) "Set speech rate to one of nine predefined levels. Level 1 is the slowest, level 9 is the fastest." (interactive "nSpeech rate level (1-9): ") (setq level (min (max level 1) 9)) (let ((rate (cdr (assoc level speechd-speak--predefined-rates)))) (speechd-set-rate rate) (message "Speech rate set to %d" rate))) (defvar speechd-speak--char-to-number '((?1 . 1) (?2 . 2) (?3 . 3) (?4 . 4) (?5 . 5) (?6 . 6) (?7 . 7) (?8 . 8) (?9 . 9))) (defun speechd-speak-key-set-predefined-rate () "Set speech rate to one of nine predefined levels via a key binding. Level 1 is the slowest, level 9 is the fastest." (interactive) (let ((level (cdr (assoc last-input-event speechd-speak--char-to-number)))) (when level (speechd-speak-set-predefined-rate level)))) ;;; Supporting functions and options (defvar speechd-speak-command-done nil "When non-nil, no post command speaking is performed, except for keys. This variable is reset to nil before each command in pre-command-hook.") (defun speechd-speak--name (&rest args) (intern (mapconcat #'symbol-name args "-"))) (defvar speechd-speak-mode nil) ; forward definition to make everything happy (defvar speechd-speak--started nil) (defvar speechd-speak--last-buffer-mode t) (defvar speechd-speak--last-connection-name nil) (defvar speechd-speak--last-connections nil) (defvar speechd-speak--default-connection-name "default") (defvar speechd-speak--special-area nil) (defvar speechd-speak--emulate-minibuffer nil) (defvar speechd-speak--client-name-set nil) (make-variable-buffer-local 'speechd-speak--client-name-set) (defun speechd-speak--connection-name () (let ((buffer-mode (if speechd-speak--special-area nil (cons major-mode (buffer-name))))) (cond (speechd-speak--client-name-set speechd-client-name) ((and (not speechd-speak--client-name-set) (eq speechd-speak-connections speechd-speak--last-connections) (equal buffer-mode speechd-speak--last-buffer-mode)) speechd-speak--last-connection-name) (t (setq speechd-speak--last-buffer-mode buffer-mode speechd-speak--last-connections speechd-speak-connections speechd-speak--last-connection-name (if buffer-mode (or (cdr (or ;; minibuffer-like prompts (and speechd-speak--emulate-minibuffer (assoc :minibuffer speechd-speak-connections)) ;; functional test (let ((specs speechd-speak-connections) (result nil)) (while (and (not result) specs) (if (and (consp (caar specs)) (eval (caar specs))) (setq result (car specs)) (setq specs (cdr specs)))) result) ;; buffer name (let ((buffer-name (buffer-name))) (cl-assoc-if (lambda (key) (when (stringp key) (string-match key buffer-name))) speechd-speak-connections)) ;; minibuffer (and (speechd-speak--in-minibuffer-p) (assoc :minibuffer speechd-speak-connections)) ;; major mode (assq major-mode speechd-speak-connections) ;; default (assq t speechd-speak-connections))) speechd-speak--default-connection-name) (or (cdr (assq nil speechd-speak-connections)) speechd-speak--default-connection-name))) (set (make-local-variable 'speechd-client-name) speechd-speak--last-connection-name))))) (defun speechd-speak--in-debugger () (and (not speechd-speak-in-debugger) (or (eq major-mode 'debugger-mode) (and (boundp 'edebug-active) edebug-active)))) (defmacro speechd-speak--maybe-speak* (&rest body) `(when (and speechd-speak-mode (not (speechd-speak--in-debugger))) ,@body)) (defmacro speechd-speak--maybe-speak (&rest body) `(speechd-speak--maybe-speak* (let ((speechd-client-name (speechd-speak--connection-name)) (speechd-language (or (and speechd-speak-input-method-languages current-input-method (cdr (assoc current-input-method speechd-speak-input-method-languages))) speechd-language))) ,@body))) (defmacro speechd-speak--interactive (&rest body) `(let ((speechd-speak-mode (or (called-interactively-p 'interactive) (and speechd-speak-mode (not (speechd-speak--in-debugger))))) (speechd-default-text-priority (if (called-interactively-p 'interactive) 'message speechd-default-text-priority))) ,@body)) (defun speechd-speak--remove-invisible-text (text) (let ((pieces '()) (max (length text)) (pos 0) (invisibility-spec (if (eq buffer-invisibility-spec t) t (mapcar (lambda (s) (if (consp s) (car s) s)) buffer-invisibility-spec)))) (while (and pos (< pos max)) (let ((next-pos (next-single-char-property-change pos 'invisible text))) (when (let ((invisibility (get-char-property pos 'invisible text))) (not (cond ((eq invisibility-spec t) invisibility) ((consp invisibility) (cl-intersection invisibility-spec invisibility)) (t (memq invisibility buffer-invisibility-spec))))) (push (substring text pos next-pos) pieces)) (setq pos next-pos))) (apply 'concat (nreverse pieces)))) (defun speechd-speak--text (text &rest args) (speechd-speak--maybe-speak ;; TODO: replace repeating patterns ;; TODO: handle selective display (setq text (speechd-speak--remove-invisible-text text)) (when speechd-speak--debug-mark (speechd-speak--debug (cons speechd-speak--debug-mark text) t)) (apply #'speechd-out-text text args))) (defun speechd-speak--char (char &rest args) (speechd-speak--maybe-speak (apply #'speechd-out-char char args))) (defvar speechd-speak--last-report "") (defun speechd-speak-report (message &rest args) "Output text or icon MESSAGE. If MESSAGE is a non-empty string, it is the text to output. If it is a non-nil symbol present in the `speechd-speak-signal-events' variable, it is the icon to output. Otherwise nothing happens. ARGS are appended to the arguments of the corresponding speaking function (`speechd-out-text' or `speechd-out-icon') without change after the message argument." (speechd-speak--maybe-speak (when (and message (not (string= message "")) (not (equal message speechd-speak--last-report)) (or (stringp message) (memq message speechd-speak-signal-events))) (apply (if (symbolp message) #'speechd-out-icon #'speechd-out-text) message args) (setq speechd-speak--last-report message)))) (defun speechd-speak-read-char (&optional char) "Output character CHAR. If CHAR is nil, output the character just after current point." (interactive) (speechd-speak--interactive (speechd-speak--char (or char (following-char))))) (defun speechd-speak-read-region (&optional beg end empty-text index-marks) "Output region of the current buffer between BEG and END. If BEG is nil, current mark is used instead. If END is nil, current point is used instead. EMPTY-TEXT is a text to output if the region is empty; if nil, empty text icon is output. If INDEX-MARKS is non-nil, insert index marks to the spoken text." (interactive "r") (speechd-speak--interactive (let* ((beg (or beg (mark))) (end (or end (point))) (text (speechd-speak--buffer-substring beg end))) (cond ((string= text "") (speechd-speak-report (or empty-text 'empty) :priority speechd-default-text-priority)) ((save-match-data (string-match "\\`[ \t]+\\'" text)) (speechd-speak-report 'whitespace :priority speechd-default-text-priority)) (t (let* ((point (point)) (cursor (and (>= point beg) (<= point end) (- (point) beg))) (markers (when index-marks (speechd-speak--markers beg end)))) (speechd-speak--text text :cursor cursor :markers markers))))))) (defun speechd-speak-read-line (&optional rest-only) "Output current line. If the prefix argument is given, output the line only from the current point to the end of the line." (interactive "P") (speechd-speak--interactive (let* ((inhibit-field-text-motion t) (in-isearch-p (and isearch-mode (not (called-interactively-p 'interactive)))) (beg (if (and rest-only (not in-isearch-p)) (point) (line-beginning-position))) (end (if truncate-lines (line-end-position) (save-excursion (end-of-visual-line) (point))))) (when speechd-speak-separator-regexp (save-match-data (save-excursion (when (re-search-backward speechd-speak-separator-regexp beg t) (setq beg (match-end 0)))) (save-excursion (when (re-search-forward speechd-speak-separator-regexp end t) (setq end (match-beginning 0)))))) (speechd-speak-read-region beg end (when (speechd-speak--in-minibuffer-p) ""))))) (defun speechd-speak-read-next-line () "Speak the next line after the current line. If there is no such line, play the empty text icon." (interactive) (speechd-speak--interactive (save-excursion (if (= (forward-line 1) 0) (speechd-speak-read-line) (speechd-speak-report 'empty))))) (defun speechd-speak-read-previous-line () "Speak the previous line before the current line. If there is no such line, play the empty text icon." (interactive) (speechd-speak--interactive (save-excursion (if (= (forward-line -1) 0) (speechd-speak-read-line) (speechd-speak-report 'empty))))) (defun speechd-speak-read-buffer (&optional buffer) "Read BUFFER. If BUFFER is nil, read current buffer." (interactive) (speechd-speak--interactive (save-excursion (when buffer (set-buffer buffer)) (speechd-speak-read-region (point-min) (point-max) nil speechd-speak-use-index-marks)))) (defun speechd-speak-read-rest-of-buffer () "Read current buffer from the current point to the end of the buffer." (interactive) (speechd-speak--interactive (speechd-speak-read-region (point) (point-max) nil speechd-speak-use-index-marks))) (defun speechd-speak-read-rectangle (beg end) "Read text in the region-rectangle." (interactive "r") (speechd-speak--interactive (speechd-speak--text (mapconcat #'identity (extract-rectangle beg end) "\n")))) (defun speechd-speak-read-other-window () "Read buffer of the last recently used window." (interactive) (speechd-speak--interactive (speechd-speak-read-buffer (window-buffer (get-lru-window))))) (defun speechd-speak-read-mode-line () "Read mode line. This function works only in Emacs 22 or higher." (interactive) (when (fboundp 'format-mode-line) (speechd-speak--interactive (speechd-speak--text (format-mode-line mode-line-format t))))) (defun speechd-speak--window-contents () (sit-for 0) ; to update window start and end (speechd-speak-read-region (window-start) (window-end))) (defun speechd-speak--uniform-text-around-point () (let ((beg (speechd-speak--previous-property-change (1+ (point)))) (end (speechd-speak--next-property-change (point)))) (speechd-speak-read-region beg end))) (defun speechd-speak--speak-piece (start) (let ((point (point))) (if (> (count-lines start point) 1) (speechd-speak-read-line) (speechd-speak-read-region start point)))) (defun speechd-speak--speak-current-column () (speechd-speak--text (format "Column %d" (current-column)))) (defmacro speechd-speak--def-speak-object (type) (let* ((function-name (speechd-speak--name 'speechd-speak-read type)) (backward-function (speechd-speak--name 'backward type)) (forward-function (speechd-speak--name 'forward type))) `(defun ,function-name () ,(format "Speak current %s." type) (interactive) (speechd-speak--interactive (save-excursion (let* ((point (point)) (end (progn (,forward-function 1) (point))) (beg (progn (,backward-function 1) (point)))) (when (<= (progn (,forward-function 1) (point)) point) (setq beg end)) (speechd-speak-read-region beg end))))))) (speechd-speak--def-speak-object word) (speechd-speak--def-speak-object sentence) (speechd-speak--def-speak-object paragraph) (speechd-speak--def-speak-object page) (speechd-speak--def-speak-object sexp) (cl-defstruct speechd-speak--command-info-struct marker modified (changes '()) (change-end nil) (deleted-chars nil) (other-changes '()) other-changes-buffer other-window other-buffer-modified completion-buffer-modified minibuffer-contents info) (defmacro speechd-speak--cinfo (slot) `(,(speechd-speak--name 'speechd-speak--command-info-struct slot) speechd-speak--info)) (defun speechd-speak--command-info-struct-buffer (_info) (let ((marker (speechd-speak--cinfo marker))) (and marker (marker-buffer marker)))) (defun speechd-speak--command-info-struct-point (_info) (let ((marker (speechd-speak--cinfo marker))) (and marker (marker-position marker)))) (defvar speechd-speak--command-start-info (make-vector 5 nil)) (defmacro speechd-speak--with-minibuffer-depth (&rest body) `(let ((depth (minibuffer-depth))) (when (>= depth (length speechd-speak--command-start-info)) (setq speechd-speak--command-start-info (vconcat speechd-speak--command-start-info (make-vector (- (1+ depth) (length speechd-speak--command-start-info)) nil)))) ,@body)) (defun speechd-speak--in-minibuffer-p () (window-minibuffer-p (selected-window))) (defun speechd-speak--command-start-info () (speechd-speak--with-minibuffer-depth (aref speechd-speak--command-start-info depth))) (defun speechd-speak--set-command-start-info (&optional reset) (speechd-speak--with-minibuffer-depth (aset speechd-speak--command-start-info depth (if reset nil (ignore-errors (let ((other-window (next-window))) (make-speechd-speak--command-info-struct :marker (point-marker) :modified (buffer-modified-tick) :other-window other-window :other-buffer-modified (and other-window (buffer-modified-tick (window-buffer other-window))) :completion-buffer-modified (let ((buffer (get-buffer speechd-speak--c-buffer-name))) (and buffer (buffer-modified-tick buffer))) :minibuffer-contents (if (speechd-speak--in-minibuffer-p) (minibuffer-contents) 'unset) :info (speechd-speak--current-info) ))))))) (defun speechd-speak--reset-command-start-info () (speechd-speak--set-command-start-info t)) (defmacro speechd-speak--with-command-start-info (&rest body) `(let ((speechd-speak--info (speechd-speak--command-start-info))) (when speechd-speak--info ,@body))) (defmacro speechd-speak--defadvice (function class &rest body) (let* ((function* function) (functions (if (listp function*) function* (list function*))) (class* class) (where (intern (concat ":" (symbol-name class*)))) (aroundp (eq class* 'around)) (lambda-list (if aroundp '(orig-fun &rest args) '(&rest args))) (aname (if (listp function*) 'speechd-speak 'speechd-speak-user))) `(progn ,@(mapcar (lambda (fname) `(define-advice ,fname (,where ,lambda-list ,aname) (cl-flet ,(when aroundp `((call-orig-func () (apply orig-fun args)))) (if (not speechd-speak--started) ,(if aroundp `(call-orig-func) 'args) ;; not nil, to silence warnings about unused `args' ,@body)))) functions)))) (defmacro speechd-speak--report (feedback &rest args) (if (stringp feedback) `(speechd-speak-report ,feedback ,@args) feedback)) (defmacro speechd-speak-function-feedback (function position feedback) "Report FEEDBACK on each invocation of FUNCTION. FUNCTION is a function name. POSITION may be one of the symbols `before' (the feedback is run before the function is invoked) or `after' (the feedback is run after the function is invoked. FEEDBACK is a string or a sexp. If it is a string, it is simply passed as an argument to `speechd-speak-report'. If it is a sexp then it is evaluated as it is when the feedback is run; the expression must itself deliver something to output (by using speechd-speak-report or other function)." `(speechd-speak--defadvice ,(list function) ,position (speechd-speak--report ,feedback :priority 'message))) (defmacro speechd-speak-command-feedback (function position feedback) "Report FEEDBACK on each invocation of FUNCTION. The arguments are the same as in `speechd-speak-function-feedback'. Unlike `speechd-speak-function-feedback', the feedback is reported only when FUNCTION is invoked interactively." `(speechd-speak--defadvice ,(list function) ,position (when (called-interactively-p 'interactive) (speechd-speak--report ,feedback :priority 'message)))) (defmacro speechd-speak--command-feedback (commands position &rest body) (let ((commands* (if (listp commands) commands (list commands))) (position* position) (body* `(progn (speechd-speak--reset-command-start-info) ,@body))) `(progn ,@(mapcar #'(lambda (command) `(speechd-speak--defadvice ,command ,position* ,(if (eq position* 'around) `(if (called-interactively-p 'interactive) ,body* (call-orig-func)) `(when (called-interactively-p 'interactive) ,body*)))) commands*) ,(unless (eq position 'before) `(setq speechd-speak-command-done t))))) (defmacro speechd-speak--command-feedback-region (commands) `(speechd-speak--command-feedback ,commands around (let ((start (point))) (prog1 (call-orig-func) (speechd-speak--speak-piece start))))) (cl-defun speechd-speak--next-property-change (&optional (point (point)) (limit (point-max))) (next-char-property-change point limit)) (cl-defun speechd-speak--previous-property-change (&optional (point (point)) (limit (point-min))) ;; Let's be careful about isearch overlays not to cut texts in isearch (let* ((i-overlays (and isearch-mode (cl-intersection (overlays-at (- point 2)) (append (list isearch-overlay) isearch-opened-overlays isearch-lazy-highlight-overlays)))) (i-overlays-start (1- (apply #'min (1+ point) (mapcar #'overlay-start i-overlays))))) (when (>= i-overlays-start limit) ;; This may omit other property borders as well. But in isearch we ;; should retain enough context anyway. (setq point i-overlays-start)) (previous-char-property-change point limit))) (defmacro speechd-speak--with-updated-text (&rest body) `(speechd-out-with-updated-text (speechd-speak--updated-text) ,@body)) (defun speechd-speak-set-language (language) "Set default language to LANGUAGE. Language must be an RFC 1766 language code, as a string." (interactive "sLanguage: ") (speechd-set-language language) (setq speechd-language language)) (defun speechd-speak--language (&optional special) (or (and special speechd-speak-emacs-language) speechd-language)) (defun speechd-speak--in-comint-p () "Return non-nil if the current buffer is any sort of a comint buffer." (and (boundp 'comint-accum-marker) comint-accum-marker)) (defvar speechd-speak--marker-counter 0) (defun speechd-speak--markers (beg end) ;; Return list of (POSITION INDEX MARKER) (let ((regexp speechd-speak-index-mark-regexp) (markers '())) (when (string= regexp "") (setq regexp (or sentence-end "[.,;!?]+"))) (save-excursion (goto-char beg) (while (re-search-forward regexp end t) (push (list (cl-incf speechd-speak--marker-counter) (point-marker)) markers))) (mapcar #'(lambda (m) (cons (- (marker-position (cl-second m)) beg) m)) markers))) ;;; Basic speaking (speechd-speak--command-feedback (next-line previous-line) after (speechd-speak-read-line (not speechd-speak-whole-line))) (speechd-speak--command-feedback (forward-word backward-word) after (speechd-speak-read-word)) (speechd-speak--command-feedback (forward-sentence backward-sentence) after (speechd-speak-read-sentence)) (speechd-speak--command-feedback (forward-paragraph backward-paragraph) after (speechd-speak-read-paragraph)) (speechd-speak--command-feedback (forward-page backward-page) after (speechd-speak-read-page)) (speechd-speak--command-feedback (scroll-up scroll-down) after (speechd-speak--window-contents)) (speechd-speak--command-feedback-region (backward-sexp forward-sexp forward-list backward-list up-list backward-up-list down-list)) (speechd-speak--command-feedback (upcase-word downcase-word capitalize-word) after (speechd-speak-read-word)) (defun speechd-speak--store-deleted-chars (text) (speechd-speak--with-command-start-info (setf (speechd-speak--cinfo deleted-chars) text))) (speechd-speak--defadvice (delete-backward-char backward-delete-char) around (if (speechd-speak--command-start-info) (speechd-speak--with-command-start-info (let ((speechd-speak--deleted-chars (when speechd-speak-deleted-char (speechd-speak--buffer-substring (max (- (point) (or (cl-first args) 1)) (point-min)) (point))))) (apply orig-fun args) (speechd-speak--store-deleted-chars (if speechd-speak-deleted-char speechd-speak--deleted-chars (format "%c" (preceding-char)))))) (call-orig-func))) (speechd-speak--defadvice (delete-forward-char delete-char) around (let ((speechd-speak--deleted-chars (when speechd-speak-deleted-char (speechd-speak--buffer-substring (point) (min (+ (point) (or (cl-first args) 1)) (point-max)))))) (call-orig-func) (speechd-speak--store-deleted-chars (if speechd-speak-deleted-char speechd-speak--deleted-chars (format "%c" (following-char)))))) (speechd-speak--command-feedback (quoted-insert) after (speechd-speak-read-char (preceding-char))) (speechd-speak--command-feedback (newline newline-and-indent) before (speechd-speak-read-line)) (speechd-speak--command-feedback (undo) after (speechd-speak-read-line)) ;;; Killing and yanking (speechd-speak--command-feedback (kill-word) before (speechd-speak-read-word)) (speechd-speak--command-feedback (backward-kill-word) before (save-excursion (forward-word -1) (speechd-speak-read-word))) (speechd-speak--command-feedback (kill-line) before (speechd-speak-read-line t)) (speechd-speak--command-feedback (kill-sexp) before (speechd-speak-read-sexp)) (speechd-speak--command-feedback (kill-sentence) before (speechd-speak-read-sentence)) (speechd-speak--command-feedback (zap-to-char) after (speechd-speak-read-line)) (speechd-speak--command-feedback (yank yank-pop) after (speechd-speak-read-region)) (speechd-speak--command-feedback (kill-region completion-kill-region) around (let ((nlines (count-lines (region-beginning) (region-end)))) (prog1 (call-orig-func) (speechd-speak--maybe-speak* (message "Killed region containing %s lines" nlines))))) ;;; Messages (defvar speechd-speak--last-message "") (defvar speechd-speak--last-spoken-message "") (defvar speechd-speak--last-spoken-message-time 0) (defun speechd-speak-last-message () "Speak last message from the echo area." (interactive) (speechd-speak--interactive (let ((speechd-speak-input-method-languages nil) (speechd-language (speechd-speak--language t))) (speechd-speak--text speechd-speak--last-message)))) (defun speechd-speak--read-message (message) (let ((speechd-speak--special-area t)) (speechd-speak--maybe-speak ; necessary to select proper connection (speechd-speak--minibuffer-prompt message :icon 'message :priority 'progress)))) (defun speechd-speak--message (message &optional reset-last-spoken) (speechd-speak--maybe-speak* (when (and message (or (not (string= message speechd-speak--last-spoken-message)) (>= (- (float-time) speechd-speak--last-spoken-message-time) speechd-speak-message-time-interval))) (let* ((oldlen (length speechd-speak--last-spoken-message)) (len (length message)) ;; The following tries to handle answers to y-or-n questions, e.g. ;; "Do something? (y or n) y", which are reported as a single ;; string, including the prompt. (message* (if (and (= (- len oldlen) 1) (save-match-data (string-match "\?.*) .$" message)) (string= (substring message 0 oldlen) speechd-speak--last-spoken-message)) (substring message oldlen) message))) (setq speechd-speak--last-message message speechd-speak--last-spoken-message message speechd-speak--last-spoken-message-time (float-time)) (speechd-speak--read-message message*))) (when reset-last-spoken (setq speechd-speak--last-spoken-message "")))) (defun speechd-speak--current-message (&optional reset-last-spoken) (speechd-speak--message (current-message) reset-last-spoken)) (speechd-speak--defadvice message after (speechd-speak--current-message)) (defmacro speechd-speak--unhide-message (function) ;; If `message' is invoked within a built-in function, there's no way to get ;; notified automatically about it. So we have to wrap the built-in ;; functions displaying messages to check for the otherwise hidden messages. `(speechd-speak--defadvice ,function after (unless (string= (current-message) speechd-speak--last-message) (speechd-speak--current-message)))) (speechd-speak--unhide-message write-region) ;;; Minibuffer (defvar speechd-speak--minibuffer-inherited-language nil) (speechd-speak--defadvice read-from-minibuffer around (let ((speechd-speak--minibuffer-inherited-language (and (cl-seventh args) speechd-language))) (call-orig-func))) (defun speechd-speak--prompt (prompt &optional no-icon) (speechd-speak--text prompt :priority 'message :icon (unless no-icon 'minibuffer))) (defun speechd-speak--speak-minibuffer-prompt () (speechd-speak--with-command-start-info ;; Discard changes, otherwise they would be read *after* the prompt, perhaps ;; confusing the user (setf (speechd-speak--cinfo changes) '())) (let ((speechd-language (speechd-speak--language t)) (speechd-speak-input-method-languages nil)) (speechd-speak--prompt (minibuffer-prompt))) (speechd-speak--prompt (minibuffer-contents) t)) (defun speechd-speak--minibuffer-setup-hook () (set (make-local-variable 'speechd-language) speechd-speak--minibuffer-inherited-language) (speechd-speak--enforce-speak-mode) (speechd-speak--with-command-start-info (setf (speechd-speak--cinfo minibuffer-contents) (minibuffer-contents))) (speechd-speak--speak-minibuffer-prompt)) (defun speechd-speak--minibuffer-exit-hook () (speechd-speak--with-command-start-info (setf (speechd-speak--cinfo minibuffer-contents) 'unset))) (defun speechd-speak--speak-minibuffer () (speechd-speak--text (minibuffer-contents))) (defvar speechd-speak--last-other-changes "") (defvar speechd-speak--last-other-changes-buffer nil) (defun speechd-speak--read-changes (text buffer &rest speak-args) (with-current-buffer (or (get-buffer buffer) (current-buffer)) (apply #'speechd-speak--text text speak-args))) (defun speechd-speak--read-other-changes () (speechd-speak--with-command-start-info (when (speechd-speak--cinfo other-changes) (let ((speechd-speak--special-area nil) (buffer (get-buffer (speechd-speak--cinfo other-changes-buffer))) (text (mapconcat #'identity (nreverse (speechd-speak--cinfo other-changes)) ""))) (setq speechd-speak--last-other-changes text speechd-speak--last-other-changes-buffer buffer) (speechd-speak--read-changes text buffer :priority 'message)) (setf (speechd-speak--cinfo other-changes) '())))) (defun speechd-speak-last-insertions () "Speak last insertions read in buffers with automatic insertion speaking. This command applies to buffers defined in `speechd-speak-insertions-in-buffers' and `speechd-speak-priority-insertions-in-buffers'." (interactive) (speechd-speak--interactive (let ((speechd-speak--special-area nil)) (speechd-speak--read-changes speechd-speak--last-other-changes speechd-speak--last-other-changes-buffer)))) (defun speechd-speak--minibuffer-prompt (prompt &rest args) (speechd-speak--read-other-changes) (let ((speechd-language (speechd-speak--language t)) (speechd-speak-input-method-languages nil)) (apply #'speechd-speak--text prompt args))) (speechd-speak--command-feedback minibuffer-message after (speechd-speak--minibuffer-prompt (cl-first args) :priority 'notification)) ;; Some built-in functions, reading a single character answer, prompt in the ;; echo area. They don't invoke minibuffer-setup-hook and may put other ;; messages to the echo area by invoking other built-in functions. There's no ;; easy way to catch the prompts and messages, the only way to deal with this ;; is to use idle timers. (defvar speechd-speak--message-timer nil) (defun speechd-speak--message-timer () (let ((message (current-message))) (when (and cursor-in-echo-area (not (string= message speechd-speak--last-spoken-message))) (let ((speechd-speak--emulate-minibuffer t)) (speechd-speak--minibuffer-prompt message)) (setq speechd-speak--last-spoken-message message)))) ;; The following functions don't invoke `minibuffer-setup-hook' and don't put ;; the cursor into the echo area. Sigh. (speechd-speak--defadvice read-key-sequence before (let ((prompt (cl-first args)) (speechd-speak--emulate-minibuffer t)) (when prompt (speechd-speak--minibuffer-prompt prompt :priority 'message)))) (speechd-speak--defadvice read-event before (let ((prompt (cl-first args))) (when prompt (let ((speechd-speak--emulate-minibuffer t) (speechd-language (speechd-speak--language (not (cl-second args))))) (speechd-speak--minibuffer-prompt prompt :priority 'message))))) ;;; Repetition in character reading commands (defvar speechd-speak-read-char-keymap (make-sparse-keymap) "Keymap used by speechd-el for repetitions during reading characters. Only single characters are allowed in the keymap.") (define-key speechd-speak-read-char-keymap "\C-a" 'speechd-speak-last-insertions) (define-key speechd-speak-read-char-keymap "\C-e" 'speechd-speak-last-message) (speechd-speak--defadvice read-char-exclusive around (if speechd-speak-allow-prompt-commands (let ((char nil)) (while (not char) (setq char (call-orig-func)) (let ((command (lookup-key speechd-speak-read-char-keymap (vector char)))) (when command (setq char nil) (call-interactively command)))) char) (call-orig-func))) ;;; Commands (defun speechd-speak--updated-text () (let ((line-beg (line-beginning-position)) (line-end (line-end-position))) (make-speechd-out-update :text (speechd-speak--buffer-substring line-beg line-end) :cursor (- (point) line-beg) :group 'line))) (defun speechd-speak--command-keys (&optional priority) (speechd-speak--maybe-speak (let* ((keys-to-output '()) (text-to-output nil) (command-keys (append (this-command-keys-vector) nil))) (while (and command-keys (not text-to-output)) (let ((key (car command-keys))) (push key keys-to-output) (setq text-to-output (and (equal (event-basic-type key) ?x) (equal (event-modifiers key) '(meta)) (apply #'concat (mapcar #'(lambda (k) (let ((km (event-modifiers k)) (kb (event-basic-type k))) (if (or (not (numberp kb)) (< kb 32) (>= kb 128) km) (char-to-string kb) ""))) (cdr command-keys))))) (setq command-keys (cdr command-keys)))) (speechd-out-keys (nreverse keys-to-output) :text text-to-output :priority priority)))) (defun speechd-speak--add-command-text (beg end) (let ((last (cl-first (speechd-speak--cinfo changes))) (last-end (speechd-speak--cinfo change-end)) (text (speechd-speak--buffer-substring beg end t))) (setf (speechd-speak--cinfo change-end) end) (cond ((and last (string= last text)) ;; nothing to do ) ((and last-end (= last-end beg)) (rplaca (speechd-speak--cinfo changes) (concat last (speechd-speak--buffer-substring beg end t)))) (t (push text (speechd-speak--cinfo changes)))))) (defun speechd-speak--buffer-substring (beg end &optional maybe-align-p) (let ((text (buffer-substring (if (and maybe-align-p speechd-speak-align-buffer-insertions (not (eq this-command 'self-insert-command))) (save-excursion (goto-char beg) (when (save-match-data (and (looking-at "\\w") (not (looking-at "\\<")))) (backward-word 1)) (point)) beg) end))) (dolist (o (overlays-in beg end)) (let ((face (overlay-get o 'face)) (invisible (overlay-get o 'invisible))) (when (or face invisible) (let ((beg* (max (overlay-start o) beg)) (end* (min (overlay-end o) end))) (add-text-properties (- beg* beg) (- end* beg) `(face ,face invisible ,invisible) text))))) text)) (defun speechd-speak--minibuffer-update-report (old new) (speechd-speak--add-command-text (+ (minibuffer-prompt-end) (if (and (<= (length old) (length new)) (string= old (substring new 0 (length old)))) (length old) 0)) (point-max))) (defun speechd-speak--minibuffer-update () (speechd-speak--with-command-start-info (let ((old-content (speechd-speak--cinfo minibuffer-contents)) (new-content (minibuffer-contents))) (unless (or (eq old-content 'unset) (string= old-content new-content)) (setf (speechd-speak--cinfo minibuffer-contents) new-content) (speechd-speak--minibuffer-update-report old-content new-content))))) (defun speechd-speak--read-buffer-change (buffer-name text) (with-current-buffer (or (get-buffer buffer-name) (get-buffer "*scratch*") (current-buffer)) (speechd-speak--text text :priority 'message))) (defvar speechd-speak--current-change-string nil) (defun speechd-speak--before-change-hook (beg end) ;; Beware, before-change-functions may be sometimes called for several times ;; with different arguments (an Emacs bug?) (unless speechd-speak--current-change-string (setq speechd-speak--current-change-string (buffer-substring-no-properties beg end)))) (defun speechd-speak--after-change-hook (beg end _len) (speechd-speak--enforce-speak-mode) (speechd-speak--with-command-start-info (unless (or (= beg end) ;; Avoid reading changes when only text properties have changed (equal speechd-speak--current-change-string (buffer-substring-no-properties beg end))) (cond ((or (member (buffer-name) speechd-speak-priority-insertions-in-buffers) (speechd-speak--in-comint-p) ;; Asynchronous buffer changes (and (not this-command) (member (buffer-name) speechd-speak-insertions-in-buffers))) (unless (memq this-command '(self-insert-command quoted-insert newline newline-and-indent undo yank yank-pop)) ;; Don't align buffer substring here so that the last word of comint ;; input is not read (speechd-speak--read-buffer-change (buffer-name) (speechd-speak--buffer-substring beg end nil)))) ((not this-command) ;; Asynchronous buffer change -- we are not interested in it by ;; default nil) ((member (buffer-name) speechd-speak-insertions-in-buffers) (setf (speechd-speak--cinfo other-changes-buffer) (buffer-name)) (push (speechd-speak--buffer-substring beg end t) (speechd-speak--cinfo other-changes))) ((eq (current-buffer) (speechd-speak--cinfo buffer)) (if (speechd-speak--in-minibuffer-p) (progn (speechd-speak--read-other-changes) (speechd-speak--minibuffer-update)) (speechd-speak--add-command-text beg end)))))) (setq speechd-speak--current-change-string nil)) (defconst speechd-speak--dont-cancel-on-commands '(speechd-speak speechd-unspeak speechd-out-cancel speechd-out-stop speechd-out-pause speechd-out-resume)) (defun speechd-speak--pre-command-hook () (condition-case err (progn (unless (or (memq this-command speechd-speak--dont-cancel-on-commands) (and (eq this-command 'self-insert-command) (eq speechd-speak-echo 'word))) (speechd-out-cancel)) (speechd-speak--set-command-start-info) (setq speechd-speak--last-report "") (setq speechd-speak-command-done nil) (when speechd-speak-spell-command (speechd-speak-spell-mode 1)) (speechd-speak--maybe-speak (when (and (eq speechd-speak-read-command-keys t) (not (eq this-command 'self-insert-command)) (not (memq this-command speechd-speak-ignore-command-keys))) (speechd-speak--command-keys 'message)) ;; Some parameters of interactive commands don't set up the ;; minibuffer, so we have to speak the prompt in a special way. (let ((interactive (and (commandp this-command) (cadr (interactive-form this-command))))) (save-match-data (when (and (stringp interactive) (string-match "^[@*]*\\([eipPmnr]\n\\)*[ckK]\\(.+\\)" interactive)) (speechd-speak--prompt (match-string 2 interactive))))))) (error (speechd-speak--debug (list 'pre-command-hook-error err)) (signal (car err) (cdr err)))) (add-hook 'pre-command-hook 'speechd-speak--pre-command-hook)) (defmacro speechd-speak--post-defun (name shy new-state guard &rest body) (let* ((name (speechd-speak--name 'speechd-speak--post-read name)) (state-condition (cl-case shy ((t) `(eq state nil)) (sometimes `(not (eq state t))) (t t)))) `(defun ,name (state buffer-changed buffer-modified point-moved in-minibuffer other-buffer) ;; Avoid compiler warnings about unused variables (list buffer-changed buffer-modified point-moved in-minibuffer other-buffer) (if (and ,state-condition ,guard) (let ((speechd-speak--debug-mark (quote ,name))) ,@body ,new-state) state)))) (speechd-speak--post-defun special-commands t t ;; Speak commands that can't speak in a regular way (and (not speechd-speak-command-done) (memq this-command '(forward-char backward-char right-char left-char))) (speechd-speak--with-updated-text (cond ((looking-at "^") (speechd-speak--char (following-char) :icon 'beginning-of-line)) ((looking-at "$") (speechd-speak-report 'end-of-line :priority speechd-default-char-priority)) (t (speechd-speak-read-char))))) (speechd-speak--post-defun buffer-switch t t ;; Any buffer switch (and buffer-changed (not speechd-speak-command-done)) (when speechd-speak-buffer-name (speechd-speak--text (buffer-name) :priority 'message)) (when (memq speechd-speak-buffer-name '(text nil)) (speechd-speak-read-line t))) (speechd-speak--post-defun deleted-chars t t ;; Reading delete-char etc. interactive feedback (let ((deleted-chars (speechd-speak--cinfo deleted-chars)) (changes (speechd-speak--cinfo changes))) (and (stringp deleted-chars) (or (null changes) (and (= (length changes) 1) (equal (cl-first changes) deleted-chars))))) (when (eq speechd-speak-read-command-keys t) ;; Cancel reading the DEL key etc. -- perhaps too daring? (speechd-out-cancel)) (speechd-speak--with-updated-text (let ((deleted-chars (speechd-speak--cinfo deleted-chars))) (if (= (length deleted-chars) 1) (speechd-speak-read-char (string-to-char deleted-chars)) (speechd-speak--text deleted-chars))))) (speechd-speak--post-defun command-keys t nil ;; Keys that invoked the command (and (not (memq this-command speechd-speak-ignore-command-keys)) (not (eq this-command 'self-insert-command)) (not (eq speechd-speak-read-command-keys t)) (or (and buffer-modified point-moved (memq 'modification-movement speechd-speak-read-command-keys)) (and buffer-modified (not point-moved) (memq 'modification speechd-speak-read-command-keys)) (and (not buffer-modified) point-moved (memq 'movement speechd-speak-read-command-keys)))) (if speechd-speak-read-command-name (speechd-speak--text (symbol-name this-command) :priority 'message) (speechd-speak--command-keys 'message))) (speechd-speak--post-defun command-done t t ;; No speaking when the command has already been handled in a special way speechd-speak-command-done) (speechd-speak--post-defun info-change t nil ;; General status information has changed (not (equal (speechd-speak--cinfo info) (speechd-speak--current-info))) (let ((old-info (speechd-speak--cinfo info)) (new-info (speechd-speak--current-info))) (dolist (item new-info) (let* ((id (car item)) (new (cdr item)) (old (cdr (assq id old-info)))) (when (and (memq id speechd-speak-state-changes) (not (equal old new))) (funcall (speechd-speak--name 'speechd-speak--update id) old new)))))) (speechd-speak--post-defun speaking-commands nil t ;; Avoid additional reading on speaking commands (let ((command-name (symbol-name this-command)) (prefix "speechd-speak-read-")) (and (> (length command-name) (length prefix)) (string= (substring command-name 0 (length command-name)) prefix)))) (speechd-speak--post-defun buffer-modifications t (cond ((eq this-command 'self-insert-command) t) ((not speechd-speak-movement-on-insertions) t) ((and (eq speechd-speak-movement-on-insertions 'read-only) (not buffer-read-only)) t) (t 'insertions)) ;; Any buffer modification, including completion, abbrev expansions and ;; self-insert-command buffer-modified ;; We handle self-insert-command in a special way. We don't speak the ;; inserted character itself, we only read other buffer modifications caused ;; by the command (typically abbrev expansions). Instead of speaking the ;; inserted character, we try to speak the command key. (let ((self-insert (eq this-command 'self-insert-command)) (changes (speechd-speak--cinfo changes))) (when speechd-speak-buffer-insertions (let ((text (mapconcat #'identity (funcall (if self-insert #'butlast #'identity) (reverse changes)) " "))) (when (and self-insert (> (length (cl-first changes)) 1)) (setq text (concat text " " (cl-first changes)))) (cond ((and (eq speechd-speak-buffer-insertions 'whole-buffer) (not self-insert)) (speechd-speak-read-buffer)) (t (speechd-speak--text (if (eq speechd-speak-buffer-insertions t) text (save-match-data (string-match "^.*$" text) (match-string 0 text)))))))) (when (and self-insert speechd-speak-echo (not (memq 'self-insert-command speechd-speak-ignore-command-keys))) (cl-case speechd-speak-echo (word (let ((point (point))) (when (and (> point 1) (not (save-match-data (string-match "\\w" (buffer-substring (1- point) point))))) (speechd-speak--text (buffer-substring (save-excursion (forward-word -1) (point)) point))))) (character (speechd-speak--with-updated-text (speechd-speak--command-keys 'notification))))))) (speechd-speak--post-defun completions t t ;; *Completions* buffer (and in-minibuffer (get-buffer speechd-speak--c-buffer-name) (/= (speechd-speak--cinfo completion-buffer-modified) (buffer-modified-tick (get-buffer speechd-speak--c-buffer-name)))) (with-current-buffer speechd-speak--c-buffer-name (let ((speechd-language (speechd-speak--language t)) (speechd-speak-input-method-languages nil)) (goto-char (point-min)) (save-match-data (re-search-forward "\n\n+" nil t)) (speechd-speak-read-region (point) (point-max) nil)))) (speechd-speak--post-defun special-face-movement sometimes (or (not (stringp (cdr (assq (get-char-property (point) 'face) speechd-speak-faces)))) state) ;; Special face hit (and (not in-minibuffer) point-moved (assq (get-char-property (point) 'face) speechd-speak-faces)) (let ((action (cdr (assq (get-char-property (point) 'face) speechd-speak-faces)))) (cond ((stringp action) (speechd-speak--text action :priority 'message)) ((functionp action) (ignore-errors (funcall action)))))) (speechd-speak--post-defun text-property-movement sometimes t ;; General text or overlay property hit (and (not in-minibuffer) point-moved (not (memq this-command speechd-speak-by-properties-never)) (or (eq speechd-speak-by-properties-on-movement t) (memq this-command speechd-speak-by-properties-always) (memq (get-char-property (point) 'face) speechd-speak-by-properties-on-movement)) (or (let ((properties (text-properties-at (point))) (look-props '(face font-lock-face mouse-face display help-echo keymap local-map read-only field)) (marked nil)) (while (and look-props (not marked)) (setq marked (plist-member properties (car look-props))) (setq look-props (cdr look-props))) marked) (overlays-at (point))) (let ((position (speechd-speak--cinfo point))) (or (> (speechd-speak--previous-property-change (1+ (point)) position) position) (<= (speechd-speak--next-property-change (point) (1+ position)) position)))) (speechd-speak--uniform-text-around-point)) (speechd-speak--post-defun plain-movement sometimes t ;; Other kinds of movement point-moved (speechd-speak-read-line (not speechd-speak-whole-line))) (speechd-speak--post-defun other-window-event t 'other-window ;; Something interesting in other window (and (not in-minibuffer) other-buffer (member (buffer-name other-buffer) speechd-speak-auto-speak-buffers) (or (not (eq (next-window) (speechd-speak--cinfo other-window))) (not (= (buffer-modified-tick other-buffer) (speechd-speak--cinfo other-buffer-modified))))) (speechd-speak-read-buffer (window-buffer (next-window)))) (speechd-speak--post-defun other-window-buffer nil t ;; Other window buffer is very interesting (and (not (eq state 'other-window)) (not in-minibuffer) other-buffer (member (buffer-name other-buffer) speechd-speak-force-auto-speak-buffers) (or (not (eq (next-window) (speechd-speak--cinfo other-window))) (not (= (buffer-modified-tick other-buffer) (speechd-speak--cinfo other-buffer-modified))))) (speechd-speak-read-buffer (window-buffer (next-window)))) (speechd-speak--post-defun minibuffer-exit t t (and speechd-speak-on-minibuffer-exit (/= (minibuffer-depth) speechd-speak--last-minibuffer-depth)) (speechd-speak-read-line t)) (defvar speechd-speak--last-minibuffer-depth 0) (defvar speechd-speak--post-command-speaking-defaults '(speechd-speak--post-read-special-commands speechd-speak--post-read-buffer-switch speechd-speak--post-read-deleted-chars speechd-speak--post-read-command-keys speechd-speak--post-read-command-done speechd-speak--post-read-info-change speechd-speak--post-read-speaking-commands speechd-speak--post-read-buffer-modifications speechd-speak--post-read-completions speechd-speak--post-read-special-face-movement speechd-speak--post-read-text-property-movement speechd-speak--post-read-plain-movement speechd-speak--post-read-other-window-event speechd-speak--post-read-other-window-buffer speechd-speak--post-read-minibuffer-exit)) (defvar speechd-speak--post-command-speaking nil) (defun speechd-speak--post-command-hook () (speechd-speak--enforce-speak-mode) (when (and speechd-speak-spell-command speechd-speak-spell-mode) ;; Only in spell mode to avoid disabling it after speechd-speak-spell (setq speechd-speak-spell-command nil) (speechd-speak-spell-mode 0)) ;; Now, try to speak something useful (speechd-speak--maybe-speak (condition-case err (progn ;; Messages should be handled by an after change function. ;; Unfortunately, in Emacs 21 after change functions in the ;; *Messages* buffer don't work in many situations. This is a ;; property of the Emacs implementation, so the mechanism can't be ;; used. (speechd-speak--current-message t) (speechd-speak--with-command-start-info (let* ((state nil) (buffer-changed (not (eq (speechd-speak--cinfo buffer) (current-buffer)))) (buffer-modified (and (not buffer-changed) (/= (speechd-speak--cinfo modified) (buffer-modified-tick)))) (point-moved (and (not buffer-changed) (not (= (speechd-speak--cinfo point) (point))))) (in-minibuffer (speechd-speak--in-minibuffer-p)) (other-window (next-window)) (other-buffer (let* ((buffer (and other-window (window-buffer other-window)))) (unless (eq buffer (current-buffer)) buffer)))) (dolist (f speechd-speak--post-command-speaking) (let ((new-state state)) (condition-case err (setq new-state (funcall f state buffer-changed buffer-modified point-moved in-minibuffer other-buffer)) (error (speechd-speak--debug (list 'post-command-hook-error f err)) (setq speechd-speak--post-command-speaking (remove f speechd-speak--post-command-speaking)))) (setq state new-state))) (setq speechd-speak--last-minibuffer-depth (minibuffer-depth))))) (error (speechd-speak--debug (list 'post-command-hook-top-error err)) (signal (car err) (cdr err)))) (add-hook 'post-command-hook 'speechd-speak--post-command-hook))) ;;; Comint (speechd-speak--command-feedback comint-show-output after (speechd-speak-read-region)) ;;; Completions, menus, etc. (defun speechd-speak--speak-completion () ;; Taken from `choose-completion' (let (beg end completion) (if (and (not (eobp)) (get-text-property (point) 'mouse-face)) (setq end (point) beg (1+ (point)))) (if (and (not (bobp)) (get-text-property (1- (point)) 'mouse-face)) (setq end (1- (point)) beg (point))) (if (null beg) (error "No completion here")) (setq beg (previous-single-property-change beg 'mouse-face)) (setq end (or (next-single-property-change end 'mouse-face) (point-max))) (setq completion (speechd-speak--buffer-substring beg end)) (speechd-speak--text completion) (speechd-speak--reset-command-start-info))) (speechd-speak--command-feedback (next-completion previous-completion) after (speechd-speak--speak-completion)) (speechd-speak--command-feedback choose-completion before (speechd-speak--speak-completion)) (speechd-speak--defadvice widget-choose around (let ((widget-menu-minibuffer-flag (or speechd-speak-mode widget-menu-minibuffer-flag))) (call-orig-func))) ;;; Other functions and packages (speechd-speak--command-feedback (occur-prev occur-next occur-mode-goto-occurence) after (speechd-speak-read-line)) (speechd-speak--command-feedback transpose-chars after (speechd-speak--char (following-char))) (speechd-speak--command-feedback transpose-lines after (speechd-speak-read-line)) (speechd-speak--command-feedback transpose-words after (speechd-speak-read-word)) (speechd-speak--command-feedback transpose-sexps after (speechd-speak-read-sexp)) (speechd-speak--command-feedback undefined after (speechd-speak--text "No command on this key")) (speechd-speak--command-feedback indent-for-tab-command after (speechd-speak--speak-current-column)) (defvar speechd-speak--handle-braille-keys nil) (defun speechd-speak-toggle-braille-keys () (interactive) (speechd-out-set 'brltty-accept-keys (not speechd-speak--handle-braille-keys)) (setq speechd-speak--handle-braille-keys (not speechd-speak--handle-braille-keys)) (message "Braille keys handled by %s" (if speechd-speak--handle-braille-keys "speechd-el" "BrlTTY"))) ;;; Spelling (define-minor-mode speechd-speak-spell-mode "Toggle spelling. When the mode is enabled, all spoken text is spelled." nil " Spell" nil (set (make-local-variable 'speechd-spell) speechd-speak-spell-mode)) (defvar speechd-speak-spell-command nil) (defun speechd-speak-spell () "Let the very next command to spell the text it reads." (interactive) (unless speechd-speak-spell-mode (setq speechd-speak-spell-command t))) ;;; Informatory commands (defvar speechd-speak-info-map (make-sparse-keymap)) (defvar speechd-speak--info-updates nil) (cl-defmacro speechd-speak--watch (name get-function &key on-change info info-string key) `(progn (fset (quote ,(speechd-speak--name 'speechd-speak--get name)) ,get-function) ,(when info `(fset (quote ,(speechd-speak--name 'speechd-speak name 'info)) #'(lambda (info) (interactive) (funcall ,info info)))) ,(when info-string `(fset (quote ,(speechd-speak--name 'speechd-speak name 'info)) #'(lambda () (interactive) (speechd-speak--text (format ,info-string (funcall (function ,(speechd-speak--name 'speechd-speak--get name)))))))) ,(when (and (or info info-string) key) `(define-key speechd-speak-info-map ,key (quote ,(speechd-speak--name 'speechd-speak name 'info)))) ,(when on-change `(defun ,(speechd-speak--name 'speechd-speak--update name) (old new) (speechd-speak--maybe-speak (let ((speechd-default-text-priority 'message) (speechd-language (speechd-speak--language t)) (speechd-speak-input-method-languages nil)) (funcall ,on-change old new))))) ,(when on-change `(add-to-list 'speechd-speak--info-updates (quote ,name))))) (speechd-speak--watch buffer-name #'buffer-name :on-change #'(lambda (_old new) (speechd-speak--text (format "Buffer %s" new)))) (speechd-speak--watch buffer-identification #'(lambda () (when (fboundp 'format-mode-line) (let ((ident (format-mode-line mode-line-buffer-identification))) (set-text-properties 0 (length ident) nil ident) ident))) :on-change #'(lambda (_old new) (speechd-speak--text (format "New buffer identification: %s" new)))) (speechd-speak--watch buffer-modified #'buffer-modified-p :on-change #'(lambda (_old new) (speechd-speak--text (if new "Buffer modified" "No buffer modification")))) (speechd-speak--watch buffer-read-only #'(lambda () buffer-read-only) :on-change #'(lambda (_old new) (speechd-speak--text (if new "Buffer writable" "Buffer read-only")))) (defun speechd-speak-buffer-info () "Speak current buffer information." (interactive) (speechd-speak--text (format "Buffer %s, %s %s %s; %s" (speechd-speak--get-buffer-name) (or vc-mode "") (if (speechd-speak--get-buffer-read-only) "read only" "") (if (speechd-speak--get-buffer-modified) "modified" "") (let ((ident (speechd-speak--get-buffer-identification))) (if ident (format "buffer identification: %s" ident) ""))))) (define-key speechd-speak-info-map "b" 'speechd-speak-buffer-info) (speechd-speak--watch frame-name #'(lambda () (frame-parameter nil 'name)) :on-change #'(lambda (old new) (speechd-speak--text (format "Frame changed to: %s; was: %s" new old)))) (speechd-speak--watch frame-identification #'(lambda () (when (fboundp 'format-mode-line) (let ((ident (format-mode-line mode-line-frame-identification))) (set-text-properties 0 (length ident) nil ident) ident))) :on-change #'(lambda (_old new) (speechd-speak--text (format "Frame identification changed to: %s" new)))) (defun speechd-speak-frame-info () "Speak current frame information." (interactive) (speechd-speak--text (format "Frame: %s; %s" (speechd-speak--get-frame-name) (let ((ident (speechd-speak--get-frame-identification))) (if ident (format "frame identification: %s" ident) ""))))) (define-key speechd-speak-info-map "f" 'speechd-speak-frame-info) (speechd-speak--watch header-line #'(lambda () (if (fboundp 'format-mode-line) (let ((line (format-mode-line header-line-format))) (if (string= line "") "empty" line)) "unknown")) :on-change #'(lambda (_old new) (speechd-speak--text (format "Header line changed to: %s" new))) :info-string "Header line: %s" :key "h") (speechd-speak--watch major-mode #'(lambda () mode-name) :on-change #'(lambda (old new) (speechd-speak--text (format "Major mode changed to: %s; was: %s" new old)))) (speechd-speak--watch minor-modes #'(lambda () (cl-loop for mode-spec in minor-mode-alist for mode = (car mode-spec) when (and (boundp mode) (symbol-value mode)) collect (if (memq mode speechd-speak-display-modes) (cadr mode-spec) mode))) :on-change #'(lambda (old new) (cl-flet ((set-difference (x y) (cl-loop for i in x unless (memq i y) collect i))) (let ((disabled (set-difference old new)) (enabled (set-difference new old))) (when enabled (speechd-speak--text (format "Enabled minor modes: %s" enabled))) (when disabled (speechd-speak--text (format "Disabled minor modes: %s" disabled))))))) (defun speechd-speak-mode-info () "Speak information about current major and minor modes." (interactive) (speechd-speak--text (format "Major mode: %s; minor modes: %s" (speechd-speak--get-major-mode) (speechd-speak--get-minor-modes)))) (define-key speechd-speak-info-map "m" 'speechd-speak-mode-info) (speechd-speak--watch buffer-file-coding #'(lambda () buffer-file-coding-system) :on-change #'(lambda (old new) (speechd-speak--text (format "Buffer file coding changed to: %s; was %s" new old)))) (speechd-speak--watch terminal-coding #'terminal-coding-system :on-change #'(lambda (old new) (speechd-speak--text (format "Terminal coding changed to: %s; was: %s" new old)))) (defun speechd-speak-coding-info () "Speak information about current codings." (interactive) (speechd-speak--text (format "Buffer file coding is %s, terminal coding is %s" (speechd-speak--get-buffer-file-coding) (speechd-speak--get-terminal-coding)))) (define-key speechd-speak-info-map "c" 'speechd-speak-coding-info) (speechd-speak--watch input-method #'(lambda () (or current-input-method "none")) :on-change #'(lambda (old new) (speechd-speak--text (format "Input method changed to: %s; was: %s" new old))) :info-string "Input method %s" :key "i") (speechd-speak--watch process #'(lambda () (let ((process (get-buffer-process (current-buffer)))) (and process (process-status process)))) :on-change #'(lambda (old new) (speechd-speak--text (format "Process status changed to: %s; was: %s" new old))) :info-string "Process status: %s" :key "p") (defcustom speechd-speak-state-changes '(buffer-identification buffer-read-only frame-name frame-identification major-mode minor-modes buffer-file-coding terminal-coding input-method process) "List of identifiers of the Emacs state changes to be automatically reported. The following symbols are valid state change identifiers: `buffer-name', `buffer-identification', `buffer-modified', `buffer-read-only', `frame-name', `frame-identification', `header-line', `major-mode', `minor-modes', `buffer-file-coding', `terminal-coding', `input-method', `process'." :type `(set ,@(mapcar #'(lambda (i) `(const ,i)) (reverse speechd-speak--info-updates))) :group 'speechd-speak) (defun speechd-speak--current-info () (sort (mapcar #'(lambda (i) (cons i (funcall (speechd-speak--name 'speechd-speak--get i)))) speechd-speak--info-updates) #'(lambda (x y) (string< (symbol-name (car x)) (symbol-name (car y)))))) ;;; Mode definition (defvar speechd-speak-mode-map nil "Keymap used by speechd-speak-mode.") (define-prefix-command 'speechd-speak-prefix-command 'speechd-speak-mode-map) (define-key speechd-speak-mode-map "b" 'speechd-speak-read-buffer) (define-key speechd-speak-mode-map "c" 'speechd-speak-read-char) (define-key speechd-speak-mode-map "i" 'speechd-speak-last-insertions) (define-key speechd-speak-mode-map "l" 'speechd-speak-read-line) (define-key speechd-speak-mode-map "m" 'speechd-speak-last-message) (define-key speechd-speak-mode-map "o" 'speechd-speak-read-other-window) (define-key speechd-speak-mode-map "p" 'speechd-out-pause) (define-key speechd-speak-mode-map "q" 'speechd-speak-toggle-speaking) (define-key speechd-speak-mode-map "r" 'speechd-speak-read-region) (define-key speechd-speak-mode-map "s" 'speechd-out-stop) (define-key speechd-speak-mode-map "w" 'speechd-speak-read-word) (define-key speechd-speak-mode-map "x" 'speechd-out-cancel) (define-key speechd-speak-mode-map "z" 'speechd-out-repeat) (define-key speechd-speak-mode-map "." 'speechd-speak-read-sentence) (define-key speechd-speak-mode-map "{" 'speechd-speak-read-paragraph) (define-key speechd-speak-mode-map " " 'speechd-out-resume) (define-key speechd-speak-mode-map "'" 'speechd-speak-read-sexp) (define-key speechd-speak-mode-map "[" 'speechd-speak-read-page) (define-key speechd-speak-mode-map ">" 'speechd-speak-read-rest-of-buffer) (define-key speechd-speak-mode-map "\C-a" 'speechd-add-connection-settings) (define-key speechd-speak-mode-map "\C-i" speechd-speak-info-map) (define-key speechd-speak-mode-map "\C-l" 'speechd-speak-spell) (define-key speechd-speak-mode-map "\C-m" 'speechd-speak-read-mode-line) (define-key speechd-speak-mode-map "\C-n" 'speechd-speak-read-next-line) (define-key speechd-speak-mode-map "\C-p" 'speechd-speak-read-previous-line) (define-key speechd-speak-mode-map "\C-r" 'speechd-speak-read-rectangle) (define-key speechd-speak-mode-map "\C-s" 'speechd-speak) (define-key speechd-speak-mode-map "\C-x" 'speechd-unspeak) (define-key speechd-speak-mode-map "\C-bk" 'speechd-speak-toggle-braille-keys) (dotimes (i 9) (define-key speechd-speak-mode-map (format "%s" (1+ i)) 'speechd-speak-key-set-predefined-rate)) (define-key speechd-speak-mode-map "d." 'speechd-set-punctuation-mode) (define-key speechd-speak-mode-map "dc" 'speechd-set-capital-character-mode) (define-key speechd-speak-mode-map "dl" 'speechd-speak-set-language) (define-key speechd-speak-mode-map "do" 'speechd-set-output-module) (define-key speechd-speak-mode-map "dp" 'speechd-set-pitch) (define-key speechd-speak-mode-map "dr" 'speechd-set-rate) (define-key speechd-speak-mode-map "dv" 'speechd-set-voice) (define-key speechd-speak-mode-map "d\C-v" 'speechd-set-synthesizer-voice) (define-key speechd-speak-mode-map "dV" 'speechd-set-volume) (defvar speechd-speak--mode-map (make-sparse-keymap)) (defvar speechd-speak--prefix nil) (defun speechd-speak--build-mode-map () (let ((map speechd-speak--mode-map)) (when speechd-speak--prefix (define-key map speechd-speak--prefix nil)) (setq speechd-speak--prefix speechd-speak-prefix) (define-key map speechd-speak-prefix 'speechd-speak-prefix-command) (unless (lookup-key speechd-speak-mode-map speechd-speak-prefix) (define-key map (concat speechd-speak-prefix speechd-speak-prefix) (lookup-key global-map speechd-speak-prefix))))) (define-minor-mode speechd-speak-map-mode "Toggle use of speechd-speak keymap. With no argument, this command toggles the mode. Non-null prefix argument turns on the mode. Null prefix argument turns off the mode." nil nil speechd-speak--mode-map) (easy-mmode-define-global-mode global-speechd-speak-map-mode speechd-speak-map-mode (lambda () (speechd-speak-map-mode 1)) :group 'speechd-speak) (defun speechd-speak--shutdown () ;; We don't have to call CANCEL here, since Emacs exit is usually called ;; interactively, so it is preceded by the pre-command CANCEL. Moreover, ;; calling CANCEL here means trouble with stopping the final exit messages. (speechd-speak-report 'finish :priority 'important)) ;;;###autoload (define-minor-mode speechd-speak-mode "Toggle speaking, the speechd-speak mode. With no argument, this command toggles the mode. Non-null prefix argument turns on the mode. Null prefix argument turns off the mode. When speechd-speak mode is enabled, speech output is provided to Speech Dispatcher on many actions. The following key bindings are offered by speechd-speak mode, prefixed with the value of the `speechd-speak-prefix' variable: \\{speechd-speak-mode-map} " nil " S" speechd-speak--mode-map (if speechd-speak-mode (progn (speechd-speak-map-mode 1) (add-hook 'pre-command-hook 'speechd-speak--pre-command-hook) (add-hook 'post-command-hook 'speechd-speak--post-command-hook) (add-hook 'before-change-functions 'speechd-speak--before-change-hook) (add-hook 'after-change-functions 'speechd-speak--after-change-hook) (add-hook 'minibuffer-setup-hook 'speechd-speak--minibuffer-setup-hook) (add-hook 'minibuffer-exit-hook 'speechd-speak--minibuffer-exit-hook) (add-hook 'kill-emacs-hook 'speechd-speak--shutdown)) ;; We used to call `speechd-cancel' here, but that slows down global mode ;; disabling if there are many buffers present. So `speechd-cancel' is ;; called only on global mode disabling now. ) (when (called-interactively-p 'interactive) (let ((state (if speechd-speak-mode "on" "off")) (speechd-speak-mode t)) (message "Speaking turned %s" state)))) ;;;###autoload (easy-mmode-define-global-mode global-speechd-speak-mode speechd-speak-mode (lambda () (speechd-speak-mode 1)) :group 'speechd-speak) (speechd-speak--defadvice global-speechd-speak-mode before (when global-speechd-speak-mode (speechd-out-cancel))) ;; global-speechd-speak-map-mode is not enabled until kill-all-local-variables ;; is called. So we have to be a bit more aggressive about it sometimes. The ;; same applies to global-speechd-speak-mode. (defun speechd-speak--enforce-speak-mode () (cl-flet ((enforce-mode (global-mode local-mode-var) (when (and global-mode (not (symbol-value local-mode-var)) (not (local-variable-p local-mode-var))) (funcall local-mode-var 1)))) (enforce-mode global-speechd-speak-map-mode 'speechd-speak-map-mode) (enforce-mode global-speechd-speak-mode 'speechd-speak-mode))) (defun speechd-speak-toggle-speaking (arg) "Toggle speaking. When prefix ARG is non-nil, toggle it locally, otherwise toggle it globally." (interactive "P") (if arg (speechd-speak-mode 'toggle) (global-speechd-speak-mode 'toggle)) (when (called-interactively-p 'interactive) (let ((state (if speechd-speak-mode "on" "off")) (speechd-speak-mode t)) (message "Speaking turned %s %s" state (if arg "locally" "globally"))))) (defun speechd-unspeak () "Try to avoid invoking any speechd-speak function. This command is useful as the last help in case speechd-speak gets crazy and starts blocking your Emacs functions." (interactive) (setq speechd-speak--started nil) (ignore-errors (global-speechd-speak-mode -1)) (when speechd-speak--message-timer (cancel-timer speechd-speak--message-timer) (setq speechd-speak--message-timer nil)) (remove-hook 'pre-command-hook 'speechd-speak--pre-command-hook) (remove-hook 'post-command-hook 'speechd-speak--post-command-hook) (remove-hook 'before-change-functions 'speechd-speak--before-change-hook) (remove-hook 'after-change-functions 'speechd-speak--after-change-hook) (remove-hook 'minibuffer-setup-hook 'speechd-speak--minibuffer-setup-hook) (remove-hook 'minibuffer-exit-hook 'speechd-speak--minibuffer-exit-hook) (remove-hook 'kill-emacs-hook 'speechd-speak--shutdown) (speechd-out-shutdown) (global-speechd-speak-map-mode -1)) ;;;###autoload (defun speechd-speak () "Start or restart speaking." (interactive) (when speechd-speak--started (speechd-unspeak)) (setq speechd-speak--started t) (speechd-speak--build-mode-map) (setq speechd-speak--post-command-speaking speechd-speak--post-command-speaking-defaults) (global-speechd-speak-mode 1) (global-speechd-speak-map-mode 1) (speechd-speak--debug 'start) (condition-case err (speechd-speak-report 'start) (speechd-connection-error (message (format "%s: %s" (car err) (cdr err))) (sit-for 2) (message "Customize `speechd-out-active-drivers' to disable drivers you don't use."))) (setq speechd-speak--message-timer (run-with-idle-timer 0 t 'speechd-speak--message-timer)) (run-hooks 'speechd-speak-hook)) ;;; Announce (provide 'speechd-speak) ;;; speechd-speak.el ends here speechd-el-2.11/AUTHORS0000644000175000001440000000017714070023103013210 0ustar pdmusersMilan Zamazal Hynek Hanke Christopher Brannon speechd-el-2.11/COPYING0000644000175000001440000010451314070023103013172 0ustar pdmusers GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . speechd-el-2.11/README0000644000175000001440000000544714070023103013025 0ustar pdmusersspeechd-el is an Emacs client to speech synthesizers, Braille displays and other alternative output interfaces. It provides full speech and Braille output environment for Emacs. It is aimed primarily at visually impaired users who need non-visual communication with Emacs, but it can be used by anybody who needs sophisticated speech or other kind of alternative output from Emacs. speechd-el can make Emacs a completely speech and BRLTTY enabled application suitable for visually impaired users or, depending on its configuration, it can only speak in certain situations or when asked, to serve needs of any Emacs user. For more information about speechd-el features see the Texinfo manual or the project web page http://www.freebsoft.org/speechd-el (you can also find some comparison with Emacspeak there). Installation: - If you use Emacs older than 23.2 then install the `eieio' Elisp library, available from http://cedet.sourceforge.net/eieio.shtml or perhaps from your favorite operating system distribution. - Copy the speechd-el *.el files somewhere to your Emacs load path. This may be typically the directory /usr/local/share/emacs/site-lisp/. - It is recommended to byte compile the *.el files, otherwise you may experience performance problems. You can compile the files by running make compile Then copy the resulting *.elc files to your Emacs path as described in the previous step. - Make sure all the installed files are world-readable at their target location, e.g. cd /usr/local/share/emacs/site-lisp chmod 755 *.el *.elc - If you want to build online manual, run make info You need makeinfo from Texinfo package for this. Then you can install the resulting *.info files by copying them to the location where *.info files reside on your system (typically /usr/share/info) and editing `dir' file there. Alternatively you can open the manual directly in Emacs using `C-u C-h i'. In case you'd like to print the manual, run make pdf You need Texinfo to produce PDF version of the manual. - Add the following line to your ~/.emacs: (autoload 'speechd-speak "speechd-speak" nil t) - Install the `speechd-log-extractor' script somewhere to your shell PATH (this step is optional, the script is used only for bug reporting). - Start Speech Dispatcher and/or BRLTTY. - Start Emacs and call the commands M-x speechd-speak RET In case you do not use both speech and braille outputs and you'd like to get rid of the corresponding error messages, customize the variable speechd-out-active-drivers. Now, your Emacs should speak and/or output to your Braille display. See the Texinfo manual for complete documentation. You can send bug reports, patches, suggestions, etc. to the mailing list speechd-discuss@nongnu.org. -- Milan Zamazal speechd-el-2.11/fdl.texi0000644000175000001440000005054314070023103013602 0ustar pdmusers@display Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @end display @enumerate 0 @item PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document @dfn{free} in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of ``copyleft'', which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. @item APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The ``Document'', below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as ``you''. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A ``Modified Version'' of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A ``Secondary Section'' is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The ``Invariant Sections'' are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The ``Cover Texts'' are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A ``Transparent'' copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not ``Transparent'' is called ``Opaque''. Examples of suitable formats for Transparent copies include plain @sc{ascii} without markup, Texinfo input format, La@TeX{} input format, @acronym{SGML} or @acronym{XML} using a publicly available @acronym{DTD}, and standard-conforming simple @acronym{HTML}, PostScript or @acronym{PDF} designed for human modification. Examples of transparent image formats include @acronym{PNG}, @acronym{XCF} and @acronym{JPG}. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, @acronym{SGML} or @acronym{XML} for which the @acronym{DTD} and/or processing tools are not generally available, and the machine-generated @acronym{HTML}, PostScript or @acronym{PDF} produced by some word processors for output purposes only. The ``Title Page'' means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, ``Title Page'' means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section ``Entitled XYZ'' means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as ``Acknowledgements'', ``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' of such a section when you modify the Document means that it remains a section ``Entitled XYZ'' according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. @item VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. @item COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. @item MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: @enumerate A @item Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. @item List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. @item State on the Title page the name of the publisher of the Modified Version, as the publisher. @item Preserve all the copyright notices of the Document. @item Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. @item Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. @item Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. @item Include an unaltered copy of this License. @item Preserve the section Entitled ``History'', Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled ``History'' in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. @item Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the ``History'' section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. @item For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. @item Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. @item Delete any section Entitled ``Endorsements''. Such a section may not be included in the Modified Version. @item Do not retitle any existing section to be Entitled ``Endorsements'' or to conflict in title with any Invariant Section. @item Preserve any Warranty Disclaimers. @end enumerate If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled ``Endorsements'', provided it contains nothing but endorsements of your Modified Version by various parties---for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. @item COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled ``History'' in the various original documents, forming one section Entitled ``History''; likewise combine any sections Entitled ``Acknowledgements'', and any sections Entitled ``Dedications''. You must delete all sections Entitled ``Endorsements.'' @item COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. @item AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an ``aggregate'' if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. @item TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled ``Acknowledgements'', ``Dedications'', or ``History'', the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. @item TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. @item FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See @uref{http://www.gnu.org/copyleft/}. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License ``or any later version'' applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. @end enumerate @page @appendixsubsec ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: @smallexample @group Copyright (C) @var{year} @var{your name}. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. @end group @end smallexample If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the ``with...Texts.'' line with this: @smallexample @group with the Invariant Sections being @var{list their titles}, with the Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}. @end group @end smallexample If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. @c Local Variables: @c ispell-local-pdict: "ispell-dict" @c End: speechd-el-2.11/gpl.texi0000644000175000001440000010441614070023103013616 0ustar pdmusers@c The GNU General Public License. @c @center Version 3, 29 June 2007 @c This file is intended to be included within another document, @c hence no sectioning command or @node. @display Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @end display @heading Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program---to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. @heading TERMS AND CONDITIONS @enumerate 0 @item Definitions. ``This License'' refers to version 3 of the GNU General Public License. ``Copyright'' also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. ``The Program'' refers to any copyrightable work licensed under this License. Each licensee is addressed as ``you''. ``Licensees'' and ``recipients'' may be individuals or organizations. To ``modify'' a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a ``modified version'' of the earlier work or a work ``based on'' the earlier work. A ``covered work'' means either the unmodified Program or a work based on the Program. To ``propagate'' a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To ``convey'' a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays ``Appropriate Legal Notices'' to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. @item Source Code. The ``source code'' for a work means the preferred form of the work for making modifications to it. ``Object code'' means any non-source form of a work. A ``Standard Interface'' means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The ``System Libraries'' of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A ``Major Component'', in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The ``Corresponding Source'' for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. @item Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. @item Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. @item Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. @item Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: @enumerate a @item The work must carry prominent notices stating that you modified it, and giving a relevant date. @item The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to ``keep intact all notices''. @item You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. @item If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. @end enumerate A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an ``aggregate'' if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. @item Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: @enumerate a @item Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. @item Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. @item Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. @item Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. @item Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. @end enumerate A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A ``User Product'' is either (1) a ``consumer product'', which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, ``normally used'' refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. ``Installation Information'' for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. @item Additional Terms. ``Additional permissions'' are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: @enumerate a @item Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or @item Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or @item Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or @item Limiting the use for publicity purposes of names of licensors or authors of the material; or @item Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or @item Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. @end enumerate All other non-permissive additional terms are considered ``further restrictions'' within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. @item Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. @item Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. @item Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An ``entity transaction'' is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. @item Patents. A ``contributor'' is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's ``contributor version''. A contributor's ``essential patent claims'' are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, ``control'' includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a ``patent license'' is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To ``grant'' such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. ``Knowingly relying'' means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is ``discriminatory'' if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. @item No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. @item Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. @item Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License ``or any later version'' applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. @item Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. @item Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. @item Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. @end enumerate @heading END OF TERMS AND CONDITIONS @heading How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the ``copyright'' line and a pointer to where the full notice is found. @smallexample @var{one line to give the program's name and a brief idea of what it does.} Copyright (C) @var{year} @var{name of author} 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 @url{http://www.gnu.org/licenses/}. @end smallexample Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: @smallexample @var{program} Copyright (C) @var{year} @var{name of author} This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}. This is free software, and you are welcome to redistribute it under certain conditions; type @samp{show c} for details. @end smallexample The hypothetical commands @samp{show w} and @samp{show c} should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an ``about box''. You should also get your employer (if you work as a programmer) or school, if any, to sign a ``copyright disclaimer'' for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see @url{http://www.gnu.org/licenses/}. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}. speechd-el-2.11/speechd-log-extractor0000644000175000001440000000270514070023103016265 0ustar pdmusers#!/usr/bin/env perl # Copyright (C) 2004 Brailcom, o.p.s. # # Authors: TomĂĄĹĄ Cerha , Milan Zamazal # # COPYRIGHT NOTICE # # 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 . use strict; my ($begin, $end, $compress) = @ARGV; die "Usage: $0 begin end [--compress]\n" unless (defined($begin) and defined($end) and (not defined($compress) or $compress eq '--compress')); my ($zip) = grep(defined, `which bzip2`, `which gzip`) if defined($compress); if (defined($zip)) { open(OUT, "|$zip") or die "Unable to open pipe to $zip: $!"; } else { *OUT = *STDOUT; } my $inside = 0; while () { if ($inside == 1) { print OUT; if (/$end/o) { last; } } else { if (/$begin/o) { $inside = 1; print OUT; } } } close(OUT) if (defined($compress)); speechd-el-2.11/speechd-speak.pdf0000644000175000001440000010050114070023103015337 0ustar pdmusers%PDF-1.2 %Ç쏢 6 0 obj <> stream xœu’ËnÂ0E÷ţŠYR ?âו]Y˛ę. ! Rżžc"–béĚřŢńMÎŔQkŘ˖Ůt™AÝ3ŽŽ¸çt5Đ0éjˆo­œ봂ŽbŚáúžźbjvqóJ[ŮÂ,'7Oů†ZLČŒDM-ä-­NUUn?ň#]ŤŠ!_łŃgӟŠKš­şPŃȅť×ŠĂ:@Î<ŕź-Ę>ŞđL%:„cŚM"_ÍoW*1S÷ÓŤăćr¨swŁŘ)Đd~@‹Şş4‡:Ů'Éš Ԙg]ĐtI‰ (C˛h@ ‹Ôü’ƒwJ˝K"{ÔI¸—8Hň’Á‹fŁ@i‹ŮÍjŃě‹Cź­öéŕOŃĹ~XƁ'’.)5é }ęĐ6ëb¤ŢyzŇÍž<śă8ź˛2ic݆s10> stream xœT[oÓ0~÷ŻđC"žďąyƒą7`‹Äs–şm š,É4í ÁŸĆnŹŞÔV_ŽĎů.ǹǔ0LĂ'ţ6şG”XĘ1ĂÓ1Ü"nQž•0—F <9´E ?ž|‹(ŢĄ{̎CŇOÓᏺźaĆO¨śžĆŕÂĎĚĺ;hRâŞCˇŁsÍţmőůĆĽňŐ]|jçą^š˝›ÂE(3ůYÝoȈŃ+xÝŐÍ ]¨ }J¤Ň ůÜŢM. œH‘OßŰĺ1˘ĆäAPɈ–6B_œ[Ú~ƒĘ“œRP­ _Yń]Ţpš<đ˙ ~t‰S½TŤV#€ƒ:6؃Ăô g€öůĹBpʛBM„~ŔËLg"Dˈ<ŚcÖĐT5ŻD W/‰äfmż¸i[74ڜ .IÎÂĎQ`ďiĆöLČŇSO6ż@aˆ¤^wÁ “:ý9ňŠUWC7Üâŕ´˘šńü0ŽĂˇÁ&­ HP‚*Ę"6lA>ľĎÔGŽRdýóSżěÝÜwŹ`’h́Ú+ÄžĂ$˄ľI’;’ů)܍űŐťMľÚ2ˇAŔŒ?sRaV¤ m↪Ź2­ź§—U6C×ÁŃ27|čŰŚ^ÚĄ÷8M=—ý4<ěţMŤŽ°Ú\]}…ŽœŻä‡&2Ę;ü32*˝i7Ý1ŒBř8”ˆżbdľúŹząwg02nęţÍu"_ŸťX&äz+Śa§ŘäŘœçk‚u×AZ!~Ę쑵x…ő‡q<œ˜ëß^ŠĹoŰzC4)*óşük*ĺYâ”ÖĘŹ¤ž+ľ_ę4˙˙׿w›ç:Ţ?jĘÓŽ×ţ†Âç/ŒĐ}endstream endobj 17 0 obj 643 endobj 24 0 obj <> stream xœu’[jÜ0†ßľ ˝uąŞťĺžľ$oI oŔńČc‡Xăą†Ź Đ e{•Ź‹C`ŘđŰ.gˆŘżřoGp)*L!ó8Ş0|S –J08kĐ/×Í{€áœ!Y‹¤_;Â_5řţ‡JWĄîœ‚…Ť %EÂe¨„ővűIëśżŠ_€K\ çPŔînXŚĆś˝ž˝E LTś5ćŕ!AJnđ~lÚ%dÁœ%zë F\ČD†çY{Jg9zęě%RĽrĄŕIäUDZŰÁCĄňSŠ1óTJD3\‰A™F@1,č:$ŠuÓÄUb›CP1ôAż"ňË`‚éÖĂ ÜL°Šč_´ĚrŚSD¸Œä’Â*…“ײ QT|’“ ĆęškZ{Œk.(GĽ+"n’Ţőç4˝mc‡“ůć<ę°ű¸ůROQžŘŠ­q-ˇo‹łœ`y7ś×˰wž[ďŢLëUކ‚T¨ôA…ÓËWűÇŞ%ÉuÚâőmĺ/o‹› Wőô_°ÚnţŇ76@&Ż÷ş4‘ĐÔĺť÷5ü üűŢsîťendstream endobj 25 0 obj 461 endobj 30 0 obj <> stream xœu‘MNä0…÷>E-A"5ĺßŘ,ѰLÍ:¤ÝÝAô_:Rs.4×ÎíôEJ¤ĎŻ^˝<Ĺ'ť-;2B€#†5ăĐ3a%jHo-­„Új ƒg+Śáüýń‚ŹŮř´¤|ş-Ü5ěÇo74Ť ąP…`ęŕ`°†fËŽďťÍuó‚q­ƒ Y˛ŤŸýéЎÝĆńD#q;Ÿľťe„­šŔűm۝’ )YčM$„J›B~őσT ’óôbżϙZ;/JJŽFšŒźűÝ:-Ş˙qD2RcPĚPE*ĽAP‰Š$A(B›dĐéK)‚“&lR~ËͧbRŽ/ SQĄ˛˝' ę9ÎaŸՙœË˜łTT§K+ôç łYżý°j;Ÿ˙1_s%ÖqŽ’ČC“QútJkrĹóřmU"UŘ/“ôď¤Ëš&ߞ+C>-J?ocŠOĄâ,Yöă~ÚV) ˙4yľ~hűהŕ;ş´Ëqé\š}˙œS;ŽŚš˙„^lüëd}ßŔ#‹ĎÎBÍňendstream endobj 31 0 obj 411 endobj 36 0 obj <> stream xœu’MNĂ0…÷>Ĺ,‹DÍ؎g…„čĐ\ ¤N¤¤mTqN]˙„‚ĽDúü ƒŠçp%ňjŠđŽ2‘ć˜>‡š5Swy+ÍŇÔ Waä…|LfźwtS qëűAÇsendstream endobj 37 0 obj 393 endobj 42 0 obj <> stream xœ}SMŰ źó+8fĽšÂăĂp]uoÔ6–zًăÇŰ8NlˇiŻ=öőď 8–6[!ŮŇ0ź™7.˜†Š_ń_ľč‚(Ń00Ă}nhN$_É5Çš–÷í‘Äסˇ7ˆâ]0›DŇŻjńcŢÂ){ÇŃ8sšX‘Ž‚"9.Z´Úœ­­Ĺ r…séĹ­>4ĂšŤƒíýŽ$”éyŻ<í<ȈV7đŠ-Ť!TĄ‚'ôG(R%äcłí­G>ŸŢtűńQ­gĄŔdD ĄľľcsރPž¨”r*E@3ˆ¨ňË@Ś €â Ś”˜!NˆSçnĘaрPńřŸ ů,sî"Dóˆ\CDŒMëű@ <ŃĆŽ;F3q řfq&wF<çďt&(bt†EŔ@Br÷s ”óDŮ5c7)ťŞÎMć\ń׼×e3yÉ`bˆ;ę_ƒ˜aܘ”˝Ý=.ć =ŻŽÍxˆ­˛Ĺ ‰L€Ú9oMw*'eá;‰–U K“Äż•ľ}~˜2NLî f@˜źăss°Çe/üçSßŐÁ"Ł ëCÎŕ­ż˛măŐré ˘÷ ţ†™‚×Oâö"Ú.\ßLNŁpď‚C(śv;]p¤YR˙睋EâŃŚćúŚ7Ľ„¤iđ‹Ë &h†8ěĎ˙‰śů°\):gvçÚÓĐlƒ.›'z´éđ"\âą§F~ýŸĐ,Śendstream endobj 43 0 obj 546 endobj 48 0 obj <> stream xœu’Ënă †÷<ĹYśRÍŔ\ź­Ś‹‘ÚE'~ÇÁ‰Gc'ą‰ň•úÔÜŰTHFúÎŐ˙ϐ2ŔpŇÝäL*äŔ`Ú=áFP ń+… 0YŇ ×ďĂ‚°'g`ː|ľÜ×äÇoé ԝĎ1Př™ 8•žƒ˘ęÜlNÖś‡Űúńľô őŽÜüěçSăڃBDRdf5ă.@FzƒCÓÎą –"Óť@–ReňŘo'(§ĽXŤ7ÇÎ]5f3Ue•Đ“ľŽ÷q~ׁ#Š@•˘|…:/Ëp„‚/"ąŠú9ýr‹ ďö/U*Óš^žŽ ĄNäb´2˜ł.s„œŠœćŽÇżi™äGÁĂżB!|3šäüę˘Z†­óŽ‘hư T(‘%Ö6cňƒó\؏ÎN]\‚U" Ú&AM™~°żúŢ˙r š¤ţß{öÉzĺÍËîšC6t]tŰĚ}÷”捀<ď9ŮóĽŸě`GˇŒ*¸ŚĆżłÂ›ń鹘T27ޟ_ěŽţPĂ3 ç3 Ջendstream endobj 49 0 obj 413 endobj 54 0 obj <> stream xœ}TËnŰ0źë+xLšĺ[äľhníĄ@‘i›ľ%9˘œ4ýąţ^)sIŞvR°árwvv¸Oˆ`ŠČüÁŰUOÁ:†0DѸŤ(rÓK%×ŐZr4Új[IôňţńCEĐŽzBôR$ýľúźŽ>ý*TXoCŒFŤP)†eČ pÖ]u÷p˛śÝX˙ŹBâZ†€őŚşűâüŠ™Ú˝ç‰ ŐůŹé73HąVźďšÖÇ,Dđ„~œ‚…T ůęG;Ł žo? ŰéP­sĄIą oÖNŽßĹBő"#„ϨR˜iĘŐ34¨“Œ ť¨ÄfAκƪč)Žŕţ>ň×T]  (’ PA˘Że2†Ý¨Tć˛b 3´˜y‰ůs!q++3)ËibfÁyvë#ůĐkÄď !™%őçÓiaN&…NąMɉ$°mʨIęĐ$U"'ڈÉ,Ú†>_LbŘ)FrľC×Evuךwm3šĄŸf„ßXŽ8n{>A˝Pf—DOŒ‘gŹĐiş\´â+Ćť˘a ˙‘Ź÷kô˝šżż,ćÚmendstream endobj 55 0 obj 757 endobj 60 0 obj <> stream xœ•VKŽŰ8ÝëZf€˜Ąřš ’ÝAŇž€ZŚmŚ-É-Ęét.0Ŕ\hŽ7”YEú›Ě@€ <ą~Ż^ő\RR•t~ŕżíŠç‚CYY•ăڍJW0͉,ăŻäš—ľ–źmą.důr˙őCAËMń\VÇ ř×vĺűeń#,×áŒ.!fŠ‘Áƒ"ušěŠ7{kŰíËoEp\Ëp`š*Ţ|p~ßLí֎óIhĽÓťŚ_Í`E´ĘŕÇŽi}ôBGôíŒP"¤BäO÷8ÚeDđdý0ʧ@ľNâɊ(aúdíäúM TŸx`”ňUŠ0]1@Í 8rŔhš`G–%,Đ)EČ.s0\ƒm,@Wꂙ˜˘ ˜ ¤P}ɓ1쌦˝mž 1h΂Uśpj!7ňxôŸc.ˇě$îÇ!ďne}ŹCր=܄ŹÔÝ~g#*g‰I"ÁSćţ°ß#tŘ ă)ň#9•´l1&jc‹ŘŠ”¸Š´%3°`†(ŁB§HĹŘ 6– +ƒfÍî JŚšS0CsiŻý´ľŢýŒEW9łŁĽą”ß´‡Ă'Ă$'Jf¨‘ö^̰ov’<ľĘă1QĄœżC!Ů9&ÂkqNIQ˜ů™yƒ‘Ď˝]ź x‘”ËD_#PŤJ&ÝtŃŽNSsč]ŰLnčA=ýîhÎ|üfuB\ˇźw‘ş,ţŒ3Ľ÷[4ÚfC0LçlC™;+jÁၟ )5úyňSwɖD)=ű \^Qýá“DU}ż7OWgű)ЈÉľC柳Osý:ćGlی—Œ\‡k~ş(lž%€ZÔÔîd%hRA:WQz6ЁŽp0ŮnFŮýŇúŹłŽĂŘá€ĺÍĘsr.-ФZ75ˇŕó> S‹ýŤŸl+ć¸hěúŻÖÚŁPEh’>k­!Bčă‰ëÖ~:D1˘$Ś9ŹĄ>ó‹ZîíLŘ7>ć"č˙_ڎ÷;B%‡hŞrÓ¸Ÿ4đî=s ÝČEmĂś‹ĄÂ][łßÚ[dćË?ľč?Ž 5ťç‰]Š|‚ŔľœEˇrë5j‡ŮŽAp˛ôUk€ÖçÎ$“Y‡‰;‘Wĺő˘ëmk˝o  ŞëKkžŤ¸ž“•óÍ#L;Zć™7ÉuůŠ‹GM\–_Šůů‰w}Ŕendstream endobj 61 0 obj 920 endobj 66 0 obj <> stream xœ”KnŰ0†÷<— P1|ˆŮeŃěÚEu—bË[ے%ŚFNĐ#őz%Ĺ!•ŘÎŚ ˙ çńÍPGL Ă4<đ]íŃQ˘˝`(Ç [İE\ "q|KĄŽ´xlŃI|zßü€(ޢ#fs’ôYíń§Ý}WÚg¨7ŢGăÂçĊé#(Rázn†ś]uˇőOäWŇ;ÔktóŮNCăV];‹$”élkë 2˘Ő"Ţď›ŐŁĐR$őCP()ĽJĘű4śAĺ¤ůôCżq'PľÎ‰˘'#Ş4 }m[gۘ¨zS*‚Ş$Šx ’g`NqÁgJœďÇeéŤ[@ÄŒPĄ‹ hŚÎČÄ ”Ÿ8FR Ő県áo0 mó ƒáœylŢŤđĺP9ťţks?&čš“ŞşM’Ň$ĂÉşrgšomޟt™M‡Ţ%ţIš´É(KmÚmç60<–Ŕőă):JŁň8‡’ĺĺ.-Ťt|śn|Á aĄŇ‚>›Övógőźs$šƒÁ\ĄußL/PĐe˘Ľ?ßt3ŔÄy†Úě\šĽŠ‰ĆŮßѓę$śq7üŇźcÔDY“v6đÜ<ěŁBsŠÓǨř-H•Ôp{ Ł™vIĽ^œ \šb?OmiśƒÉgÚ7ť]léꆨ÷öƒ.üvś=Ě­‚ćI=ޜ]="pAýé8Žišl:“ďÖŕťQ1ťäłˇqü†ČPKáS‡6/ś îlÜ8ţęf Ŕ*óĹp/€ŻĚ•LĎĂЏđ;Ë#rĄT.óؤAţ˙=ł‡؜ýNŻÝ졟&űäRať´ŠŠ“~?3¤űCáů󪎞endstream endobj 67 0 obj 643 endobj 72 0 obj <> stream xœu“ËnŰ0E÷ü î’Ődř&ˇEłk­őŞDŮjcÉśýűRâĂFƒ@€ÎăÎęLĹőIßöHÎÁŕSF/{Âč@¸ h|+a5V zń¤'Šž}|ź#H÷äLŮÖ$Ú#ýR“§ŸF†ub,­BOŞ9¨PAƒĄő‘<îNޡ‡Oőo ęŽ<~ćSł´YO łĺŹť2°úŸM;Ç*(EڟW‚ •ÎäŰđëâWĘAŠ’˝›úĺ-QkKŁÉ@K—Đwď—aÜÇFćŽG+Ő ěMc+ &¨lGZńÍ&ć tâňy5"j°<8tUŕ͟•KĐ:ákô…ľÍŻsDNš{OrömĄ?8A+,x¨@ş÷VßfÚtŢë2€ůʛÇ%ůČk§ăÉ/>N€şÔYŚX ńMź„)pZŇ%ŕŔšűoŻZ#˛\%L"b˜6č\NÍ;eœ•)_–ě§Ëšcł ×Řm†~ł¸x`žáaœßto…+w­ÎŠ Š,)*2ZŞ"|.ËdYä5ÍgäM¸OŠŽ!foťĄďÓĐ(sÜŏiŠ—ť> stream xœUÉnŰ0˝ë+xk T wR=&5ĐCƒ űŠLŰŞmIĺ,ýú’â"5‰Ó 0`AOä,oŢĚÜ1@îžŐ!ťËT(ô› ƒ:#ŠBü?§ŠŠ8˝ÎÖ§?ßdl˛;€G'ńQŔĹ2;˙Ą,–k{FÜú‚@n-(ÁňÝtZWۏË_™5,š=°\eg_jӕCľŐ˝űÂ!Â*}+›•1Tb‡˛2Ţ b4˘Ÿ‚ ă""ßęŰ^;”@FÓí›v=<TŠäȟÄP°"@WZułńŽäĚAˆ:Tp('‡Yp$ “‘&\@ë‰$"Œ#ÂÇ H4°]ĺ/wgPˆß{^°6Bćh$5!GăăĚ ‡j–Ďײ_ů0Š:mŻÚ–ÍF‡™‚ÉótŚ8Œíł(ÍSň Ë'9ЧŃŢă ý˜r%asmź/K@r,aˇž&žœ<…â4“MŰäˇŢ§ąbű:ÎP)Ô3Ę)La˝“”ˇcŚÇ.KĘ+›8=äóSœ§›“˜•˛œąy˝_ůOJüÚ6 ÓX Ë@˛Iřş7Q śÇŚYúj‡éP7N"g×Í>DcíËA›0##oFÔë˝.Mę{źçšĹ5pLbœ|A=“Ĺ,÷˛7>Nœ*ţr˜ŻBmQZ Żň¸oťƒöťAB.PźţýçJ˛ÝyŇÜöbq?ôQT¨Ű@ábŠEQ‘™¨ť¸ ‹hżv‘”űPT}teĺň"ڞ+ý˜7†űýâW0ľendstream endobj 79 0 obj 837 endobj 84 0 obj <> stream xœĽUŮnÔ0}ĎWř"ă%ŢâĄPÁCËäŇLf&t˛ÔÉ´ôďąă%™–ŠvP¤D:öÝÎ=÷ć ˆ˛˙–Mr“ (  čm‚AI!îͨ¤@HFŽ’MÂŔÝÓÇŤmrđ$|ĘœçÉ۟’›ůĆܑ 51' 7ÉŮŞŻŞr÷:˙•ǂ™ ů:9űT}1–ťJŰ–ńŹh×ÄPňźhŠrp^PFúĆ"fŒ䲾ҕE Ěh´^u›ńÎŁRĆ@î&†ę%D¤„×űÁy’8Ž3ŠůÄć|/ż}œ:B Ąz˙WS?؜<°LÍNŁtŮä[ÖN Ôě*r‚ô-Śhý˘Ł™b3{›C[ŽuçŔ kňsŐÁ •y°.%đěáů9öşňYň˜SĽuľvÝ0Ń3ś ĺKĄ×~d˘ÂÇΗ›ą+J?D*,P7AŘNFŘđĹpţZâ垌 hŸ?tŻéňendstream endobj 85 0 obj 713 endobj 90 0 obj <> stream xœ’ËnŰ0E÷üŠY&@5>EeŮ6ťf‘X? Č”­¤ňCrŸRig(ˆŔápîđň…oYہĄő "Ć ăĐ3a%jˆ-­„Ňj ŁcÓđöőöŠlŘř,’–v€_5űůP…şó5 Ż F ö –PějupŽÝ^×OĚ7.ľ/¨×ěęO?šSťucŘŃHÜć˝fˇŁ5gx;4흐’‰ţ„Pi“Čßţqt T2Ÿ^íťÓŰB­ÍBą’ŁQՂîœ;őťM*/:"¨ŃXŠš Č{ “‚ łKźB/$˛Sđ!Ž`sƒíşđźy\Ą1 ~śp?lBÓËQĽŤKKŇéóCx}ôyĽçÂzëŇŮ|ŸÇfę—qt6dÝw]Ź”¤ćFˇkÝMŔˇ5Ü3!• 1eHy™Cô}B˛;Bxw5ť˜óé*—2Üj ‹‘ř%^•Húü—Ć÷5…Â|ĺßűáđĎĹ (žĚy_ŇGůőV}Ş›Gßb?Гendstream endobj 91 0 obj 406 endobj 96 0 obj <> stream xœ•UËnŰ0źë+xkT,ß"{,šC€}ŘÇ\d™ŽYX’#1Ióeý˝R^’RMQ°€Ńrvwv–žESDŚ'ž›ś¸-Ö0„!І›‚"W0ÍąDđ+šć¨Ň’ŁÁťB˘‡ż^ݡˆž’¤WÓ˘OëâĂŁC†ő.ÄhT†œH1,ƒÂZˇĹŮęhmł?_˙,q%CŔz[œ}văąöÍŢÓ‰ Őů[Ým'b­f𢭛Xˆŕ }?! ŠňĹm;Ą žOŻúˆ¨Ö9DRŹ„‰Đ•ľŢu7¨Z00Bř„*‰+NyDМ° ‚I"0‚Jv’‰̂žŠĎ2@†Ťx|ĺkޞéůU˜^ ‚$D?WÉöŠH"ĺ¸>ťźź>eĆY•L„*P)0›žÂžvŔ&E"óű¤NćoúÎĐËÔta¨6&éřXĽ8ÉMřřHőFŠcź;ĺ$@‚7öŕâX‰N„÷qú•˜[Ŕ¤ Ď,˘Ř\ÉB'fR 7Ć>ćbşŢ'ƒĚ愳ŐÓtŒIYëä"†šŚ)r|˝mń„—LcɂeĐ\Ć!|úMlҤZś?‰â D˙>…Ć°Żąˆ'“YÁžÔÍód&×ůÜC^ŽşńŽď༮ţKĽPĚ.b&UcSf&˘ü•V.~yۍnăÎ?Âő 9{cL×:oˇŔŽą0Ŕ-^R_šqĚë=ťk”LT #Őţn°Ń%<@ƒiÖ'¸‡ÇÉ­ú6ÚSgĆĹÍ'ćţ™LV)[Swď| šW!:Pä=rí1ŘĆ!nAŻyˆCXœ:šJ̊Ĺý4ÉÎďű;‹ĽKćĄOgďł­ˆxyA—œ†?˘`S ~´‡] gjŠăĹ}/ŚçsőËendstream endobj 97 0 obj 685 endobj 102 0 obj <> stream xœUɎă6˝ë+xK0b¸ˆ"•c9 9$íă\dšn)ÓZZ˘§1_–ß iV‘NĂÄ, TŹĺŐ{ĹÂ(',>đśSőR1j‚Ąc‚p˛=UœŒ•0’*’ţ•4’hŁ$Ů\uŽy}˙ócĹČSőBř5 žěD~=T?˙ÉYRÎÁɐ:$%­ *„hŠ&‡Šzx\łĂ‡Ă_UˆŹUp8œŞ‡ßĆ}í˝Üż(ʸÉßúůœšś?M˝ÝSÖH´~ŒFŐ˘ĺ÷ń¸šh´‘ůôăröŻ`5&'JžœśMŚ/Îůq~J‰ôMÁ˜ŒÖVQ-š+oŁ-˘ ÁH-Ž@ FE@´•‡TB'[8?¤ú oߓ hĂüŔ10ać-L]'î Ô`ŽŻŸ?ý€u´jф2H-ŠĽ'ˆl §v÷ ĐŐ]řÍůäŌ‹]Ś)őĽ9–{™GŰűq™ă‡&äŔăœbvw'+:4Ž;řľšˇyń8-4­n;ƒ­Ă Îú_˘­ć†ę6pRP.Eęńďkŕx‚˘qxź#5­ Ą‚‚¸ ˙ę:žŢZˇúzÝëö˝^.~˝ř7 Ţ _M¤‰*Œ‡Ď—Ů"VŹP}] g˙ü#ՉüiżœĄ7e°dˇíĐŽ@X$F#pDžO(×BÇمލxŽe š,CžúŮ:‰dím9ă Űł›ö4|Ö!áh‚?¸ń0Јż¸‡˙—esK:k8fţŽ”kn(%iŠ•ČPČĺ“Q+,ŮöóO>ĺYbGP˝l2؛Űý}đĚAëÝ —šřP†ĺËVČ3l!Ód?ßÓYĄ2[g¨…w70GЁŠÍżPeq'ĂĐoŠN6g/۞R…š¨k=ľ …ęŕ›IŠÔJ—Ŕ÷ư$ECaBý/Ŕ)–;ŘŻ+˙T‡wÝ!šfĄvŘ eÖmŒÜ^—}ŁÎŒƒtě΅QśŠ0ZćuXŇáZ´a‰Ü‚đ_Űĺ„ Ëą†”h”xŸw™äT+뽟=ĹĽ%ăŒ‹DöÔbd\ü?1ĘŚ}Ö;‹ôœć-šôžţšĐˆţ19Ş|ƒ]ň}P–Ç7źžť[ęŠuœ1,v_&€5懠č cęí”V€¤źLÓýœ\y–űě˘rú-qŤ\Q?Rţ¨œ“]ńţt Tńům7endstream endobj 103 0 obj 910 endobj 110 0 obj <> stream xœ­VMoă6˝ëW{ŮdąRů)QŰS‹Ś@€îĄšČ2młą$G˘ăÍ/ëß+%ΐNÖNö°0ŁáĚđ͛7|LINS2ýŕÓ& ɕ3T„Ľ46 MMÂĎeę˙JŽxZ*ÉÓA'ëDŚÇ˟ď’n’Ç”ÎIđ_ÓŚż/’_ţĄtJąX;'•f.iZ°\şE^Ś‹6šşŰkÝlŻ˙&.r)Ăb•\ýaĆ}m›­Ś/2'T…ouˇšŒ4WE4Ţ´u3ú(Dp´~ž,$˛@Ë_f9čÉĘrÁĂéť~m`U*$ňž4/DŚŻZ[Óm|˘ň$#„OÖBć%C#-'ÓGI36ăÄHîYÁ# ž‚Šp~ëËW´x…‹Ď_¸öŁÇÉABÔk”ŞŠI`ŽűŤŰŰűkŹš•1áĘH3žS‡ĆŤŁŹÂxfôVEHŃő1C“öN’aĘoVwŁYúhT`Ĺ;@›tÔ]ŘlżL挺ʼɘ;âkúoĆ |[=™1´ćäŇKHP=˜ÍLçÁ–EÇőĄkŹéťůR"gąšŤ^ÝG ČE"b)ƒw•U…œy˝㡍GďVRŹžIÂăÁ‡ –?!ź˘„ĐGiN ô2ÝhëŽŃŔR‚ń>c—˛‘ViF§ĎLTšŤŽÂŠőní0ő`łŚo[`ӋyTfŇqTڜňܓůýDœ1Č´î‡c=ʞf[ďŚnźˆœĎTt1‹$ĚéÜ住›‡OS8u’&hŇô0ęÝîy&%siŚqĎ\“zčŹ,cŸ@…Jmý=ĐRĂźrŘ´2ƒnŹĎĺt­(_ÉZÁ# ŽĆnűr”’6ŽŘ0$’×nľü °č]ť)jôŻŢ›Ëčl€Äĺ[Ă'=Öuzy„PwxUEM!šé7Œftja=Ú2—Ey‚öRok¸Aň?Y` óeN™‹ůpuF>îúւ Âő`şŐ2E˝_Cç­ÇzŁA7"BqQĹ=ľúvoAIĎlZ?îwp9§{(%fufŕMh×%. Ȥ*_tŔČĐą}?:u6;cŸý$’Öö3Üí(uĘú•śŽ§°˝ĘSŠľ¸jŃvuyjyAŚŠeNę+?}Śłz¨*?éôCóáňŕň‚Τ(˝żö]§EΠآ3‹cm5  q2Ńm@@%e﯈ď;xfţ\uŔh•:Eü2ź‚Lú,Şé!8!ôéŤçí§Ë° "Śç^ĽŚ§ĘŹŁa™Ć ?Źq"O5Ź3ĹUźTŽ’)š¸źÇoíG‰!IAhJA"IMëi ë>t(>"ä Ň:Ků˝L… îĐżn {RaC-œS§;ú›ĹNŠŻÝˆŁ°†şÚ~úRG§ËP­/ĽŠš€”żAڛ'(Xȃ€†›ß윈ŔžKŕĹAE^By<Žă€hb#ŹŐ𖊊x†š5‚,]ße€‰ ˝~÷mŠĂ7T¨äěŰëËó ÔźěÝ[WĚä>šŐFť÷ÎśďÇ0Gg†ÂMĂ¸,Y^ĚçćžÝ,Ňż“é÷?$)Lendstream endobj 111 0 obj 1185 endobj 117 0 obj <> stream xœu’MNĂ0…÷>Ĺ,[‰˙Çf‰č˘, YvR' ˘mš¤ęѸvl§"Ĺћń›™or‚)˙Äł: 3"X;ÁúQhÓKoÉ5‡\K˝E5’pý?źAt:IGu€ÇÝżQj\‰˘vI2WĂŇY(œCq@‹Mgmľ_Č9çŇ%;´xj‡ŽŤ˝í}DbBő+;/RŹŐM\Ęj.Dđ¤Ţy…`!URžŰ÷Ţz•aÁçۛS=^ŁŞő\(dRŹ„‰Ň‹ľc{lBĄü‡#„{UIœsĘŁJľ×F÷•ą #˜9˘Šß8„ Wńţ>ôŻŠú&4 Üţbbĺ˜ý“1ěJ"ŐŘ.Öëí2ö™ś•1áڀŒcjd˜ź†yrE’c:d"7&A˛ĺxéíđŕCÎÁ˙'ÔŁŻiČ´ŽňŘ\Ęfâ,°ĘgžcŒĄó<Ăg9ś§cČeDÄŔpéşSwoňd€˝˛*ŕůçF‚´ƒendstream endobj 118 0 obj 387 endobj 123 0 obj <> stream xœ˝VɎÜ6˝ë+tt‹ć*’×$Î)’L9k$v7cmŁe&ţ˛ü^Hq“[íqĆÓ@‘Źâ{őęQO9(‡öĎ˙Ö]ö”A L@BœŁ|şd(×°ÜýgDœ FňIeçŒĺ/Ÿ_~Č`~ɞr´ ?u—ĘŢýŽ03%NgłIä…)š—0“˘*D,äv"PRéCż(ľčţâ ń] !ąŃ’NńQ$m̲P0Ě ź…!€,'“ĹRqşú›AҞ×euˇŘQY 6‡ °ÚoGž=ŠňóŹŇ¸´ ľř$őá˝\2Ň2oɛÂüVě"ˇ8ÜÚ8 n; <ëFÍăĄŘ5ŽłŤ t׊FWËśˇŔPÓĹěšS×jö' '.3ŒČşŞ÷•>:Uđ’AˆŃ.†)—24ťŞuŤ­|\’[YɔŔ25Ź‹ŰJQ,˙ě÷rşKŞV… ü žpX0ż‰$wӏ#UuhźŔQWՎŠąg=ŻUŰ~ôwK3­ťąŇ“ÚÜŚ †`{í(@ŤX/ě2Y†C.’üÚaq]`€Jź7P=řŐ,1?h„Ů5~jž@~;Œrb˘Fě Śdł÷FEřł×މŻÓłŃŐ[—œ—Ą'žáß(€‘˙ q{2°ë%”ŕ‡ţň40ž"‚>ÍĹp™.ňעú&ľU˛këŃ@Ž==Żmëm.vţž¨Ęşwă„UBţšZçÝ|P)Ÿ×qü@ ÔI I;/Ű\Ó{ĎŔkNť›<¸–đŢĹ<:őĐťQÁö>ěFcyż5]Ęb#ŽöŚűEMg?ĄŃ°ť7׌ÚWĘmk?ůjˇrÜjžaąĆO‘ˆˇŸ\:TŇxűyŠúZůĎtދ’$ě[éĐë QÖĂÚ6ěQŘ N}­ú‹S—šëkOŕa<˙dH¸łü~§0’|Ďl˙ńďŢ/ŤŮ%ÂGŐ$Űh[ÇždEaÍňŽŽPžú’:—JG]bBo‰‡_~¨ŤŃŘŰčG–a{ř1Ď LMjÖŠvĆccŽX/”o[jĎ˙oĆ˝íŽ.šĄ÷6‹Ł7Vߟňß2ű÷ÚďçZendstream endobj 124 0 obj 994 endobj 129 0 obj <> stream xœĽUŰnÔ0}ĎWřąHëkâđ˘R‘Ęt MźťĄ›K“lžŒßÎÇv ť€ÄFÚH{ćĚ9gěgD0EÄ>đŽÚä9!X™@A˘hÜ%5 SKäţ%WĺJr4ęd›Htşüů!!h—<#şńŻŞEď7ÉÍĘŠ)ąŮšE ĽŚ(Ę–&E†s´i“Ť‡Aëj˙fó51™silęäęC3 ĺ\íőhżHL¨ ßĘŽśAŠUƒˇmYM. ÜGŻm„`!3šoGmŁ v?ôŰůQĽB!ˇ’âLú¤őÜt;W(_e`„pÍ$ÎY ڐ%yA)[xb‰xΰIb™Řě śÇůč@ʘLiŽ3›RI!—…w˝CĘ2[OŽőBdb߁Žź0?ˆőGˇ“łPľ*; 8Ćöú0źľŃTb•›0u•,˜aŐ ž˘ž<] +%<Ýk͋ˢ‹3šGɧ%Kšwů´(c&âQýč*óÜWöhloÄhÉłČÔq7še„đŇ=+ŒC¸ë˙ w†&W“y‚OÍźwšŠŕŹŒE”ßřâĽQ}č‡Vwłý$°çˇ÷[Ř^Č˙aôĆńĂ1%çI…–ힼck‡ßZţŘcďz–Âó÷T'av^(}Ĺj3ăn[‚ŸŠpŻËŃO†­3ŽA]‘ą ‹şŹŔ>Áź÷Ă͂a*Ýź¸œ™đQ]űůô?uýŻć8t˝ÓŽ9^?áŃ`7ś˛ŰˇÁ)d<âń5şŤŕ<Čh°/&žn?ƒś–|_á8éq!:ĺ–2S95'ĂĹ9úw3BZnŽńJ?…sbĚ˝xÎ#ďŕ@aD˝>ŠňLČŔÂSăĐВ]öútď\˜áŹ7‡räœIÍYŒYk(çé܈–.ŠŁ1.”­•;y+6Ýl†śé;ąˆŇGůÖÇŞCCăŞč̐˛ĘftŔĹzŠÝí´6Čč_¤6͗tĎňËoG Šx'Oń’äÔŰ"ޑypîWOÄ—QNĂTŞž…y‰ŚXĚtťAŸűüCŮcendstream endobj 130 0 obj 807 endobj 135 0 obj <> stream xœ’ßn›0Ćďýžě¤qđ_ěTš*Uë]wą† ô@ŘB€.ڞ~6ś“T[ˇ Đçăď;ţ)N™âˇŢ“#a`°b‚r:ś„ÓŽ+AÓđÖŇJjŹ–tDŇMOo/Ż Ł-9Rž„¤O˝§÷%ɟ¸4.˘l\‘Ľ™ Ľ…í, 0´Ü“›ő€Xo?”߈s6Ú”Ďäćs7 Ő\oqô+ˇçľŞö"[\ć}UOÁ…)™Ô^a t‘”Çn3˘W(yŢ˝>4ó)ŞÖžƒB%‡B­˘ôqîú6™+Á˜ôjĄÁ^şÜkž‚MŁ™X@ LSYpÝyOŘÄ<ĆŁŽŘ×8%—Č2ă¸r}f :œáäę ’™îćŕ"LŘľçá6ĎO§ĺřĘE۸šq392pŰ|ZěňYL¸z3Š_ăç ¸ł~_Bۇ-2)/!*MC5Ĺe9Ś”Œ –˙Ů€Ő÷śŠ ŚśuĂM°ĄÇ9¸űÉŘŕ."Ţxţě˙őxWÖüĺˆĂaęćĂ2–Ž×τ9ĂÝŐ/ĚU(u§–ňLďםÓ7Őn÷išf%ýJüó;Óüendstream endobj 136 0 obj 453 endobj 145 0 obj <> stream xœuËNĂ0E÷óĂŽHÔřmg‹č˙@H(i“Uü=vœ„n°%tf|Ż}¤„!{ŠePbČ(G†c [ŕV…éT 4V =T đú;Š5 Čf“ľ”>9x|gŇ W…!‹ű`Šš$41č:ŘĺgďËćŢ}BP6* ¸#ěžŰËš˜ĘƏąŁevëý1BFŹţƒ‡Ž(/I…JąŇ‡H(‘JŻäĽý}¤œHąÝÎOŐt]¨ľ›QšdDËlAŻŢOm_'#sŁŔ)‘jEĚ ĺ‘Ĺ욡!úý|†° C!Éć4\Sô_IÇľčü¤(Át&vúž‹ôŕđ âţˆmNendstream endobj 146 0 obj 272 endobj 5 0 obj <> /Contents 6 0 R >> endobj 15 0 obj <> /Contents 16 0 R >> endobj 23 0 obj <> /Contents 24 0 R >> endobj 29 0 obj <> /Contents 30 0 R >> endobj 35 0 obj <> /Contents 36 0 R >> endobj 41 0 obj <> /Contents 42 0 R >> endobj 47 0 obj <> /Contents 48 0 R >> endobj 53 0 obj <> /Contents 54 0 R >> endobj 59 0 obj <> /Contents 60 0 R >> endobj 65 0 obj <> /Contents 66 0 R >> endobj 71 0 obj <> /Contents 72 0 R >> endobj 77 0 obj <> /Contents 78 0 R >> endobj 83 0 obj <> /Contents 84 0 R >> endobj 89 0 obj <> /Contents 90 0 R >> endobj 95 0 obj <> /Contents 96 0 R >> endobj 101 0 obj <> /Contents 102 0 R >> endobj 109 0 obj <> /Contents 110 0 R >> endobj 116 0 obj <> /Contents 117 0 R >> endobj 122 0 obj <> /Contents 123 0 R >> endobj 128 0 obj <> /Contents 129 0 R >> endobj 134 0 obj <> /Annots[139 0 R 140 0 R 141 0 R 142 0 R]/Contents 135 0 R >> endobj 144 0 obj <> /Contents 145 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 5 0 R 15 0 R 23 0 R 29 0 R 35 0 R 41 0 R 47 0 R 53 0 R 59 0 R 65 0 R 71 0 R 77 0 R 83 0 R 89 0 R 95 0 R 101 0 R 109 0 R 116 0 R 122 0 R 128 0 R 134 0 R 144 0 R ] /Count 22 >> endobj 1 0 obj <> endobj 4 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <> endobj 22 0 obj <> endobj 28 0 obj <> endobj 34 0 obj <> endobj 40 0 obj <> endobj 46 0 obj <> endobj 52 0 obj <> endobj 58 0 obj <> endobj 64 0 obj <> endobj 70 0 obj <> endobj 76 0 obj <> endobj 82 0 obj <> endobj 88 0 obj <> endobj 94 0 obj <> endobj 100 0 obj <> endobj 108 0 obj <> endobj 115 0 obj <> endobj 121 0 obj <> endobj 127 0 obj <> endobj 133 0 obj <> endobj 139 0 obj <> /Subtype/Link>>endobj 140 0 obj <> /Subtype/Link>>endobj 141 0 obj <> /Subtype/Link>>endobj 142 0 obj <> /Subtype/Link>>endobj 143 0 obj <> endobj 149 0 obj <> endobj 132 0 obj <> endobj 114 0 obj <> endobj 98 0 obj <> endobj 80 0 obj <> endobj 62 0 obj <> endobj 150 0 obj <> endobj 44 0 obj <> endobj 151 0 obj <> endobj 26 0 obj <> endobj 152 0 obj <> endobj 9 0 obj <> endobj 99 0 obj <> endobj 81 0 obj <> endobj 63 0 obj <> endobj 45 0 obj <> endobj 153 0 obj <> endobj 27 0 obj <> endobj 154 0 obj <> endobj 10 0 obj <> endobj 137 0 obj <> endobj 119 0 obj <> endobj 11 0 obj <> endobj 138 0 obj <> endobj 120 0 obj <> endobj 104 0 obj <> endobj 12 0 obj <> endobj 86 0 obj <> endobj 68 0 obj <> endobj 155 0 obj <> endobj 50 0 obj <> endobj 156 0 obj <> endobj 32 0 obj <> endobj 105 0 obj <> endobj 87 0 obj <> endobj 69 0 obj <> endobj 51 0 obj <> endobj 157 0 obj <> endobj 33 0 obj <> endobj 158 0 obj <> endobj 18 0 obj <> endobj 159 0 obj <> endobj 106 0 obj <> endobj 147 0 obj <> endobj 125 0 obj <> endobj 107 0 obj <> endobj 148 0 obj <> endobj 126 0 obj <> endobj 92 0 obj <> endobj 74 0 obj <> endobj 56 0 obj <> endobj 38 0 obj <> endobj 19 0 obj <> endobj 93 0 obj <> endobj 75 0 obj <> endobj 57 0 obj <> endobj 39 0 obj <> endobj 160 0 obj <> endobj 20 0 obj <> endobj 161 0 obj <> endobj 112 0 obj <> endobj 131 0 obj <> endobj 113 0 obj <> endobj 8 0 obj <> endobj 21 0 obj <>endobj 2 0 obj <>endobj xref 0 162 0000000000 65535 f 0000019211 00000 n 0000029625 00000 n 0000018997 00000 n 0000019273 00000 n 0000015729 00000 n 0000000015 00000 n 0000000437 00000 n 0000025542 00000 n 0000021597 00000 n 0000022214 00000 n 0000022437 00000 n 0000022740 00000 n 0000019328 00000 n 0000019358 00000 n 0000015890 00000 n 0000000456 00000 n 0000001171 00000 n 0000023809 00000 n 0000024701 00000 n 0000025156 00000 n 0000025601 00000 n 0000019410 00000 n 0000016035 00000 n 0000001191 00000 n 0000001724 00000 n 0000021450 00000 n 0000022058 00000 n 0000019453 00000 n 0000016180 00000 n 0000001744 00000 n 0000002227 00000 n 0000023188 00000 n 0000023653 00000 n 0000019496 00000 n 0000016325 00000 n 0000002247 00000 n 0000002712 00000 n 0000024628 00000 n 0000025000 00000 n 0000019539 00000 n 0000016470 00000 n 0000002732 00000 n 0000003350 00000 n 0000021297 00000 n 0000021902 00000 n 0000019582 00000 n 0000016615 00000 n 0000003370 00000 n 0000003855 00000 n 0000023041 00000 n 0000023497 00000 n 0000019625 00000 n 0000016760 00000 n 0000003875 00000 n 0000004704 00000 n 0000024555 00000 n 0000024922 00000 n 0000019668 00000 n 0000016905 00000 n 0000004724 00000 n 0000005716 00000 n 0000021139 00000 n 0000021824 00000 n 0000019711 00000 n 0000017050 00000 n 0000005736 00000 n 0000006451 00000 n 0000022894 00000 n 0000023419 00000 n 0000019754 00000 n 0000017195 00000 n 0000006471 00000 n 0000007026 00000 n 0000024482 00000 n 0000024844 00000 n 0000019797 00000 n 0000017340 00000 n 0000007046 00000 n 0000007955 00000 n 0000021066 00000 n 0000021746 00000 n 0000019840 00000 n 0000017485 00000 n 0000007975 00000 n 0000008760 00000 n 0000022821 00000 n 0000023341 00000 n 0000019883 00000 n 0000017630 00000 n 0000008780 00000 n 0000009258 00000 n 0000024409 00000 n 0000024766 00000 n 0000019926 00000 n 0000017775 00000 n 0000009278 00000 n 0000010035 00000 n 0000020993 00000 n 0000021668 00000 n 0000019969 00000 n 0000017921 00000 n 0000010055 00000 n 0000011039 00000 n 0000022665 00000 n 0000023261 00000 n 0000023967 00000 n 0000024176 00000 n 0000020013 00000 n 0000018069 00000 n 0000011060 00000 n 0000012319 00000 n 0000025312 00000 n 0000025462 00000 n 0000020920 00000 n 0000020074 00000 n 0000018217 00000 n 0000012341 00000 n 0000012802 00000 n 0000022362 00000 n 0000022585 00000 n 0000020135 00000 n 0000018365 00000 n 0000012823 00000 n 0000013891 00000 n 0000024101 00000 n 0000024329 00000 n 0000020183 00000 n 0000018513 00000 n 0000013912 00000 n 0000014793 00000 n 0000025387 00000 n 0000020840 00000 n 0000020231 00000 n 0000018661 00000 n 0000014814 00000 n 0000015341 00000 n 0000022287 00000 n 0000022505 00000 n 0000020279 00000 n 0000020394 00000 n 0000020510 00000 n 0000020627 00000 n 0000020744 00000 n 0000018849 00000 n 0000015362 00000 n 0000015708 00000 n 0000024026 00000 n 0000024249 00000 n 0000020792 00000 n 0000021229 00000 n 0000021387 00000 n 0000021540 00000 n 0000021997 00000 n 0000022153 00000 n 0000022984 00000 n 0000023131 00000 n 0000023592 00000 n 0000023748 00000 n 0000023899 00000 n 0000025095 00000 n 0000025251 00000 n trailer << /Size 162 /Root 1 0 R /Info 2 0 R >> startxref 29768 %%EOF speechd-el-2.11/speechd-version.el0000644000175000001440000000016014070023103015550 0ustar pdmusers(defconst speechd-version " pdm@brailcom.org--pdm/speechd-el--main--2.0--patch-25 ") (provide 'speechd-version) speechd-el-2.11/speechd-el.info0000644000175000001440000046013714070023103015034 0ustar pdmusersThis is speechd-el.info, produced by makeinfo version 6.7 from speechd-el.texi. This manual is for speechd-el, 2.11. Copyright (C) 2012-2021 Milan Zamazal Copyright (C) 2003-2010 Brailcom, o.p.s. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License." You can also (at your option) distribute this manual under the GNU General Public License: Permission is granted to copy, distribute and/or modify this document 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. A copy of the license is included in the section entitled "GNU General Public License". INFO-DIR-SECTION Emacs START-INFO-DIR-ENTRY * speechd-el: (speechd-el). Emacs interface to Speech Dispatcher and BRLTTY. END-INFO-DIR-ENTRY  File: speechd-el.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) speechd-el ********** This manual is for speechd-el, 2.11. Copyright (C) 2012-2021 Milan Zamazal Copyright (C) 2003-2010 Brailcom, o.p.s. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License." You can also (at your option) distribute this manual under the GNU General Public License: Permission is granted to copy, distribute and/or modify this document 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. A copy of the license is included in the section entitled "GNU General Public License". * Menu: * Introduction:: What is speechd-el and this manual about? * speechd-el User Manual:: Using Emacs speech output. * speechd-el Elisp Library:: Using speechd-el in Elisp programs. * Contact Information:: Bug reporting etc. * Copying This Manual:: GNU Free Documentation License. * Index:: Concept, function, variable and key index.  File: speechd-el.info, Node: Introduction, Next: speechd-el User Manual, Prev: Top, Up: Top 1 Introduction ************** speechd-el is an Emacs client to speech synthesizers, Braille displays and other alternative output interfaces. It provides full speech and Braille output environment for Emacs. It is aimed primarily at visually impaired users who need non-visual communication with Emacs, but it can be used by anybody who needs sophisticated speech or other kind of alternative output from Emacs. speechd-el can make Emacs a completely speech and BRLTTY enabled application suitable for visually impaired users or, depending on its configuration, it can only speak in certain situations or when asked, to serve needs of any Emacs user. Programming interfaces are available both to the user interface and for communication with the output devices. This manual describes the speech/Braille output user interface, how to customize and extend the interface, and the Emacs Lisp libraries. Some degree of familiarity with Speech Dispatcher or BRLTTY on the user level is recommended, although not absolutely necessary. * Menu: * Design Goals:: * Feature List:: * Components::  File: speechd-el.info, Node: Design Goals, Next: Feature List, Prev: Introduction, Up: Introduction 1.1 Design Goals ================ speechd-el was designed considering our experience with other free accessibility technologies. We sometimes meet problems such as lack of maintenance power, duplicated efforts, making technology specific solutions instead of generally useful tools, important bugs. As other Free(b)soft projects (http://www.freebsoft.org/projects) speechd-el attempts to fill in an empty space in the accessibility area, in a way oriented towards future. speechd-el tries to offer technology that is useful, simple, supporting general accessibility architecture models and that effectively utilizes the limited accessibility development resources. The particular speechd-el design goals are: * Providing advanced accessible user environment that works out of the box and utilizes standard Emacs features wherever possible. Emacs accessibility should work as much as possible on the general level without necessity to implement direct support for particular Emacs packages. speechd-el should also preferrably use standard Emacs features if possible instead of implementing its own solutions. * Implementing just the necessary functionality, without duplicating features presented in other components such as Speech Dispatcher, speech synthesizers or Braille APIs. Emacs accessibility solutions should share features, configuration, code, etc. with other applications to the highest possible extent in order to make life of both users and developers easier. * Simple and clean source code that requires only minimum maintenance and allows future extensions. * As little modifications to standard Emacs environment as possible, with the possibility to make additional customizations if needed, either shared or private. Emacs should work the same way whether it speaks or not. Of course optional customizations can be made and the generally useful ones should be included as optional parts of the distribution. * Ability to work well in a multilingual environment. * Completely Free Software architecture, without requiring any proprietary component.  File: speechd-el.info, Node: Feature List, Next: Components, Prev: Design Goals, Up: Introduction 1.2 Feature List ================ Major speechd-el features are: * Speech output. * Braille display output and input, mostly identical to the speech output. * Both automated and explicit reading. You can let Emacs read everything and/or you can ask it to read some parts of the text (such as current line, current buffer, last message, etc.). * Message priorities ensuring you don't miss important messages while you needn't listen to or view unimportant messages. * "Intelligent" and customizable selection of text to be read based on lines, text properties, buffer contents changes and other criteria. * Support for changing speech parameters (such as language, voice, rate, pitch, volume, speech synthesizer). Different speech parameters can be used in different buffers, major modes, faces, etc. * Support for events (such as sound icons). * Emacs status changes reporting (such as mode, keyboard, process changes, etc.). * Multilingual environment support. speechd-el works well with languages other than English and offers support for current language selection based on the kind of texts, selected keyboard, etc. * Reasonable immediate speech and Braille output in most Emacs packages. * No significant changes of the standard Emacs behavior. * Speech and Braille output can be enabled/disabled independently to each other and they can be enabled/disabled for the whole Emacs session or just for particular buffers. * Speech synthesizer independence, you can use all speech synthesizers supported by Speech Dispatcher (such as Festival, Flite, eSpeak, Epos, Dectalk, IBM TTS, Cicero, etc.) and you can use multiple speech synthesizers inside a single Emacs session. * Braille displays are handled through BRLTTY drivers and APIs. * Programming libraries for those who want to extend speechd-el facilities or who just want to talk to speech synthesizers, Braille display or other output/input devices. * Special features for speechd-el developers such as silence in debugger, debugging variables, possibility to disable speechd-el hooks, etc. * Small code size. See speechd-el web page (http://www.freebsoft.org/speechd-el) if you are interested in comparison with Emacspeak.  File: speechd-el.info, Node: Components, Prev: Feature List, Up: Introduction 1.3 Components ============== speechd-el design is strictly modular. It contains several components layered each on top of other. Lower layer functions can be used independently of higher level features. The lowest level components are access libraries to output devices, especially to SSIP (the Speech Dispatcher TCP communication protocol for speech output) and BrlAPI (interface to BRLTTY drivers for communication with Braille displays). They can be used to talk to the output devices directly from Elisp programs. The next level implements common access to all the devices. Instead of talking to each device independently one can use this layer to output device independent messages that are processed and sent to the output devices as defined in the user configuration. This is the preferred way of communication with the output devices. On the highest level there is the user interface frontend that makes Emacs read texts and events automatically, defines the corresponding minor modes, key bindings and most of the interactive commands. There are some other auxiliary components, look into speechd-el source code if interested.  File: speechd-el.info, Node: speechd-el User Manual, Next: speechd-el Elisp Library, Prev: Introduction, Up: Top 2 speechd-el User Manual ************************ speechd-el allows you to use Emacs without looking at screen, with speech or Braille output only. The main usage area is by blind and visually impaired people, but generally you can use at least the speech output for many purposes, according to your wishes and needs. You can download the latest released version of speechd-el from . speechd-el uses Speech Dispatcher for the speech output, so working Speech Dispatcher installation is necessary to produce any speech output. Please look at for more information about Speech Dispatcher. For the Braille output BRLTTY is used through its BrlAPI interface. To make the Braille output work, BRLTTY must be running and properly configured. Please look at for more information about BRLTTY. * Menu: * Installation:: Installing speechd-el. * Starting Alternative Output:: Making it speak etc. * Commands:: Usage. * Customization:: Basic customization. * Advanced Customization:: Writing your own command feedbacks. * Problems:: Strange behavior. * Tips:: Useful Emacs tips. * Bug Reporting:: speechd-el and Speech Dispatcher bugs.  File: speechd-el.info, Node: Installation, Next: Starting Alternative Output, Prev: speechd-el User Manual, Up: speechd-el User Manual 2.1 Installation ================ speechd-el installation consists of the following steps: 1. If you use Emacs older than 23.2 then install the 'eieio' Elisp library, available from or perhaps your favorite operating system distribution. 2. Copy the speechd-el '*.el' files contained in the distribution package somewhere to your Emacs load path. 3. If you like, byte compile the '*.el' files. Byte compilation is recommended, because it speeds up speechd-el significantly. You can byte compile the '*.el' files using the command make compile Then install the compiled files to an Emacs load path location as well. 4. Install the 'speechd-log-extractor' somewhere to your shell PATH, e.g. '/usr/local/bin/'. Installing this script is optional, it is used only for bug reporting. 5. Add the following line to your '~/.emacs': (autoload 'speechd-speak "speechd-speak" nil t) To receive speech output, Speech Dispatcher must be installed and running. Speech Dispatcher version 0.5 or higher is recommended. To receive Braille output, BRLTTY must be installed and running. BRLTTY version 3.7 or higher is required.  File: speechd-el.info, Node: Starting Alternative Output, Next: Commands, Prev: Installation, Up: speechd-el User Manual 2.2 Starting Speech and Braille Output ====================================== After installation of the '*.el' files and restarting Emacs, you can set up speechd-speak using the 'M-x speechd-speak' command. If you want to happen it automatically each time Emacs is started, put the following line to your '~/.emacs' after the autoload line: (speechd-speak) 'M-x speechd-speak' Set up Emacs for alternative output and start speaking or communicating with the Braille display. Please don't forget Speech Dispatcher must be running in order to get any speech output and BRLTTY must be running in order to get Braille output! After the initial setup, the command can be used again to restart the speech or Braille output when needed. Especially, you must run it again if Speech Dispatcher or BRLTTY gets restarted. After the first invocation, the command is available under the 'C-e C-s' key. Once the setup is done, enabling and disabling the alternative output is controlled by the speechd-speak and global-speechd-speak minor modes. Usually the mode commands are not used directly, you use the 'speechd-speak-toggle-speaking' command (*note Control Commands::), but if you need them, they are available. 'M-x speechd-speak-mode' Enable or disable speaking and Braille output in the current buffer. With no argument, this command toggles the mode. Non-null prefix argument turns on the mode. Null prefix argument turns off the mode. 'M-x global-speechd-speak-mode' Enable or disable alternative output globally. With no argument, this command toggles the mode. With prefix argument, turn alternative output on if and only if the argument is positive.  File: speechd-el.info, Node: Commands, Next: Customization, Prev: Starting Alternative Output, Up: speechd-el User Manual 2.3 Commands ============ The basic speechd-el commands are all accessible through a common special prefix key, which is 'C-e' by default (you can change it, *note Customization::). If this prefix conflicts with a global Emacs command, the original command is available by double pressing the prefix key. For instance, with the default prefix, the 'end-of-line' command, normally available under the 'C-e' key, can be invoked as 'C-e C-e'. In the following subsections we use the term _reading_ to indicate any kind of output enabled in speechd-el (such as speaking or Braille output). * Menu: * Reading Commands:: Reading pieces of text. * Informatory Commands:: Information about buffer, modes, etc. * Control Commands:: Stopping, setting speech rate, etc. * Parameter Setting Commands:: Modifying speech output. * Spelling:: How to spell a piece of text. * Other Commands:: Auxiliary commands.  File: speechd-el.info, Node: Reading Commands, Next: Informatory Commands, Prev: Commands, Up: Commands 2.3.1 Reading Commands ---------------------- 'C-e l' Read current line ('speechd-speak-read-line'). With the prefix argument, read the line only from the current cursor position to the end of line. If 'truncate-lines' is 'nil', read the line only to its visual end. 'C-e b' Read current buffer ('speechd-speak-read-buffer'). 'C-e >' Read current buffer from the cursor to the buffer end ('speechd-speak-read-rest-of-buffer'). 'C-e o' Read buffer of the other window, if any is present ('speechd-speak-read-other-window'). 'C-e r' Read current region ('speechd-speak-read-region'). 'C-e C-r' Read text in the rectangle-region ('speechd-speak-read-rectangle'). 'C-e w' Read the next word after cursor ('speechd-speak-read-word'). 'C-e .' Read current sentence ('speechd-speak-read-sentence'). 'C-e {' Read the next paragraph after cursor ('speechd-speak-read-paragraph'). 'C-e [' Read the next page after cursor ('speechd-speak-read-page'). 'C-e '' Read the next symbolic expression after cursor ('speechd-speak-read-sexp'). 'C-e c' Read the character at the cursor position ('speechd-speak-read-char'). 'C-e C-n' Read the next line ('speechd-speak-read-next-line'). 'C-e C-p' Read the previous line ('speechd-speak-read-previous-line'). 'C-e m' Read last seen Emacs message ('speechd-speak-last-message'). 'C-e RET' Read the mode line ('speechd-speak-read-mode-line'). Note: This command works only in Emacs 22 or higher. 'C-e i' Read last output buffer insertions ('speechd-speak-last-insertions'). That is the text read in auto-reading buffers, see *Note Auto-Reading Buffers::. A few Emacs commands get you stuck in a character reading prompt, a typical example is 'ispell-word'. If you miss what was read before you are prompted for action, you can use the following keystrokes at the prompt to repeat the output texts: 'C-e' The same as the 'C-e m' command above ('speechd-speak-last-message'). 'C-a' The same as the 'C-e i' command above ('speechd-speak-last-insertions'). If you don't like such character reading prompt behavior, you can disable it using the following variable: 'speechd-speak-allow-prompt-commands' If non-'nil', allow the speechd-speak commands mentioned above in read-char prompts.  File: speechd-el.info, Node: Informatory Commands, Next: Control Commands, Prev: Reading Commands, Up: Commands 2.3.2 Informatory Commands -------------------------- 'C-e C-i b' Read information about current buffer ('speechd-speak-buffer-info'). 'C-e C-i f' Read information about current frame ('speechd-speak-frame-info'). 'C-e C-i h' Read contents of the header line ('speechd-speak-header-line-info'). Note: This command works only in Emacs 22 or higher. 'C-e C-i m' Read information about current major and minor modes ('speechd-speak-mode-info'). 'C-e C-i c' Read information about current coding systems ('speechd-speak-coding-info'). 'C-e C-i i' Read information about current input method ('speechd-speak-input-method-info'). 'C-e C-i p' Read status of the process associated with the current buffer ('speechd-speak-process-info').  File: speechd-el.info, Node: Control Commands, Next: Parameter Setting Commands, Prev: Informatory Commands, Up: Commands 2.3.3 Control Commands ---------------------- 'C-e q' Toggle reading globally ('speechd-speak-toggle-speaking'). With a prefix argument, toggle it in the current buffer only. 'C-e s' Stop reading current message ('speechd-stop'). Other queued messages will still be read. If the prefix argument is given, stop reading the current message of any client, not just of the current connection. 'C-e x' Stop reading all the queued messages of the current connection and of the connections listed in SPEECHD-CANCELABLE-CONNECTIONS. If the universal prefix argument is given, stop reading all the messages of all connections. If a numeric prefix argument is given, stop all the messages of the current Emacs session. 'C-e p' Pause reading -- just be quiet for now and postpone current reading until the resume command is invoked ('speechd-pause'). If the prefix argument is given, pause reading of all clients. 'C-e SPC' Resume paused reading ('speechd-resume'). If the prefix argument is given, resume reading of all clients. 'C-e 1' 'C-e 2' 'C-e 3' 'C-e 4' 'C-e 5' 'C-e 6' 'C-e 7' 'C-e 8' 'C-e 9' Set one of the predefined speech rates ('speechd-speak-key-set-predefined-rate'). 'C-e 1' sets the slowest rate, 'C-e 5' sets the medium rate, and 'C-e 9' sets the fastest rate.  File: speechd-el.info, Node: Parameter Setting Commands, Next: Spelling, Prev: Control Commands, Up: Commands 2.3.4 Parameter Setting Commands -------------------------------- These commands set various properties of the speech output. They all apply on the current Speech Dispatcher connection (for more information about Speech Dispatcher connections, *note Connection Voices::), unless there are invoked with a prefix argument. With a numeric prefix argument they apply on all speechd-el connections, with a universal prefix argument they apply on all Speech Dispatcher connections. Commands affecting basic parameters of the text-to-speech process: 'C-e d l' Set default language of the connection. Specify it as an RFC 1766 language code (e.g. 'en', 'cs', etc.). 'C-e d .' Specify how to handle punctuation, whether to read it or ignore it. 'all' mode reads all punctuation characters, 'none' mode skips them all quietly, and 'some' mode reads a selected subset of punctuation characters specified in the Speech Dispatcher configuration. 'C-e d c' Set capital letter indication mode. 'icon' means signal them with a sound icon, 'spell' means spell them using a special spelling table, and 'none' means no indication. Commands affecting speech output properties: 'C-e d v' Set default voice to be used by the synthesizer ('speechd-set-voice'). You may select one from the voice set offered by your Speech Dispatcher installation. 'C-e d C-v' Set default voice to be used by the synthesizer directly by its synthesizer dependent name ('speechd-set-synthesizer-voice'). You may select one from the voice set offered by the currently selected Speech Dispatcher output module. This works only with Speech Dispatcher 0.6.3 or higher and not all Speech Dispatcher output modules support this function. 'C-e d r' Set exact speech rate, ranging from -100 (slowest) to 100 (fastest) ('speechd-set-rate'). Most often you will probably want to use the 'speechd-speak-key-set-predefined-rate' command bound to 'C-e NUMBER' instead, see *note Control Commands::. 'C-e d p' Set voice pitch, ranging from -100 (lowest) to 100 (highest) ('speechd-set-pitch'). 'C-e d V' Set voice volume, ranging from -100 (lowest) to 100 (highest) ('speechd-set-volume'). Commands affecting the speech synthesizer: 'C-e d o' Switch Speech Dispatcher to the given output module ('speechd-set-output-module'). Give the module name when you are prompted for the argument.  File: speechd-el.info, Node: Spelling, Next: Other Commands, Prev: Parameter Setting Commands, Up: Commands 2.3.5 Spelling -------------- There are two ways to use spelling in speechd-el. The first one is the 'speechd-speak-spell-mode', which is a minor mode that you can enable for a buffer. The mode is useful if you want to spell more of the buffer contents. The second spelling method is using the following command: 'C-e C-l' Cause the following command to spell the text it reads ('speechd-speak-spell'). For instance, if you want to spell the word after the cursor, you can type 'C-e C-l C-e w'.  File: speechd-el.info, Node: Other Commands, Prev: Spelling, Up: Commands 2.3.6 Other Commands -------------------- In case Emacs gets completely crazy and refuses to run commands including 'C-x C-c' because of a bug in speechd-el or in an alternative output related custom definition, you can try to invoke the following command as the last resort: 'C-e C-x' Try to disable all modes, hooks and wrappers installed by 'speechd-speak' ('speechd-unspeak'). The following commands are rarely used, mostly for diagnosing purposes: 'C-e z' Repeat the last output text ('speechd-repeat'). 'M-x speechd-say-text' Prompt for a text and read it.  File: speechd-el.info, Node: Customization, Next: Advanced Customization, Prev: Commands, Up: speechd-el User Manual 2.4 Customization ================= All the customization options described below are accessible in the customization group 'speechd-el' and its subgroups. * Menu: * Driver Selection:: Choosing output devices. * Connection Setup:: Where to connect to. * Default Priorities:: Priorities of various kinds of messages. * Basic Speaking:: Simple options. * Auto-Reading Buffers:: Making certain buffers speak automatically. * Reading State:: Speaking Emacs state changes. * Signalling:: Signalling empty lines, etc. * Text Properties:: Handling faces and special pieces of text. * Index marking:: Moving cursor when speaking. * Languages:: Using multiple languages. * Voices:: Defining different voices. * Connection Voices:: Setting connection parameters. * Multiple Connections:: Different parameters for some modes & buffers. * Keys:: Customizing command keys. * Braille Display Keys:: Binding actions to Braille display keys. * Modes:: Minor mode hooks. * Debugging:: Make debugger quiet.  File: speechd-el.info, Node: Driver Selection, Next: Connection Setup, Prev: Customization, Up: Customization 2.4.1 Selecting Drivers ----------------------- By default speechd-el speaks to 'ssip' and 'brltty' drivers. You can change the set of active drivers by customizing the following variable: 'speechd-out-active-drivers' List of names of active output drivers. If a driver that does not work is present in the variable (e.g. the list contains the 'brltty' symbol while BRLTTY is not actually running), you receive an error message. To prevent the error message, remove the driver from this variable. When you want to enable or disable some driver temporarily, you can use the following commands: 'M-x speechd-out-enable-driver' Enable the given output driver. 'M-x speechd-out-disable-driver' Disable the given output driver.  File: speechd-el.info, Node: Connection Setup, Next: Default Priorities, Prev: Driver Selection, Up: Customization 2.4.2 Speech Dispatcher Connection Configuration ------------------------------------------------ Connection configuration variables allow you connect to Speech Dispatcher or BRLTTY running on a remote host or a non-default port and to specify other TCP connection parameters. Speech Dispatcher connection options: 'speechd-connection-method' Connection method to Speech Dispatcher. Possible values are symbols 'unix-socket' for Unix domain sockets and 'inet-socket' for Internet sockets on a given host and port. 'speechd-host' Name of the host running Speech Dispatcher to connect to, given as a string. Default is either the contents of the shell variable 'SPEECHD_HOST' variable if set, or '"localhost"'. Value of this variable matters only when Internet sockets are used for communication with Speech Dispatcher. 'speechd-port' Port number to connect to. Default is either the contents of the shell variable 'SPEECHD_PORT' if set, or the default Speech Dispatcher port. Value of this variable matters only when Internet sockets are used for communication with Speech Dispatcher. 'speechd-autospawn' If non-'nil', Emacs will attempt to automatically start Speech Dispatcher. This means that if speechd-el gets a speech request and the Speech Dispatcher server is not running already, speechd-el will launch it. 'speechd-timeout' Maximum number of seconds to wait for a Speech Dispatcher answer. If it is exceeded, speechd-el closes the connection. Normally, Speech Dispatcher should answer protocol commands immediately, but if you talk to a Speech Dispatcher in a strange way through a lagging network, you may want to increase the limit. BRLTTY connection options: 'brltty-default-host' Name of the host running BRLTTY to connect to, given as a string. Default is '"localhost"'. 'brltty-default-port' Port number to connect to. It can be either a single number or a list of numbers; in the latter case the given port numbers are attempted in the order they are given until Emacs connects to something. Default is the list of the standard BrlAPI ports. 'brltty-authentication-file' File containing the BrlAPI authentication key. It is important to set the variable properly, otherwise the connection to BRLTTY gets rejected. Default is '"/etc/brlapi.key"'. 'brltty-coding' Coding in which texts should be sent to BRLTTY. Default is 'iso-8859-1'; if you use non-Western language, you may need to change it to display its characters correctly on the Braille display. 'brltty-tty' Number of the Linux console on which speechd-el runs. If this value is not set correctly, speechd-el may not interact well with other applications communicating with BRLTTY. speechd-el tries to find the correct value itself, if this doesn't work, set this variable properly or set the 'CONTROLVT' environment variable. 'brltty-timeout' Maximum number of seconds to wait for a BRLTTY answer. If it is exceeded, speechd-el closes the connection. Normally, BRLTTY should answer protocol commands immediately, but if you talk to BrlAPI in a strange way through a lagging network, you may want to increase the limit.  File: speechd-el.info, Node: Default Priorities, Next: Basic Speaking, Prev: Connection Setup, Up: Customization 2.4.3 Default Priorities ------------------------ If a speechd-el function sends a message to the output device without an explicitly specified priority, the priorities defined by the following variables are used. By changing the values, you can achieve interesting effects. For instance, changing the value of 'speechd-default-key-priority' from 'notification' to 'message' makes all typed characters to be echoed and makes them to interrupt common text reading. The valid values of all the variables here are: 'important', 'message', 'text', 'notification', 'progress'. They correspond to Speech Dispatcher priorities, see the Speech Dispatcher manual for more details. 'speechd-default-text-priority' Default priority of most text messages. 'speechd-default-sound-priority' Default priority of sound icons. 'speechd-default-char-priority' Default priority of spelled characters. 'speechd-default-key-priority' Default priority of typed keys.  File: speechd-el.info, Node: Basic Speaking, Next: Auto-Reading Buffers, Prev: Default Priorities, Up: Customization 2.4.4 Basic Customization of Speaking ------------------------------------- 'speechd-speak-echo' Symbol determining how to read typed characters. It can have one of the following values: 'character' Read characters when they are typed. 'word' Read only whole words once they are written. 'nil' Don't echo anything on typing. 'speechd-speak-deleted-char' Defines which character to speak when deleting a character. If non-'nil', speak the deleted character, otherwise speak the adjacent character. 'speechd-speak-buffer-name' When you switch to another buffer and this variable is non-'nil', read the new buffer name. If the variable value is the symbol 'text', read the text from the cursor position to the end of line in the new buffer as well. If the variable is 'nil', read the text without speaking the buffer name. 'speechd-speak-whole-line' If non-'nil', read whole line on movement by default. Otherwise read from the point to the end of line on movement by default. 'speechd-speak-on-minibuffer-exit' When this variable is non-'nil', speechd-el reads the text around cursor after exiting from minibuffer or its recursive level if there is nothing else to read. 'speechd-speak-read-command-keys' This variable defines in which situations command keys should be read when their command is performed. If 't', the command keys are always read. If 'nil', they are never read. If list, it may contain one or more of the following symbols describing the situations in which the keys should be read: 'movement' Read the command keys if the cursor has moved, no buffer modification happened. 'modification' Buffer was modified, the cursor hasn't moved. 'movement-modification' Buffer was modified and the cursor was moved. If the variable value is 't', the command keys are read before the command is performed. Otherwise, their reading is delayed after the command is executed, since the buffer changes and cursor movement must be detected first. 'speechd-speak-ignore-command-keys' List of commands that should never echo their command keys. 'speechd-speak-read-command-name' If non-'nil', read the command name instead of the command keys in the situations defined by the variable 'speechd-speak-read-command-keys'. 'speechd-speak-message-time-interval' Minimum time in seconds, after which the same message may be repeated. If the message is the same as the last one, it is not spoken unless the number of seconds defined here has passed from the last spoken message.  File: speechd-el.info, Node: Auto-Reading Buffers, Next: Reading State, Prev: Basic Speaking, Up: Customization 2.4.5 Auto-Reading Buffers -------------------------- It sometimes useful to start reading some buffers without user's explicit request. For instance, if a help command is invoked, the user usually wants to read the help text immediately. The following variables contain lists of names of the buffers that may be read automatically if they get changed by the last command and are visible in some window of the current frame. 'speechd-speak-auto-speak-buffers' Content of these buffers is read after the command on the above conditions if nothing else (e.g. text around a new cursor position) is to be read. 'speechd-speak-force-auto-speak-buffers' Like 'speechd-speak-auto-speak-buffers' except that the buffer content is read forcibly, even when something else could be read. The following variables define how to handle texts inserted during performing user commands. Only newly inserted text is read, the options don't affect processing of deleted text. Also, the options don't affect insertions within commands processed in a special way by speechd-el or user definitions, like 'self-insert-command'. 'speechd-speak-buffer-insertions' Defines whether insertions in the current buffer should be read automatically. The value may be one of the following symbols: 'nil' Don't read the inserted texts. 't' Read all the inserted texts. 'one-line' Read only the first lines of inserted texts. 'whole-buffer' Read whole buffer if it was modified in any way. 'speechd-speak-insertions-in-buffers' List of names of buffers, in which insertions are automatically read, whether the buffer is current or not and regardless the 'speechd-speak-buffer-insertions' variable. 'speechd-speak-priority-insertions-in-buffers' List of names of buffers, in which insertions are automatically read immediately as they appear, not only after a command is evaluated as with 'speechd-speak-insertions-in-buffers'. This is typically useful in comint buffers. 'speechd-speak-align-buffer-insertions' If non-'nil', the insertion text to be read is extended to the beginning of the first word affected by the insertion. This is particularly useful in completion functions. If the last command modified the current buffer and moved its cursor to a completely different position, the new cursor position is not indicated in the alternative output. You can change it through the following variable: 'speechd-speak-movement-on-insertions' If 't', read the text around new cursor position even when the current buffer was modified. If 'read-only', read it only in read-only buffers. If 'nil', don't read it.  File: speechd-el.info, Node: Reading State, Next: Signalling, Prev: Auto-Reading Buffers, Up: Customization 2.4.6 Reading State Changes --------------------------- speechd-el can read information about current Emacs state, like current buffer name, major and minor modes or other buffer attributes, see *Note Informatory Commands::. Changes in the Emacs state information can be reported automatically, according to the user configuration: 'speechd-speak-state-changes' List of identifiers of the Emacs state changes to be automatically reported. The following symbols are recognized as state change identifiers: 'buffer-name' 'buffer-identification' (only in Emacs 22 or higher) 'buffer-modified' 'buffer-read-only' 'frame-name' 'frame-identification' (only in Emacs 22 or higher) 'header-line' (only in Emacs 22 or higher) 'major-mode' 'minor-modes' 'buffer-file-coding' 'terminal-coding' 'input-method' 'process' 'speechd-speak-display-modes' List of minor modes to be read by their display string rather than name. To use the display form of a mode identification may be useful in cases when the display form is more concise than the mode name or when the display form changes without actual change of the mode.  File: speechd-el.info, Node: Signalling, Next: Text Properties, Prev: Reading State, Up: Customization 2.4.7 Signalling ---------------- Certain situations may be signalled by icons. "Icon" is typically a short sound or a special indication on a Braille display(1) signalling some event (such as displaying a message, entering prompt, or reaching an empty line). The following variable enables or disables the predefined indications. To learn how to define your own indications, *Note Advanced Customization::. 'speechd-speak-signal-events' List of symbols, containing names of events to signal with an icon. The following event names are supported: 'start' Start or restart of speechd-el. 'empty' Empty text in various situations. 'beginning-of-line' Reaching beginning of line after the 'forward-char' and 'backward-char' commands. 'end-of-line' Reaching end of line after the 'forward-char' and 'backward-char' commands. 'minibuffer' Entering minibuffer. 'message' Messages in echo area follow. ---------- Footnotes ---------- (1) Icons are not yet implemented this way in the Braille library, plain texts are displayed instead.  File: speechd-el.info, Node: Text Properties, Next: Index marking, Prev: Signalling, Up: Customization 2.4.8 Text Properties --------------------- By default, after a movement command speechd-el reads the current line. But if the cursor position is surrounded by a text having text properties (typically faces, but any text properties count), speechd-el may read just the piece of the text around the cursor having uniform properties. Also, if font lock mode is enabled, faces may be mapped to different voices. 'speechd-speak-by-properties-on-movement' Method of selection of the piece of text to be read on movement. The variable may take one of the following values. 'nil' Text properties are not considered at all. 't' All text properties are considered. list of faces Only the named faces are considered. 'speechd-speak-by-properties-always' List of commands that always consider text properties, even when the 'speechd-speak-by-properties-on-movement' variable is 'nil'. 'speechd-speak-by-properties-never' List of commands that never consider text properties, even when the 'speechd-speak-by-properties-on-movement' variable is non-'nil'. 'speechd-speak-faces' This variable allows you to invoke actions when the cursor ends up on a certain face after a user command is performed. The variable value is an alist with elements of the form '(FACE . ACTION)'. If a movement command leaves the cursor on a FACE and there is no explicit reading bound to the command, ACTION is invoked. If ACTION is a string, that string is read. If ACTION is a function, it is invoked, with no arguments. 'speechd-face-voices' Mapping of faces to voices. The variable value is an alist with elements of the form '(FACE . VOICE)' where FACE is a face and VOICE is a voice identifier defined in 'speechd-voices', see *note Voices::. Each face is spoken in the corresponding voice. If there's no item for a given face in this variable, the face is spoken in the current voice. Note that the mapping takes the effect only if font lock mode is enabled.  File: speechd-el.info, Node: Index marking, Next: Languages, Prev: Text Properties, Up: Customization 2.4.9 Index marking ------------------- Reading a text with index marking means the cursor is moved over the text as the text is read, whenever an inserted index mark is reached. Index marking is switched off by default but you can set it up for 'speechd-speak-read-buffer' and 'speechd-speak-read-rest-of-buffer' commands using the following variables: 'speechd-speak-use-index-marks' If non-'nil', index marking is enabled for 'speechd-speak-read-buffer' and 'speechd-speak-read-rest-of-buffer' commands. 'speechd-speak-index-mark-regexp' Regular expression defining the places where to put index marks to. An index mark is put at the end of the regexp at each of the places. If the regular expression is empty (the default), it's taken from 'sentence-end' variable. If 'sentence-end' is 'nil', a default regular expression matching common punctuation is used.  File: speechd-el.info, Node: Languages, Next: Voices, Prev: Index marking, Up: Customization 2.4.10 Using multiple languages ------------------------------- You can use speechd-el with multiple languages. However, the process can't be easily automated, since ordinary text does not contain any information about its language. So if you want to use speechd-el with the output being spoken in multiple languages, you must provide speechd-el some hints. The language settings described below currently apply only to the spoken output, to select the proper voice. They don't affect the Braille output; but you may want to set language coding for Braille, *Note Connection Setup::. The basic means for providing language information to speechd-el is the variable 'speechd-language'. Each time speechd-el is about to speak a piece of text, it checks the variable for the language code and if it is non-'nil', it speaks the text in the corresponding language. The non-'nil' value must be a string of the RFC 1766 language code (e.g. 'en', 'cs', etc.). Most often you will probably want to set the variable in a particular file, see *note (emacs)File Variables::, or as a buffer local variable, see *note (emacs)Locals::, in mode hooks, see *note (emacs)Hooks::. If a piece of the text has the 'language' property containing the RFC 1766 language code, it is spoken in the corresponding language, regardless of other settings. You can use the 'speechd-language' function to put the property on a string in your Elisp programs. Another good way of using multiple languages is to use multiple connections for separating language dependent buffers or modes, see *note Multiple Connections::, and to set the 'language' parameter for each such a connection, see *note Connection Voices::. If nothing helps better, you can select languages according to the current input method: 'speechd-speak-input-method-languages' Alist mapping input methods to languages. Each of the alist elements is of the form '(INPUT-METHOD-NAME . LANGUAGE)', where INPUT-METHOD-NAME is a string naming the input method and LANGUAGE is an RFC 1766 language code accepted by SSIP (e.g. 'en', 'cs', etc.). If the current input method is present in the alist, the corresponding language is selected unless overridden by another setting. Some texts in Emacs, such as messages, minibuffer prompts or completions, are typically in English. speechd-el reads them in English by default, but it can be instructed to use another language for them: 'speechd-speak-emacs-language' Language to use for texts originating from Emacs. It's a string containing an RFC 1766 language code accepted by SSIP, 'en' by default. It can be also 'nil', meaning the language should be unchanged and the current language should be used.  File: speechd-el.info, Node: Voices, Next: Connection Voices, Prev: Languages, Up: Customization 2.4.11 Defining voices ---------------------- You can define special voices in speechd-el that can be used in different situations, e.g. to speak different faces in different voices (*note Text Properties::) or to set different punctuation modes for different kinds of buffers (*note Multiple Connections::). speechd-el voices define not only basic voice characteristics, but also speech characteristics like pitch or rate and special properties like punctuation reading or capital character signalization. Voice definition is contained in the following variable: 'speechd-voices' Alist of voice identifiers and their parameters. Each element of the list is of the form '(VOICE-ID . PARAMETERS)', where VOICE-ID is a symbol under which the voice will be accessed and PARAMETERS is an alist of parameter identifiers and parameter values. Valid parameter names are the following symbols: 'language', 'gender', 'age', 'style', 'name', 'rate', 'pitch', 'volume', 'punctuation-mode', 'capital-character-mode', 'message-priority', 'output-module'. Please note that any parameter entry present will change the corresponding parameter, even if the parameter value is 'nil' or empty; if you don't want to change the parameter in any way by the voice, don't put it to the list (and don't enable its entry in customize). 'name' value is a string identifying Speech Dispatcher voice name. If it is not given, the parameters 'gender', 'age', and 'style' are considered to select a Speech Dispatcher voice. 'gender' value can be one of the symbols 'male', 'female', 'neutral'. 'age' can be one of the symbols 'middle-adult', 'child'. 'neutral'. 'style' can be one of the numbers '1', '2', '3' ('style' values are likely to be changed in future). The 'message-priority' parameter sets priority of any message of the voice. Its value is any of the message priority symbols. See the corresponding 'speechd-set-*' functions for valid values of other parameters. The voice named 'nil' is special, it defines a default voice. Explicit definition of its parameters is optional.  File: speechd-el.info, Node: Connection Voices, Next: Multiple Connections, Prev: Voices, Up: Customization 2.4.12 Connection Voices ------------------------ With the help of the following variable you can let set various connection parameters, like speech rate, language, etc., automatically. speechd-el can open multiple connections according to various criteria (*note Multiple Connections::), you can set different parameters to different connections, based on their names. 'speechd-connection-voices' Alist of connection names and corresponding voices. Each list element is of the form '(CONNECTION-NAME . VOICE)', where CONNECTION-NAME is a connection name given as a string and VOICE is a voice identifier defined in the variable 'speechd-voices'. The default voice (named 'nil') is used for connections that are not present in this variable. So that changing the value of the variable could take the full effect, the open connections must be reopened. Unless you use the customization interface, you must invoke the 'C-u M-x speechd-speak' command to ensure this. There is a command to help you with setting connection voice and its parameters: 'C-e C-a' Store the current connection parameters to a specified voice in the 'speechd-voices' variable and set that voice for the current connection in the 'speechd-connection-voices' variable. Please note you are still responsible to save the variables if you want to use them in future sessions.  File: speechd-el.info, Node: Multiple Connections, Next: Keys, Prev: Connection Voices, Up: Customization 2.4.13 Multiple Connections --------------------------- You can arrange speechd-el to use separate connections to Speech Dispatcher for certain buffers or major modes. This is basically useful to allow independent parameter setting for those buffers and major modes, both by hand and through the configuration (*note Connection Voices::). Each Speech Dispatcher connection has its unique name. By default, speechd-el uses a connection named '"default"'. All you need to create a separate connection is to let speechd-el choose a different connection name in certain situations. The process of connection name selection is driven by the 'speechd-speak-connections' variable. 'speechd-speak-connections' Alist mapping major modes and buffers to Speech Dispatcher connections. Each element of the alist is of the form '(MODE-OR-BUFFER . CONNECTION-NAME)'. When speechd-el wants to send a message, it tests the current environment against the MODE-OR-BUFFER entries. MODE-OR-BUFFER may be one of the following objects, in the order of priority from the highest to the lowest: * a list, representing a function call that should return a non-'nil' value if and only if the element should be applied * regular expression matching desired buffer names * the symbol ':minibuffer', representing minibuffers * major mode symbol * 'nil', representing non-buffer areas, e.g. echo area * 't', representing the default value if nothing else matches If more entries match in some situation, the entry with the highest priority is used. CONNECTION-NAME is an arbitrary non-empty string naming the corresponding connection. If no connection with such a name is open in the running speechd-el, it is automatically created when there's something to send to it. 'speechd-cancelable-connections' List of names of connections that are cancelled by default when a cancel function is called.  File: speechd-el.info, Node: Keys, Next: Braille Display Keys, Prev: Multiple Connections, Up: Customization 2.4.14 Keys ----------- The command keys of speechd-el are defined by the 'speechd-speak-prefix' variable and the 'speechd-speak-mode-map' key map. 'speechd-speak-prefix' This variable defines the prefix key of the speechd-el commands, which is 'C-e' by default. If you change the variable value after speaking has already been started through the 'speechd-speak' command and you do not set it through the customization interface, you must rerun the 'speechd-speak' so that the change took any effect. 'speechd-speak-mode-map' This key map holds the mapping of the keys following the prefix key. You can set keys here in the usual way, e.g. (define-key speechd-speak-mode-map "t" 'speechd-say-text) to get the 'speechd-say-text' command bound to the 'C-e t' key (assuming 'C-e' is the prefix key).  File: speechd-el.info, Node: Braille Display Keys, Next: Modes, Prev: Keys, Up: Customization 2.4.15 Braille Display Keys --------------------------- When using Braille display output, speechd-el can bind actions to the Braille display keys. The Braille key bindings are defined in the following variables: 'speechd-braille-key-functions' Alist of Braille display key codes and corresponding Emacs functions. If the given key is pressed, the corresponding function is called with a 'speechd-brltty-driver' instance as its single argument (read the source code for information about speechd-el output drivers). The key codes are either integers (for BRLTTY 3.7 and older) or lists containing three integers (for BRLTTY 3.8 and newer). See the default variable value for examples of possible key codes. The assigned functions needn't be interactive. Actually as the functions may be invoked by asynchronous events any time at any place, they shouldn't modify current environment in any inappropriate way. For this reason it is recommended _not_ to assign user commands to the keys here. 'speechd-brltty.el' contains some predefined functions that can be assigned to the Braille display keys here: 'speechd-brltty-scroll-left' Scroll towards the beginning of the currently displayed message. 'speechd-brltty-scroll-right' Scroll towards the end of the currently displayed message. 'speechd-brltty-scroll-to-bol' Scroll to the beginning of the currently displayed message. 'speechd-brltty-scroll-to-eol' Scroll to the end of the currently displayed message. 'speechd-brltty-scroll-to-cursor' Scroll to the cursor position (if any) in the displayed message. 'speechd-brltty-finish-message' Stop displaying the current message and display the next one. 'speechd-brltty-cancel' Stop displaying the current message and discard all messages waiting in the queue. 'speechd-brltty-previous-message' Display the previous message from the history. 'speechd-brltty-next-message' Display the next message from the history. 'speechd-brltty-first-message' Display the first message in the history. 'speechd-brltty-last-message' Display the last message in the history. Additionally, the following macro is provided: 'speechd-brltty-command-key-function KEY' Insert function for handling KEY as a general input key. This is useful for handling Braille keys acting as general character input keys. The 'speechd-braille-key-functions' variable contains some default bindings initially, but as the keys and their codes differ a lot for various Braille displays, you probably need to adjust it for your particular device. You can figure out the display key codes by setting the 'speechd-braille-show-unknown-keys' variable to 't' and pressing the display keys. 'speechd-braille-show-unknown-keys' If non-'nil', show codes of the pressed Braille keys that have no function assigned in 'speechd-braille-key-functions'. This is useful to figure out the Braille key codes. With BrlTTY 3.8 and higher BrlTTY can handle many braille keys itself in X environment. So speechd-el doesn't try to handle most keys itself by default. Instead it handles only keys assigned in 'speechd-braille-key-functions'. If this is a problem, typically when looking for braille key codes, the following command can be useful: 'C-e C-b k' Toggle handling braille keys by speechd-el. If BrlTTY handles the keys (this is the default behavior), speechd-el receives only keys which are assigned to commands in 'speechd-braille-key-functions'. If speechd-el handles the keys, then BrlTTY sends all the pressed keys to speechd-el without processing them itself.  File: speechd-el.info, Node: Modes, Next: Debugging, Prev: Braille Display Keys, Up: Customization 2.4.16 Minor mode hooks ----------------------- speechd-el provides a minor mode that enables and disables the reading, *Note Starting Alternative Output::. You can let perform custom actions on entering it through the following hook. 'speechd-speak-mode-hook' Hook run when speechd-speak minor mode is enabled.  File: speechd-el.info, Node: Debugging, Prev: Modes, Up: Customization 2.4.17 Debugging speechd-el --------------------------- When you try to debug speechd-speak functions, you can experience the problem of recursive reading in the Elisp debugger. To avoid it, you can instruct speechd-el to be quiet in Elisp debuggers: 'speechd-speak-in-debugger' If 'nil', speechd-speak functions won't be reading in Elisp debuggers.  File: speechd-el.info, Node: Advanced Customization, Next: Problems, Prev: Customization, Up: speechd-el User Manual 2.5 Defining Your Own Command Feedbacks ======================================= Writing your own feedback definitions generally requires knowledge of Elisp programming. But don't be afraid, you can set basic things without it, just following instructions here. speechd-el allows you to say a text, output an icon, or call any Elisp expression before or after a command or a function is invoked. There are two macros that allow you to do it, while ensuring everything is set up properly: 'speechd-speak-command-feedback COMMAND POSITION FEEDBACK' Install feedback invocation on COMMAND. 'command' is a name of an interactive function (use 'C-h C-c' to get a name of the command bound to a given key). POSITION may be one of the symbols 'before' and 'after' to call the feedback before or after the command is invoked. 'feedback' may be a string or any Elisp expression. If it is a string (a text enclosed in double quotes), it defines a text to be spoken or a sound icon to be played. If the string starts with an asterisk ('*'), it names a sound icon (the asterisk is not a part of the name), otherwise it is a normal text. Example: (speechd-speak-command-feedback suspend-emacs before "Suspending Emacs!") You can put this line of Elisp code to your '~/.emacs' to ensure you are informed when you invoke the 'suspend-emacs' command (usually bound to 'C-z'). 'speechd-speak-function-feedback FUNCTION POSITION FEEDBACK' This is the same as 'speechd-speak-command-feedback', except it is called anytime the given function is invoked, whether interactively or not. Also, FUNCTION may be any function, not only an interactive command. _Please note:_ * Due to Emacs deficiency, the feedback mechanism may not work on built-in functions. * Be careful if you want to install function feedbacks without help of the macros above. The macros install code ensuring nothing is spoken if 'speechd-speak-mode' is disabled and other similar precautions. If you do not use them, you should make those precautions yourself.  File: speechd-el.info, Node: Problems, Next: Tips, Prev: Advanced Customization, Up: speechd-el User Manual 2.6 Problems You May Encounter ============================== * _Why are some menu items in Info not read?_ This is due the way how Emacs fontifies the menu items. Try to set the 'Info-fontify-maximum-menu-size' variable to '0' to avoid the problem. * _How to make appointments read their notifications?_ Set the variable 'appt-msg-window' to 'nil'. Also, adding '"diary"' to the 'speechd-speak-auto-speak-buffer' variable may be useful. * _How to avoid printing URL when moving through links in w3m-el?_ Add the following code to your '~/.emacs': (defadvice w3m-print-this-url (around my-w3m-print-this-url activate) (when (eq this-command 'w3m-print-this-url) ad-do-it)) * _How to avoid excessive occurrences of TAB (C-i) and NL (C-j) characters on a Braille display in some buffers (e.g. '*Completion*' buffer)?_ Braille displays generally display exact content, which is usually what you want. But sometimes TAB characters are inserted to Emacs buffers for the sole purpose of visual formatting. You can tell Emacs to suppress this behavior when possible by adding the following code to your '~/.emacs': (setq-default indent-tabs-mode nil) * _In some situations, when a modified text is read after performing a command, the text is read in separate pieces and some of the pieces are repeated._ Buffer modifications can be performed by many different ways in Elisp programs. speechd-el is unable to track them always satisfactory. If you have a reasonable idea how to improve buffer modification reading, please tell us. As a workaround, if you encounter this problem when performing some often used commands, you might want to define your own speaking feedbacks of those commands. *Note Advanced Customization::, for more details. * _There are sometimes small delays (about 1 second) before something is read after a command._ Maybe Emacs is garbage collecting in the meantime. Try to increase the value of the 'gc-cons-threshold' variable, e.g. to 4000000. It may increase or reduce the performance, depending on your environment and particular requirements. If you didn't byte compile the source '*.el' files, do so. If you are an experienced Elisp hacker and you can find out why speechd-el produces significant amount of data increasing the frequency of garbage collection and how to make the things better, your help is welcome! * _During holding down the 'C-n' key, the screen gets frozen and the cursor doesn't move for a while._ Emacs redisplay routines are generally not invoked when Emacs is busy. speechd-el combined with your autorepeat may achieve such a state quite easily. If that's a real problem to you, you can reduce your autorepeat rate or buy a faster computer. Also, if you didn't byte compile the source '*.el' files, do so. Certainly, any tips increasing speechd-el performance are welcome.  File: speechd-el.info, Node: Tips, Next: Bug Reporting, Prev: Problems, Up: speechd-el User Manual 2.7 Useful Emacs tips ===================== Don't forget that Elisp allows you to define many useful functions. Typically, you may want to define commands reporting some information, which can be easily identified on the Emacs screen, but which is not so easily provided in the standard speech output interface. Some examples: * _Reporting current date in calendar:_ (defun report-day () (interactive) (message "%s" (calendar-date-string (calendar-cursor-to-date t)))) * _Reporting current diary appointments:_ (defun report-current-appointments () (interactive) (let ((appt-now-displayed nil)) (appt-check))) * _Reviewing ispell choices_ When you invoke the 'ispell-word' command and the checked word is mispelled, ispell offers you the list of alternative spellings. You can let speechd-el repeat the list by pressing 'C-a' in the ispell prompt. When you want to review the choices closely, press 'C-r' to enter recursive edit and then switch to the '*Choices*' window with 'C-x o'. After you review the choices, you can return back to the ispell prompt by pressing 'C-M-c'.  File: speechd-el.info, Node: Bug Reporting, Prev: Tips, Up: speechd-el User Manual 2.8 How to Report speechd-el or Speech Dispatcher Bugs ====================================================== When you encounter a speechd-el bug, you can report it to us using the following command. Before doing it, please read the whole text of this section to allow handling your bug report in a more efficient way. 'M-x speechd-bug' Report a speechd-el or Speech Dispatcher bug. The command asks you for some information and then asks you whether you can reproduce the bug. If you can, answer 'y' and start reproducing the bug immediately. As soon as the bug is reproduced, type 'C-e C-f'. Then you can (and should) further edit the generated mail and send it in the usual way. 'M-x speechd-bug-reproduce' Start reproducing a speechd-el or Speech Dispatcher bug. All user and Speech Dispatcher actions are watched from this moment. Bug reproduction is finished by pressing the 'C-e C-f' keys. After the bug reproduction is finished, information about it is inserted into the buffer where the 'speechd-bug-reproduce' command was invoked. This command is useful when you want to provide information about a bug without generating new bug report. When reporting the bugs, please always remember the following instructions: * Write as much information about the problem as possible. Describe what doesn't work, what's the expected behavior, what actions have triggered the bug, what's special about your Emacs environment or Speech Dispatcher configuration, etc. Don't try to analyze too much which information is important and which is not -- everything may be important to the developers, so try not to forget to mention anything that might be important, better more than less. Missing information may cause the developers won't be able to handle the bug at all. * Be as much precise as possible. Don't expect the developers to know the context or to know the way you typically use Emacs and speechd-el. Write in exact terms -- instead of just writing "when I invoke foo" write better "when I press the keys 'M-x foo RET', thus invoking the 'foo' command"; or instead of writing "doesn't speak what I expect" write like "speaks 'blah blah' instead of 'bleh bleh bleh' what is I expect, since 'bleh bleh bleh' is the text of the whole line". * When reproducing the bug, try to have the Speech Dispatcher logging enabled to the highest level -- set the 'LogLevel' option to '5' in your 'speechd.conf' configuration file. * When reproducing the bug, don't do any extra actions and invoke 'C-e C-f' as soon as the bug is reproduce. Thus you avoid losing the relevant information of the automatically extracted log files in an unnecessary garbage. * You can also look at the Speech Dispatcher bug reporting instructions, see *note (speechd)Reporting Bugs::.  File: speechd-el.info, Node: speechd-el Elisp Library, Next: Contact Information, Prev: speechd-el User Manual, Up: Top 3 speechd-el Emacs Lisp Library ******************************* The speechd-el code can be classified into several parts: * Low-level libraries for Speech Dispatcher and BrlAPI access implemented in the files 'speechd.el' and 'brltty.el'. * General device independent output mechanism defined in the 'speechd-out.el' file. Its particular device implementations are in the files 'speechd-ssip.el' and 'speechd-brltty.el'. * User interface implemented in 'speechd-speak.el'. You can use the libraries to communicate with Speech Dispatcher, BRLTTY or other devices in your own programs. Right now, there's no real programmer's manual to the libraries. Please read docstrings of available variables, functions and macros. Nevertheless, here are some instructions you can and should follow: * Don't use any functions, variables or other Lisp objects, names of which start with prefixes separated by double dashes (such as 'speechd--' or 'speechd-speak--'). These objects are considered private and may change incompatibly or disappear at any time without notice. * If you want to select or create a particular SSIP connection, do so by binding the 'speechd-client-name' variable: (let ((speechd-client-name "something")) ... the code using the connection "something" ... ) Please note it's usually bad idea to open two concurrent Speech Dispatcher connections sharing the same client name. * Otherwise there should be no special pitfalls and you should be safe to do anything what makes sense. You can also look at *note Advanced Customization::.  File: speechd-el.info, Node: Contact Information, Next: Copying This Manual, Prev: speechd-el Elisp Library, Up: Top 4 Contact Information ********************* If you want to report a bug on speechd-el, send complete information regarding the bug to the bug tracking address . If you have a patch to speechd-el, you can send it to the same address. _Please_, before sending us any bug report, read the bug reporting instructions, see *note Bug Reporting::. Thus you allow us to process your bug report more efficiently, resulting in a better response to the report and faster resolving of the issue. If you have any questions, suggestions, or anything else to tell us, feel free to contact us at the e-mail address .  File: speechd-el.info, Node: Copying This Manual, Next: Index, Prev: Contact Information, Up: Top Appendix A Copying Conditions of This Manual ******************************************** * Menu: * GNU Free Documentation License:: * GNU General Public License::  File: speechd-el.info, Node: GNU Free Documentation License, Next: GNU General Public License, Prev: Copying This Manual, Up: Copying This Manual A.1 GNU Free Documentation License ================================== Version 1.2, November 2002 Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements." 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See . Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. A.1.1 ADDENDUM: How to use this License for your documents ---------------------------------------------------------- To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: Copyright (C) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.  File: speechd-el.info, Node: GNU General Public License, Prev: GNU Free Documentation License, Up: Copying This Manual A.2 GNU General Public License ============================== Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble ======== The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS ==================== 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a. The work must carry prominent notices stating that you modified it, and giving a relevant date. b. The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c. You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d. If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a. Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b. Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c. Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d. Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e. Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a. Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b. Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c. Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d. Limiting the use for publicity purposes of names of licensors or authors of the material; or e. Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f. Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS =========================== How to Apply These Terms to Your New Programs ============================================= If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. Copyright (C) YEAR NAME OF AUTHOR 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 . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: PROGRAM Copyright (C) YEAR NAME OF AUTHOR This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free software, and you are welcome to redistribute it under certain conditions; type 'show c' for details. The hypothetical commands 'show w' and 'show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read .  File: speechd-el.info, Node: Index, Prev: Copying This Manual, Up: Top Index ***** [index] * Menu: * appointments: Problems. (line 12) * appointments <1>: Tips. (line 21) * authors: Contact Information. (line 6) * beginning of line: Signalling. (line 24) * Braille functions: Braille Display Keys. (line 30) * Braille keys: Braille Display Keys. (line 6) * BrlAPI: Components. (line 10) * BRLTTY: speechd-el User Manual. (line 19) * BRLTTY <1>: Installation. (line 35) * brltty-authentication-file: Connection Setup. (line 55) * brltty-coding: Connection Setup. (line 60) * brltty-default-host: Connection Setup. (line 45) * brltty-default-port: Connection Setup. (line 49) * brltty-timeout: Connection Setup. (line 73) * brltty-tty: Connection Setup. (line 66) * buffer: Informatory Commands. (line 7) * buffer names: Basic Speaking. (line 23) * buffers: Auto-Reading Buffers. (line 6) * bug reporting: Bug Reporting. (line 6) * bugs: Contact Information. (line 6) * C-e ': Reading Commands. (line 43) * C-e .: Reading Commands. (line 33) * C-e 1: Control Commands. (line 41) * C-e 2: Control Commands. (line 41) * C-e 3: Control Commands. (line 41) * C-e 4: Control Commands. (line 41) * C-e 5: Control Commands. (line 41) * C-e 6: Control Commands. (line 41) * C-e 7: Control Commands. (line 41) * C-e 8: Control Commands. (line 41) * C-e 9: Control Commands. (line 41) * C-e >: Reading Commands. (line 16) * C-e b: Reading Commands. (line 13) * C-e c: Reading Commands. (line 47) * C-e C-a: Connection Voices. (line 30) * C-e C-b k: Braille Display Keys. (line 82) * C-e C-f: Bug Reporting. (line 19) * C-e C-l: Spelling. (line 14) * C-e C-n: Reading Commands. (line 51) * C-e C-p: Reading Commands. (line 54) * C-e C-r: Reading Commands. (line 27) * C-e C-s: Starting Alternative Output. (line 14) * C-e C-x: Other Commands. (line 12) * C-e d .: Parameter Setting Commands. (line 20) * C-e d c: Parameter Setting Commands. (line 26) * C-e d C-v: Parameter Setting Commands. (line 38) * C-e d l: Parameter Setting Commands. (line 16) * C-e d o: Parameter Setting Commands. (line 62) * C-e d p: Parameter Setting Commands. (line 52) * C-e d r: Parameter Setting Commands. (line 46) * C-e d v: Parameter Setting Commands. (line 33) * C-e d V: Parameter Setting Commands. (line 56) * C-e i: Reading Commands. (line 65) * C-e l: Reading Commands. (line 7) * C-e m: Reading Commands. (line 57) * C-e o: Reading Commands. (line 20) * C-e p: Control Commands. (line 24) * C-e q: Control Commands. (line 7) * C-e r: Reading Commands. (line 24) * C-e RET: Reading Commands. (line 60) * C-e s: Control Commands. (line 11) * C-e SPC: Control Commands. (line 29) * C-e w: Reading Commands. (line 30) * C-e x: Control Commands. (line 17) * C-e z: Other Commands. (line 19) * C-e [: Reading Commands. (line 40) * C-e {: Reading Commands. (line 36) * C-x C-c: Other Commands. (line 6) * capital character mode: Parameter Setting Commands. (line 26) * character reading prompts: Reading Commands. (line 69) * coding systems: Informatory Commands. (line 24) * command keys: Basic Speaking. (line 39) * command keys <1>: Basic Speaking. (line 61) * command name: Basic Speaking. (line 64) * connections: Multiple Connections. (line 6) * contact: Contact Information. (line 6) * cursor: Text Properties. (line 6) * cursor movement: Index marking. (line 6) * day in calendar: Tips. (line 15) * debugging: Debugging. (line 6) * delays: Problems. (line 52) * deletions: Basic Speaking. (line 18) * diary: Problems. (line 12) * echoing: Basic Speaking. (line 7) * empty text: Signalling. (line 21) * end of line: Signalling. (line 28) * extensions: Advanced Customization. (line 6) * faces: Text Properties. (line 6) * FDL, GNU Free Documentation License: GNU Free Documentation License. (line 6) * features: Feature List. (line 6) * frame: Informatory Commands. (line 11) * garbage collection: Problems. (line 52) * gc-cons-threshold: Problems. (line 52) * global-speechd-speak-mode: Starting Alternative Output. (line 41) * GPL, GNU General Public License: GNU General Public License. (line 6) * header line: Informatory Commands. (line 14) * hooks: Modes. (line 6) * host: Connection Setup. (line 18) * icons: Signalling. (line 6) * index marking: Index marking. (line 6) * Info: Problems. (line 6) * input method: Informatory Commands. (line 28) * inserted text: Auto-Reading Buffers. (line 6) * ispell: Tips. (line 28) * key map: Keys. (line 6) * keys: Basic Speaking. (line 39) * keys <1>: Basic Speaking. (line 61) * keys <2>: Keys. (line 6) * language: Parameter Setting Commands. (line 16) * language text property: Languages. (line 28) * languages: Languages. (line 6) * line: Signalling. (line 24) * line reading: Basic Speaking. (line 30) * M-x speechd-bug: Bug Reporting. (line 10) * M-x speechd-bug-reproduce: Bug Reporting. (line 18) * M-x speechd-out-disable-driver: Driver Selection. (line 23) * M-x speechd-out-enable-driver: Driver Selection. (line 20) * messages: Basic Speaking. (line 69) * minibuffer: Basic Speaking. (line 34) * minor modes: Starting Alternative Output. (line 28) * minor modes <1>: Modes. (line 6) * mode line: Reading Commands. (line 60) * modes: Informatory Commands. (line 20) * movement: Text Properties. (line 6) * output module: Parameter Setting Commands. (line 62) * parameters: Parameter Setting Commands. (line 6) * parameters <1>: Voices. (line 6) * pause: Control Commands. (line 24) * pitch: Parameter Setting Commands. (line 52) * port: Connection Setup. (line 25) * prefix key: Keys. (line 6) * priorities: Default Priorities. (line 6) * problems: Problems. (line 6) * process: Informatory Commands. (line 32) * punctuation mode: Parameter Setting Commands. (line 20) * rate: Control Commands. (line 41) * rate <1>: Parameter Setting Commands. (line 46) * read-char: Reading Commands. (line 69) * recovery: Other Commands. (line 12) * repeated reading: Problems. (line 38) * repeating: Basic Speaking. (line 69) * resume: Control Commands. (line 29) * RFC 1766: Languages. (line 17) * shutting up: Control Commands. (line 7) * Speech Dispatcher: Installation. (line 32) * speechd-add-connection-settings: Connection Voices. (line 30) * speechd-autospawn: Connection Setup. (line 30) * speechd-braille-key-functions: Braille Display Keys. (line 10) * speechd-braille-show-unknown-keys: Braille Display Keys. (line 70) * speechd-brltty-cancel: Braille Display Keys. (line 44) * speechd-brltty-command-key-function KEY: Braille Display Keys. (line 58) * speechd-brltty-finish-message: Braille Display Keys. (line 42) * speechd-brltty-first-message: Braille Display Keys. (line 51) * speechd-brltty-last-message: Braille Display Keys. (line 53) * speechd-brltty-next-message: Braille Display Keys. (line 49) * speechd-brltty-previous-message: Braille Display Keys. (line 47) * speechd-brltty-scroll-left: Braille Display Keys. (line 30) * speechd-brltty-scroll-right: Braille Display Keys. (line 33) * speechd-brltty-scroll-to-bol: Braille Display Keys. (line 35) * speechd-brltty-scroll-to-cursor: Braille Display Keys. (line 39) * speechd-brltty-scroll-to-eol: Braille Display Keys. (line 37) * speechd-bug: Bug Reporting. (line 11) * speechd-bug-reproduce: Bug Reporting. (line 19) * speechd-cancel: Control Commands. (line 17) * speechd-cancelable-connections: Multiple Connections. (line 49) * speechd-client-name: speechd-el Elisp Library. (line 31) * speechd-connection-method: Connection Setup. (line 12) * speechd-connection-voices: Connection Voices. (line 12) * speechd-default-char-priority: Default Priorities. (line 25) * speechd-default-key-priority: Default Priorities. (line 28) * speechd-default-sound-priority: Default Priorities. (line 22) * speechd-default-text-priority: Default Priorities. (line 19) * speechd-face-voices: Text Properties. (line 46) * speechd-host: Connection Setup. (line 17) * speechd-language: Languages. (line 17) * speechd-language <1>: Languages. (line 28) * speechd-out-active-drivers: Driver Selection. (line 9) * speechd-out-disable-driver: Driver Selection. (line 24) * speechd-out-enable-driver: Driver Selection. (line 21) * speechd-pause: Control Commands. (line 24) * speechd-port: Connection Setup. (line 24) * speechd-repeat: Other Commands. (line 19) * speechd-resume: Control Commands. (line 29) * speechd-say-text: Other Commands. (line 22) * speechd-set-capital-character-mode: Parameter Setting Commands. (line 26) * speechd-set-output-module: Parameter Setting Commands. (line 62) * speechd-set-pitch: Parameter Setting Commands. (line 52) * speechd-set-punctuation-mode: Parameter Setting Commands. (line 20) * speechd-set-rate: Parameter Setting Commands. (line 46) * speechd-set-synthesizer-voice: Parameter Setting Commands. (line 38) * speechd-set-voice: Parameter Setting Commands. (line 33) * speechd-set-volume: Parameter Setting Commands. (line 56) * speechd-speak: Starting Alternative Output. (line 14) * speechd-speak-align-buffer-insertions: Auto-Reading Buffers. (line 55) * speechd-speak-allow-prompt-commands: Reading Commands. (line 85) * speechd-speak-auto-speak-buffers: Auto-Reading Buffers. (line 13) * speechd-speak-buffer-info: Informatory Commands. (line 7) * speechd-speak-buffer-insertions: Auto-Reading Buffers. (line 28) * speechd-speak-buffer-name: Basic Speaking. (line 22) * speechd-speak-by-properties-always: Text Properties. (line 28) * speechd-speak-by-properties-never: Text Properties. (line 32) * speechd-speak-by-properties-on-movement: Text Properties. (line 15) * speechd-speak-coding-info: Informatory Commands. (line 24) * speechd-speak-command-feedback COMMAND POSITION FEEDBACK: Advanced Customization. (line 15) * speechd-speak-connections: Multiple Connections. (line 18) * speechd-speak-deleted-char: Basic Speaking. (line 17) * speechd-speak-display-modes: Reading State. (line 33) * speechd-speak-echo: Basic Speaking. (line 6) * speechd-speak-emacs-language: Languages. (line 50) * speechd-speak-emacs-language <1>: Languages. (line 54) * speechd-speak-faces: Text Properties. (line 36) * speechd-speak-force-auto-speak-buffers: Auto-Reading Buffers. (line 18) * speechd-speak-frame-info: Informatory Commands. (line 11) * speechd-speak-function-feedback FUNCTION POSITION FEEDBACK: Advanced Customization. (line 37) * speechd-speak-header-line-info: Informatory Commands. (line 14) * speechd-speak-ignore-command-keys: Basic Speaking. (line 60) * speechd-speak-in-debugger: Debugging. (line 10) * speechd-speak-index-mark-regexp: Index marking. (line 17) * speechd-speak-input-method-info: Informatory Commands. (line 28) * speechd-speak-input-method-languages: Languages. (line 41) * speechd-speak-insertions-in-buffers: Auto-Reading Buffers. (line 44) * speechd-speak-key-set-predefined-rate: Control Commands. (line 41) * speechd-speak-last-insertions: Reading Commands. (line 65) * speechd-speak-last-insertions <1>: Reading Commands. (line 79) * speechd-speak-last-message: Reading Commands. (line 57) * speechd-speak-last-message <1>: Reading Commands. (line 75) * speechd-speak-message-time-interval: Basic Speaking. (line 68) * speechd-speak-mode: Starting Alternative Output. (line 35) * speechd-speak-mode-hook: Modes. (line 10) * speechd-speak-mode-info: Informatory Commands. (line 20) * speechd-speak-mode-map: Keys. (line 17) * speechd-speak-movement-on-insertions: Auto-Reading Buffers. (line 65) * speechd-speak-on-minibuffer-exit: Basic Speaking. (line 33) * speechd-speak-prefix: Keys. (line 9) * speechd-speak-priority-insertions-in-buffers: Auto-Reading Buffers. (line 49) * speechd-speak-process-info: Informatory Commands. (line 32) * speechd-speak-read-buffer: Reading Commands. (line 13) * speechd-speak-read-char: Reading Commands. (line 47) * speechd-speak-read-command-keys: Basic Speaking. (line 38) * speechd-speak-read-command-name: Basic Speaking. (line 63) * speechd-speak-read-line: Reading Commands. (line 7) * speechd-speak-read-mode-line: Reading Commands. (line 60) * speechd-speak-read-next-line: Reading Commands. (line 51) * speechd-speak-read-other-window: Reading Commands. (line 20) * speechd-speak-read-page: Reading Commands. (line 40) * speechd-speak-read-paragraph: Reading Commands. (line 36) * speechd-speak-read-previous-line: Reading Commands. (line 54) * speechd-speak-read-rectangle: Reading Commands. (line 27) * speechd-speak-read-region: Reading Commands. (line 24) * speechd-speak-read-rest-of-buffer: Reading Commands. (line 16) * speechd-speak-read-sentence: Reading Commands. (line 33) * speechd-speak-read-sexp: Reading Commands. (line 43) * speechd-speak-read-word: Reading Commands. (line 30) * speechd-speak-set-language: Parameter Setting Commands. (line 16) * speechd-speak-signal-events: Signalling. (line 13) * speechd-speak-spell: Spelling. (line 14) * speechd-speak-spell-mode: Spelling. (line 6) * speechd-speak-state-changes: Reading State. (line 11) * speechd-speak-toggle-braille-keys: Braille Display Keys. (line 82) * speechd-speak-toggle-speaking: Control Commands. (line 7) * speechd-speak-use-index-marks: Index marking. (line 12) * speechd-speak-whole-line: Basic Speaking. (line 29) * speechd-stop: Control Commands. (line 11) * speechd-timeout: Connection Setup. (line 36) * speechd-unspeak: Other Commands. (line 12) * speechd-voices: Voices. (line 16) * spelling: Spelling. (line 6) * SSIP: Components. (line 10) * stop: Control Commands. (line 11) * stop <1>: Control Commands. (line 17) * stop <2>: Multiple Connections. (line 50) * suspend-emacs: Advanced Customization. (line 29) * TAB characters: Problems. (line 26) * text properties: Text Properties. (line 6) * timeout: Connection Setup. (line 37) * truncate-lines: Reading Commands. (line 7) * URL speaking: Problems. (line 18) * voice: Parameter Setting Commands. (line 33) * voice <1>: Parameter Setting Commands. (line 38) * voices: Voices. (line 6) * voices <1>: Connection Voices. (line 6) * volume: Parameter Setting Commands. (line 56) * w3m-el: Problems. (line 18)  Tag Table: Node: Top1200 Node: Introduction2687 Node: Design Goals3888 Node: Feature List6188 Node: Components8668 Node: speechd-el User Manual9912 Node: Installation11402 Node: Starting Alternative Output12796 Node: Commands14683 Node: Reading Commands15780 Node: Informatory Commands18304 Node: Control Commands19232 Node: Parameter Setting Commands20745 Node: Spelling23371 Node: Other Commands24006 Node: Customization24678 Node: Driver Selection26029 Node: Connection Setup26900 Node: Default Priorities30372 Node: Basic Speaking31470 Node: Auto-Reading Buffers34350 Node: Reading State37238 Node: Signalling38604 Ref: Signalling-Footnote-139777 Node: Text Properties39883 Node: Index marking42096 Node: Languages43114 Node: Voices45991 Node: Connection Voices48298 Node: Multiple Connections49828 Node: Keys51966 Node: Braille Display Keys52948 Node: Modes56971 Node: Debugging57398 Node: Advanced Customization57839 Node: Problems60128 Node: Tips63367 Node: Bug Reporting64690 Node: speechd-el Elisp Library67751 Node: Contact Information69543 Node: Copying This Manual70336 Node: GNU Free Documentation License70608 Node: GNU General Public License93064 Node: Index130635  End Tag Table  Local Variables: coding: utf-8 End: speechd-el-2.11/dir0000644000175000001440000000123014070023103012630 0ustar pdmusersThis is the file .../info/dir, which contains the topmost node of the Info hierarchy, called (dir)Top. The first time you invoke Info you start off looking at this node.  File: dir, Node: Top This is the top of the INFO tree This (the Directory node) gives a menu of major topics. Typing "q" exits, "H" lists all Info commands, "d" returns here, "h" gives a primer for first-timers, "mEmacs" visits the Emacs manual, etc. In Emacs, you can click mouse button 2 on a menu item or cross reference to select it. * Menu: Emacs * speechd-el: (speechd-el). Emacs interface to Speech Dispatcher and BRLTTY.