speechd-el-2.9/ 0000755 0001750 0001750 00000000000 13612131732 011516 5 ustar pdm pdm speechd-el-2.9/COPYING 0000644 0001750 0001750 00000104513 13612131732 012555 0 ustar pdm pdm 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.9/braille.el 0000644 0001750 0001750 00000010706 13612131732 013456 0 ustar pdm pdm ;;; braille.el --- Simple Emacs braille display emulator
;; Copyright (C) 2004 Brailcom, o.p.s.
;; Copyright (C) 2012 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 .
;;; Commentary:
;;; Code:
(eval-when-compile
(require 'cl))
(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)
(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))))
(suffix " "))
(when cursor-position
(if (= cursor-position 0)
(setq code (cons 8 code)
cursor-position nil)
(decf cursor-position)))
(cl-flet ((display-dot (dot)
(end-of-line)
(insert (if (member dot code) "o" " ") suffix)
(forward-line)))
(goto-char (point-min))
(mapc #'display-dot '(1 2 3 7))
(goto-char (point-min))
(let ((suffix " "))
(mapc #'display-dot '(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.9/speechd-log-extractor 0000644 0001750 0001750 00000002705 13612131732 015650 0 ustar pdm pdm #!/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.9/speechd.el 0000644 0001750 0001750 00000132036 13612131732 013460 0 ustar pdm pdm ;;; speechd.el --- Library for accessing Speech Dispatcher
;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010 Brailcom, o.p.s.
;; Copyright (C) 2012, 2013 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 .
;;; 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:
(eval-when-compile (require 'cl))
(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-spdsend nil
"If string, it names the spdsend binary to be used to talk to SSIP.
If the new version of accept-process-output is available or the value of this
variable is nil, Emacs talks to an SSIP server (Speech Dispatcher) directly."
:type '(choice (const :tag "Don't use spdsend" nil)
(string :tag "spdsend binary"))
: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 (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)))
(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 #'(lambda (name value)
(set-default name value)
(when (fboundp 'speechd-reopen)
(speechd-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 #'(lambda (name value)
(set-default name value)
(when (fboundp 'speechd-reopen)
(speechd-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))
(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")
(output-module . "OUTPUT_MODULE") ; TODO: to be removed sometimes
))
(defconst speechd--list-parameters
'((voices
"VOICES" identity)
(synthesis-voices
"SYNTHESIS_VOICES" (lambda (line) (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"))))
(defconst speechd--volatile-parameters '(output-module))
;;; Internal variables
(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))
(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)
;;; Utilities
(defmacro speechd--iterate-connections (&rest body)
`(maphash #'(lambda (_ connection) ,@body) speechd--connections))
(defmacro speechd--iterate-clients (&rest body)
`(maphash #'(lambda (speechd-client-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 ((connection (speechd--connection)))
(when (and (speechd--connection-failure-p connection)
(>= (- (float-time) (speechd--connection-last-try-time connection))
speechd--retry-time))
(ignore-errors (speechd-reopen t))
(setq connection (speechd--connection)))
(unless (speechd--connection-failure-p 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 connection)))
(while ,$parameters
(let* ((,$p (first ,$parameters))
(,$v (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
(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)))))
(defvar speechd--advanced-apo (condition-case _
(progn
(accept-process-output nil 0 0 1)
t)
(error)))
(defun speechd--call-spdsend (args &optional input)
(with-temp-buffer
(if input
(with-speechd-coding-protection
(insert input)
(let ((default-process-coding-system
(cons speechd--coding-system speechd--coding-system))
(process-coding-system-alist nil))
(apply #'call-process-region (point-min) (point-max)
speechd-spdsend t t nil args)))
(apply #'call-process speechd-spdsend nil t nil args))
(buffer-string)))
(defun speechd--process-filter (process output)
(when speechd--advanced-apo
(speechd--with-current-connection
(setf (speechd--connection-process-output connection)
(concat (speechd--connection-process-output connection) output)))))
(defun speechd--use-spdsend ()
(and (not speechd--advanced-apo) speechd-spdsend))
(defun speechd--open-connection (method host port socket-name)
(if (speechd--use-spdsend)
(let* ((answer (speechd--call-spdsend
(list "--open" host (format "%d" port))))
(alen (and answer (length answer))))
(when (and alen (> alen 1))
(setq answer (substring answer 0 (1- alen))))
answer)
(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
(if speechd--advanced-apo
speechd--coding-system
'raw-text))
(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
(if (speechd--use-spdsend)
(speechd--call-spdsend (list "--close" 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 _
(if (speechd--use-spdsend)
(speechd--call-spdsend (list "--send" process) command)
(process-send-string
process
(if speechd--advanced-apo
command
(encode-coding-string command speechd--coding-system)))
(when speechd--advanced-apo
(while (not (string-match
speechd--end-regexp
(speechd--connection-process-output connection)))
(unless (accept-process-output process speechd-timeout nil 1)
(signal 'ssip-connection-error
"Timeout in communication with Speech Dispatcher"))))
(prog1 (speechd--connection-process-output connection)
(setf (speechd--connection-process-output connection) "")))
(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
(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)
(id (cond
((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)))
((and connection
(not (speechd--connection-failure-p connection)))
(speechd--connection-id connection)))))
(when (or id (not quiet))
(setq connection (make-speechd--connection
:name name :host host :port port :process id))
(puthash name connection speechd--connections))
(when (and (not id) (not quiet))
(speechd--permanent-connection-failure connection)
(signal 'ssip-connection-error connection-error))
(when id
(speechd--set-connection-name name)
(setq parameters (append parameters
(list 'language speechd--default-language)))
(let ((already-set '(client-name)))
(while parameters
(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))
(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)
(incf number-of-connections)
(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-9][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))
(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
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))))
(if (or speechd--advanced-apo (speechd--use-spdsend))
(progn
(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))))
'(t nil nil nil)))))))
(defconst speechd--block-commands
'(("speak")
(".")
("sound_icon")
("char")
("key")
("quit")
("block" ("end"))
("set" ("self" ("rate") ("pitch") ("volume") ("voice") ("language")))))
(defun speechd--block-command-p (command &optional allowed)
(unless allowed
(setq allowed speechd--block-commands))
(let* ((match (assoc (downcase (first command)) allowed))
(rest-allowed (cdr match)))
(and match
(or (not rest-allowed)
(speechd--block-command-p (rest command) rest-allowed)))))
(defun* speechd--send-command (command)
(unless (listp command)
(setq command (list command)))
(speechd--with-current-connection
(when (or (not (speechd--connection-in-block connection))
(speechd--block-command-p command))
(setf (speechd--connection-last-command connection) command)
(speechd--send-request
(make-speechd--request
:string (concat (mapconcat #'identity command " ") speechd--eol))))))
(defun speechd--send-text (text)
(when (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 (memq (char-charset char)
'(eight-bit-control eight-bit-graphic))
(setq text (replace-match (format "\\%o" char) 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 (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)
(multiple-value-bind (command processor)
(cdr (assoc parameter speechd--list-parameters))
(mapcar processor (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 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 connection)))))
(let ((answer (speechd--call-set-parameter parameter value nil)))
(setq connection (speechd--connection))
(when (first answer)
(setf (speechd--connection-parameters connection)
(plist-put (speechd--connection-parameters connection)
parameter value))))
;; Speech Dispatcher bug work-around
(when (eq parameter 'language)
(let ((output-module (plist-get
(speechd--connection-parameters 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))
(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 connection)))
(while connection-parameters
(destructuring-bind (p v . next) connection-parameters
(unless (memq p '(client-name message-priority
spelling-mode))
(push
(cons
(case p
(voice 'name)
(t p))
(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 connection)
(nested (and connection (speechd--connection-in-block connection))))
(speechd--with-connection-parameters parameters
(let ((speechd-client-name (speechd--connection-name connection)))
(unless nested
(speechd--send-command '("BLOCK BEGIN"))
(when connection
(setf (speechd--connection-in-block connection) t)))
(unwind-protect (funcall function)
(unless nested
(let ((connection %block-connection))
(when connection
(setf (speechd--connection-in-block 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
;;;###autoload
(defun* speechd-say-text (text &key (priority speechd-default-text-priority)
say-if-empty)
"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)))
(speechd-block* `(message-priority ,priority
language ,(speechd--current-language)
spelling-mode ,speechd-spell
,@properties)
(speechd--send-text substring))
(setq beg end)))))))
(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)))
(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" (case char
(? "space")
(?\n "linefeed")
(t (char-to-string char)))))))))
(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 (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 connection) t))
(speechd--with-current-connection
(setf (speechd--connection-paused-p 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 connection))
(speechd--control-command "RESUME" (not (not all)))
(if all
(setf (speechd--connection-paused-p connection) nil)
(speechd--iterate-connections
(setf (speechd--connection-paused-p 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 (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.9/dir 0000644 0001750 0001750 00000001230 13612131732 012213 0 ustar pdm pdm This 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.
speechd-el-2.9/speechd-compile.el 0000644 0001750 0001750 00000002310 13612131732 015075 0 ustar pdm pdm ;;; speechd-compile.el --- Maintenance utilities
;; Copyright (C) 2004, 2013 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)
(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.9/ANNOUNCE 0000644 0001750 0001750 00000004211 13612131732 012645 0 ustar pdm pdm speechd-el 2.9 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 its web page, see
http://devel.freebsoft.org/speechd-el .
* What is new in the 2.9 version?
** Bug fixes.
* 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.9/speechd-el-2.9.tar.gz .
The home page of the project is http://devel.freebsoft.org/speechd-el .
Local Variables:
fill-column: 72
End:
speechd-el-2.9/speechd-el.cs.texi 0000644 0001750 0001750 00000162545 13612131732 015043 0 ustar pdm pdm \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 peklad manulu 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 manul?
* Uivatelsk pruka:: Pouvn eovho vstupu Emacsu.
* Elispov knihovna:: Pouvn speechd-el v elispovch programech.
* Kontaktn informace:: Oznamovn chyb atd.
* Koprovn tohoto manulu:: GNU Free Documentation License.
* Index:: Veobjmajc index.
@end menu
@c ****************************************************************************
@node vodem, Uivatelsk pruka, Top, Top
@chapter vodem
@cindex Speech Dispatcher
speechd-el je emacsov klient ke Speech Dispatcher. Poskytuje
nsledujc funkce:
@itemize @bullet
@item
@cindex SSIP
Elispovou knihovnu pro pstup ke Speech Dispatcher s@tie{}vyuitm
soketov komunikace zaloen na jeho komunikanm protokolu (SSIP).
@item
Podporu pro eov vstup Emacsu, zamen zejmna na prostedky
potebn pro vyuvn Emacsu slepmi a tce zrakov postienmi
uivateli.
@end itemize
Klov rysy speechd-el jsou:
@cindex rysy
@itemize @bullet
@item
Podporu pro automatick mluven, bez nutnosti prav kad emacsov
funkce, kterou je poteba rozmluvit. Vtina emacsovch program
z@tie{}distribuce Emacsu i@tie{}mimo ni zskv eov vstup okamit, bez
jakkoliv speciln podpory.
@item
Nejsou provdny tm dn zmny standardnho chovn Emacsu a
nedochz ke konfliktm s@tie{}uivatelskmi nastavenmi.
@item
Pln spoluprce se Speech Dispatcher.
@item
Mal rozsah kdu.
@end itemize
Manul popisuje eov uivatelsk rozhran, jak si toto rozhran
pizpsobit a rozit a elispovou knihovnu. Doporuujeme, aby
uivatel byl sten obeznmen se Speech Dispatcher na uivatelsk
rovni, ale nen to nezbytn.
@c ****************************************************************************
@node Uivatelsk pruka, Elispov knihovna, vodem, Top
@chapter Uivatelsk pruka speechd-el
speechd-el umouje pouvat Emacs bez zobrazen na monitoru, pouze
jen s@tie{}eovm vstupem. Hlavn oblast vyuit je mezi slepci a
zrakov postienmi lidmi, nicmn eov vstup me bt uiten
i@tie{}pro celou adu dalch vc, podle toho co kdo potebuje.
Nejnovj verzi speechd-el si mete sthnout na
@url{http://www.freebsoft.org/pub/projects/speechd-el/}.
speechd-el pouv pro eov vstup Speech Dispatcher, take abyste
vbec njak eov vstup slyeli, potebujete mt funkn instalaci
Speech Dispatcher. Vechny informace o@tie{}Speech Dispatcher naleznete na
@url{http://www.freebsoft.org/speechd}.
@menu
* Instalace:: Jak speechd-el nainstalovat.
* Sputn eovho vstupu:: Jak jej rozmluvit.
* Pkazy:: Jak jej pouvat.
* Konfigurace:: Zkladn konfigurace.
* Pokroil konfigurace:: Psan vlastnch reakc na pkazy.
* Pote:: Kdy se speechd-el chov podivn.
* Tipy:: Uiten emacsov tipy.
* Oznamovn chyb:: Chyby speechd-el a Speech Dispatcher.
@end menu
@node Instalace, Sputn eovho vstupu, Uivatelsk pruka, Uivatelsk pruka
@section Instalace
speechd-el se nainstaluje nsledujcmi kroky:
@enumerate
@item
Zkoprujte vechny @file{*.el} soubory z@tie{}distribunho balku nkam do
emacsovch adres obsaench v@tie{}cest vaeho Emacsu.
@item
Chcete-li, mete si @file{*.el} soubory zkompilovat. To
doporuujeme, protoe speechd-el b se zkompilovanmi soubory
podstatn rychleji. Kompilaci mete provst pkazem
@example
make compile
@end example
Pot piinstalujte zkompilovan soubory do emacsov cesty ke zdrojovm
souborm speechd-el.
@item
Nainstalujte soubor @file{speechd-log-extractor} do nkter
z@tie{}cest obsaench v@tie{}shellov promnn PATH, napklad
do adrese @file{/usr/local/bin/}.
@item
Do svho @file{~/.emacs} si pidejte nsledujc dek:
@lisp
(autoload 'speechd-speak "speechd-speak" nil t)
@end lisp
@end enumerate
Pro spn provoz speechd-el je nutno mt nainstalovan a sputn
Speech Dispatcher. Doporuen je verze@tie{}0.5 nebo vy.
@node Sputn eovho vstupu, Pkazy, Instalace, Uivatelsk pruka
@section Sputn eovho vstupu
Po instalaci @file{*.el} soubor a restartu Emacsu mete
inicializovat eov vstup prostednictvm pkazu @kbd{M-x
speechd-speak}. Chcete-li, aby se tak dlo automaticky pi kadm
startu Emacsu, pidejte si do svho @file{~/.emacs} nsledujc
dek, za dve vloen 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 eov vstup a zani mluvit.
Prosm nezapomete, e abyste nco slyeli, muste mt korektn
nainstalovno Speech Dispatcher!
Po potenm nastaven me bt tento pkaz pouit znovu, v@tie{}ppad
poteby restartu eov podpory. Zejmna jej muste spustit pokad,
kdy je restartovno Speech Dispatcher.
Je-li pkaz zavoln s@tie{}prefixovm argumentem, jsou ped jeho
provedenm nejprve uzavena vechna spojen na Speech Dispatcher. To
je uiten v@tie{}ppad, kdy potebujete zresetovat parametry vech
spojen, viz @ref{Hlasy spojen}.
Po svm prvnm zavoln se pkaz stane dostupnm pod klvesou
@kbd{C-e C-s}.
@end table
@cindex vedlej mdy
Pot, co jsou provedena vodn nastaven, je zapnn a vypnn
eovho vstupu zeno vedlejmi mdy speechd-speak a
global-speechd-speak. Pkazy pro pepnn md obvykle nejsou
pouvny pmo, mete msto nich pouvat pkaz
@code{speechd-speak-toggle-speaking} (@pxref{dc pkazy}), ale
pokud je potebujete, jsou k@tie{}dispozici.
@table @kbd
@item M-x speechd-speak-mode
@findex speechd-speak-mode
Zapni nebo vypni mluven v@tie{}aktulnm bufferu. Je-li pkaz zavoln
bez prefixovho argumentu, pepne mluvc md. 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 globln. Je-li pkaz zavoln
bez prefixovho argumentu, pepne mluvc md. S@tie{}prefixovm
argumentem zapne mluven prv v@tie{}ppad, kdy je tento argument kladn.
@end table
@node Pkazy, Konfigurace, Sputn eovho vstupu, Uivatelsk pruka
@section Pkazy
Vechny zkladn pkazy speechd-el jsou dostupn pod spolenou
prefixovou klvesou, kterou je implicitn @kbd{C-e} (tuto prefixovou
klvesu lze zmnit, @pxref{Konfigurace}). Jestlie je prefixov
klvesa v@tie{}konfliktu s@tie{}nkterm globlnm pkazem Emacsu, pvodn
pkaz je dostupn dvojm stiskem prefixov klvesy. Napklad
v@tie{}ppad implicitnho prefixu lze pkaz @code{end-of-line}, normln
dostupn pod klvesou @kbd{C-e}, vyvolat klvesovou kombinac @kbd{C-e
C-e}.
@menu
* Pkazy pro ten:: ten st textu.
* Informujc pkazy:: Informace o bufferu, mdech, apod.
* dc pkazy:: Peruen, nastaven rychlosti, apod.
* Pkazy nastavujc parametry:: Modifikace eovho vstupu.
* Hlskovn:: Jak hlskovat urit text.
* Ostatn pkazy:: Pomocn pkazy.
@end menu
@node Pkazy pro ten, Informujc pkazy, Pkazy, Pkazy
@subsection Pkazy pro ten
@table @kbd
@item C-e l
@kindex C-e l
@findex speechd-speak-read-line
Peti aktuln dek (@code{speechd-speak-read-line}).
S@tie{}prefixovm argumentem peti dek jen od aktuln pozice
kurzoru do konce dku.
@item C-e b
@kindex C-e b
@findex speechd-speak-read-buffer
Peti aktuln buffer (@code{speechd-speak-read-buffer}).
@item C-e >
@kindex C-e >
@findex speechd-speak-read-rest-of-buffer
Peti aktuln 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
Peti buffer v@tie{}jinm okn, je-li njak jin okno oteven
(@code{speechd-speak-read-other-window}).
@item C-e r
@kindex C-e r
@findex speechd-speak-read-region
Peti aktuln oblast (@code{speechd-speak-read-region}).
@item C-e C-r
@kindex C-e C-r
@findex speechd-speak-read-rectangle
Peti text v@tie{}obdlnkov oblasti (@code{speechd-speak-read-rectangle}).
@item C-e w
@kindex C-e w
@findex speechd-speak-read-word
Peti nejbli slovo za kurzorem (@code{speechd-speak-read-word}).
@item C-e .
@kindex C-e .
@findex speechd-speak-read-sentence
Peti aktuln vtu (@code{speechd-speak-read-sentence}).
@item C-e @{
@kindex C-e @{
@findex speechd-speak-read-paragraph
Peti nejbli odstavec za kurzorem (@code{speechd-speak-read-paragraph}).
@item C-e [
@kindex C-e [
@findex speechd-speak-read-page
Peti nejbli strnku za kurzorem (@code{speechd-speak-read-page}).
@item C-e '
@kindex C-e '
@findex speechd-speak-read-sexp
Peti nejbli symbolick vraz za kurzorem
(@code{speechd-speak-read-sexp}).
@item C-e c
@kindex C-e c
@findex speechd-speak-read-char
Peti 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
Peti nsledujc dek (@code{speechd-speak-read-next-line}).
@item C-e C-p
@kindex C-e C-p
@findex speechd-speak-read-previous-line
Peti pedchoz dek (@code{speechd-speak-read-previous-line}).
@item C-e m
@kindex C-e m
@findex speechd-speak-last-message
Peti posledn zobrazen hlen Emacsu (@code{speechd-speak-last-message}).
@item C-e RET
@cindex mode line
@kindex C-e RET
@findex speechd-speak-read-mode-line
Peti mode line (@code{speechd-speak-read-mode-line}). Poznmka:
Tento pkaz funguje jen v@tie{}Emacsu verze 21.4 nebo vy.
@item C-e i
@kindex C-e i
@findex speechd-speak-last-insertions
Peti posledn peten vloen text
(@code{speechd-speak-last-insertions}). To znamen text peten
v@tie{}automaticky mluvcch bufferech, viz @xref{Automatick mluven
buffer}.
@end table
@cindex prompty poadujc znak
@cindex read-char
Nkter pkazy Emacsu vypisuj prompt, po kterm ekaj na zadan
znak. Typickm pkladem je pkaz @code{ispell-word}. Pokud
zmekte pedtm peten text, mete pro jeho zopakovn pout ve
znakovm promptu nsledujc klvesov pkazy:
@table @kbd
@item C-e
@findex speechd-speak-last-message
Ten sam pkaz jako @kbd{C-e m} ve
(@code{speechd-speak-last-message}).
@item C-a
@findex speechd-speak-last-insertions
Ten sam pkaz jako @kbd{C-e i} ve
(@code{speechd-speak-last-insertions}).
@end table
Pokud se vm takov chovn znakovho promptu nezamlouv, mete jej
deaktivovat pomoc nsledujc promnn:
@vtable @code
@item speechd-speak-allow-prompt-commands
Je-li hodnotou promnn nco jinho ne @code{nil}, povol ve znakovch
promptech ve uveden klvesov pkazy.
@end vtable
@node Informujc pkazy, dc pkazy, Pkazy pro ten, Pkazy
@subsection Informujc pkazy
@table @kbd
@item C-e C-i b
@findex speechd-speak-buffer-info
@cindex buffer
Peti informace o@tie{}aktulnm bufferu
(@code{speechd-speak-buffer-info}).
@item C-e C-i f
@findex speechd-speak-frame-info
@cindex frame
Peti informace o@tie{}aktulnm frame
(@code{speechd-speak-frame-info}).
@item C-e C-i h
@findex speechd-speak-header-line-info
@cindex header line
Peti obsah header line (@code{speechd-speak-header-line-info}).
Poznmka: Tento pkaz funguje jen v@tie{}Emacsu verze 21.4 nebo vy.
@item C-e C-i m
@findex speechd-speak-mode-info
@cindex mdy
Peti informace o@tie{}aktulnm hlavnm a vedlejm mdu
(@code{speechd-speak-mode-info}).
@item C-e C-i c
@findex speechd-speak-coding-info
@cindex systmy kdovn
Peti informaci o@tie{}aktulnm systmu kdovn
(@code{speechd-speak-coding-info}).
@item C-e C-i i
@findex speechd-speak-input-method-info
@cindex vstupn metoda
Peti informaci o@tie{}aktuln vstupn metod
(@code{speechd-speak-input-method-info}).
@item C-e C-i p
@findex speechd-speak-process-info
@cindex proces
Peti stav procesu asociovanho s@tie{}aktulnm bufferem
(@code{speechd-speak-process-info}).
@end table
@node dc pkazy, Pkazy nastavujc parametry, Informujc pkazy, Pkazy
@subsection dc pkazy
@table @kbd
@item C-e q
@kindex C-e q
@findex speechd-speak-toggle-speaking
@cindex ztien
Globln pepni mluven (@code{speechd-speak-toggle-speaking}). Pi
vyvoln s@tie{}prefixovm argumentem pepni mluven pouze v@tie{}aktulnm
bufferu.
@item C-e s
@kindex C-e s
@findex speechd-stop
@cindex zastaven
Zastav mluven aktuln zprvy (@code{speechd-stop}). Ostatn zprvy
ve front Speech Dispatcher budou normln pemluveny. Je-li pkaz
vyvoln s@tie{}prefixovm argumentem, zastav mluven aktuln zprvy
u@tie{}vech klient, nejen aktulnho spojen.
@item C-e x
@kindex C-e x
@findex speechd-cancel
@cindex zastaven
Zastav mluven vech zprv ve front aktulnho spojen. Je-li pkaz
vyvoln s@tie{}univerzlnm prefixovm argumentem, zastav ten vech
zprv ve vech spojench. Je-li pkaz vyvoln s@tie{}selnm
prefixovm argumentem, zastav mluven vech zprv v@tie{}Emacsu, ve
kterm byl pkaz vyvoln.
@item C-e p
@kindex C-e p
@findex speechd-pause
@cindex peruen
Peru mluven --- prozatm ztichni a odlo mluven aktuln zprvy a
do vyvoln pkazu pokraovn v@tie{}mluven
(@code{speechd-pause}). Je-li pkaz vyvoln s@tie{}prefixovm
argumentem, peru mluven u@tie{}vech klient.
@item C-e SPC
@kindex C-e SPC
@findex speechd-resume
@cindex pokraovn
Pokrauj v@tie{}pozastavenm mluven (@code{speechd-resume}). Je-li
pkaz vyvoln s@tie{}prefixovm argumentem, pokrauj v@tie{}mluven
u@tie{}vech 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{}pednastavench rychlost mluven
(@code{speechd-speak-key-set-predefined-rate}). @kbd{C-e 1} nastav
nejni rychlost, @kbd{C-e 5} nastav stedn rychlost a @kbd{C-e 9}
nastav nejvy rychlost.
@end table
@node Pkazy nastavujc parametry, Hlskovn, dc pkazy, Pkazy
@subsection Pkazy pro nastaven parametr
@cindex parametry
Tyto pkazy nastavuj rzn vlastnosti eovho vstupu. Vechny
jsou aplikovny pouze na aktuln spojen do Speech Dispatcher (vce
informac o@tie{}spojench do Speech Dispatcher naleznete
v@tie{}@pxref{Hlasy spojen}), pokud nejsou vyvolny
s@tie{}prefixovm argumentem. Pi vyvoln s@tie{}selnm prefixovm
argumentem jsou aplikovny na vechna spojen speechd-el, pi vyvoln
s@tie{}univerzlnm prefixovm argumentem jsou aplikovna na vechna
spojen Speech Dispatcher.
Chcete-li si pro konkrtn buffer vytvoit zvltn spojen, kter m
sv vlastn parametry, mete tak uinit nsledujcm pkazem:
@table @kbd
@item C-e C-c
@kindex C-e C-c
@findex speechd-speak-new-connection
@cindex spojen
Nastav pro aktuln buffer dan spojen
(@code{speechd-speak-new-connection}). Pkaz se zept na jmno
spojen, mete zadat bu nov jmno, nebo jmno ji existujcho
spojen. Pi obyejnm vyvoln pkazu je vm nabdnuto nov
vygenerovan jmno spojen, zatmco pi vyvoln pkazu s@tie{}prefixovm
argumentem si mete vybrat z@tie{}nabdnutch jmen existujcch spojen.
@end table
Pkazy ovlivujc zkladn parametry pevodu 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 kd jazyka dle ISO 639.
@item C-e d .
@kindex C-e d .
@findex speechd-set-punctuation-mode
@cindex interpunkce
Uri, jak zpracovvat interpunkci, zda ji st i ignorovat.
@code{all} znamen st vechny interpunkn znaky, @code{none} je
vechny peskakuje a @code{some} te zadanou podmnoinu interpunknch
znak zadanch v@tie{}konfiguraci Speech Dispatcher.
@item C-e d c
@kindex C-e d c
@findex speechd-set-capital-character-mode
@cindex velk psmena
Nastav md signalizace velkch psmen. @code{icon} znamen
signalizaci zvukovou ikonou, @code{spell} znamen jejich hlskovn
prostednictvm speciln hlskovac tabulky a @code{none} znamen, e
velk psmena nejsou nijak zvlṻ signalizovna.
@end table
Pkazy ovlivujc vlastnosti eovho vstupu:
@table @kbd
@item C-e d v
@kindex C-e d v
@findex speechd-set-voice
@cindex hlas
Nastav implicitn hlas, kter m syntetizr pouvat
(@code{speechd-set-voice}). Mete si vybrat nkter z@tie{}mnoiny
hlas nabzench 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
radji pouvat pkaz @code{speechd-speak-key-set-predefined-rate},
dostupn na klvese @kbd{C-e @var{number}}, viz @ref{dc pkazy}.
@item C-e d p
@kindex C-e d p
@findex speechd-set-pitch
@cindex vka
Nastav vku 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
Pkazy ovlivujc eov syntetizr:
@table @kbd
@item C-e d o
@kindex C-e d o
@findex speechd-set-output-module
@cindex vstupn modul
Pepni Speech Dispatcher na zadan vstupn modul
(@code{speechd-set-output-module}). Pkaz se dotazuje na jmno
danho vstupnho modulu.
@end table
@node Hlskovn, Ostatn pkazy, Pkazy nastavujc parametry, Pkazy
@subsection Hlskovn
@cindex hlskovn
@cindex speechd-speak-spell-mode
Hlskovat lze ve speechd-el dvma zpsoby. Prvnm je zapnout pro dan
buffer vedlej md @code{speechd-speak-spell-mode}. Tento md je
uiten, pokud chcete hlskovat vt mnostv textu v@tie{}bufferu.
Druhm zpsobem hlskovn je vyuit nsledujcho pkazu:
@table @kbd
@item C-e C-l
@kindex C-e C-l
@findex speechd-speak-spell
Pinu nsledujc pkaz hlskovat jm ten text
(@code{speechd-speak-spell}). Napklad pokud chcete hlskovat slovo
za kurzorem, mete pout klvesov pkaz @kbd{C-e C-l C-e w}.
@end table
@node Ostatn pkazy, , Hlskovn, Pkazy
@subsection Ostatn pkazy
@kindex C-x C-c
V@tie{}ppad, e se Emacs pln zblzn a odmt kvli chyb speechd-el
nebo uivatelsk definici souvisejc s@tie{}eovm vstupem provdt
jakkoliv pkazy vetn @kbd{C-x C-c}, mete jako posledn pokus
o@tie{}pomoc vyzkouet nsledujc pkaz:
@table @kbd
@item C-e C-x
@kindex C-e C-x
@findex speechd-unspeak
@cindex vzpamatovn se
Pokus se deaktivovat vechny mdy, hky a oblky instalovan pkazem
@code{speechd-speak} (@code{speechd-unspeak}).
@end table
Nsledujc pkazy jsou pouvny jen velmi zdka, povtinou pro
ladc 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 pemluv jej.
@end table
@node Konfigurace, Pokroil konfigurace, Pkazy, Uivatelsk pruka
@section Konfigurace
@menu
* Konfigurace serveru:: Kam se pipojit.
* Implicitn priority:: Priority rznch druh zprv.
* Zkladn mluven:: Jednoduch volby.
* Automatick mluven buffer:: Jak nkter buffery rozmluvit ihned.
* Oznamovn stavu:: Pekvn zmn stavu Emacsu.
* Signalizace:: Signalizace przdnch zprv, apod.
* Vlastnosti textu:: Podpora faces a zvltnch st textu.
* Jazyky:: Pouvn vce jazyk.
* Hlasy:: Definice rznch hlas.
* Hlasy spojen:: Nastavovn parametr spojen.
* Vce spojen:: Odlin parametry pro nkter mdy a buffery.
* Klvesy:: Pizpsoben pkazovch klves.
* Mdy:: Hky vedlejch md.
* Debugger:: Potlaen mluven v@tie{}debuggeru.
@end menu
@node Konfigurace serveru, Implicitn priority, Konfigurace, Konfigurace
@subsection Konfigurace spojen na Speech Dispatcher server
Nastaven tchto promnnch umouje se pipojit na Speech Dispatcher
bc na vzdlenm stroji nebo nestandardnm portu.
@vtable @code
@item speechd-host
@cindex server
Jmno serveru, na kterm b Speech Dispatcher, ke ktermu se chcete
pipojit, zadan jako etzec. Implicitn hodnotou je hodnota
shellov promnn @code{SPEECHD_HOST}, pokud je nastavena, jinak
@code{"localhost"}.
@item speechd-port
@cindex port
slo portu, na kter se chcete pipojit. Implicitn hodnotou je
hodnota shellov promnn @code{SPEECHD_PORT}, pokud je nastavena,
jinak obvykl slo portu Speech Dispatcher.
@item speechd-timeout
@cindex timeout
Maximln poet sekund, po kter se m ekat na odpov od Speech
Dispatcher. Je-li tento as pekroen, speechd-el uzave pslun
spojen. Za normlnch okolnost by Speech Dispatcher mlo odpovdat
na pkazu protokolu okamit, avak pokud se pipojujete na Speech
Dispatcher njakm zvltnm zpsobem po pomal sti, mete
potebovat tento limit zvit.
@item speechd-spdsend
@cindex spdsend
Je-li hodnotou promnn nco jinho ne @code{nil}, mus to bt
etzec urujc jmno binrky @emph{spdsend} (obvykle
@code{"spdsend"}), kter m bt pouita pro komunikaci se Speech
Dispatcher. Je-li hodnotou promnn @code{nil} nebo pokud je verze
Emacsu vy ne 21.3, spdsend se nepouv.
O@tie{}hodnotu tto promnn se obvykle nemuste starat.
@end vtable
@node Implicitn priority, Zkladn mluven, Konfigurace serveru, Konfigurace
@subsection Implicitn priority
@cindex priority
Pole-li njak funkce speechd-el na Speech Dispatcher zprvu bez
explicitn specifikovan priority dan zprvy, piad se zprv
priorita dle obsahu ne uvedench promnnch. Zmnou jejich hodnot
mete doshnout zajmavch efekt. Napklad zmnou hodnoty promnn
@code{speechd-default-key-priority} z@tie{}@code{notification} na
@code{message} zadte, e vechny napsan znaky budou eeny a budou
peruovat obvykl ten text.
Vechny tyto promnn mohou nabvat nkter z@tie{}nsledujcch hodnot:
@code{important}, @code{message}, @code{text}, @code{notification},
@code{progress}. Tyto hodnoty odpovdaj prioritm Speech Dispatcher,
vce podrobnost naleznete v@tie{}manulu Speech Dispatcher.
@vtable @code
@item speechd-default-text-priority
Implicitn priorita vtiny textovch zprv.
@item speechd-default-sound-priority
Implicitn priorita zvukovch ikon.
@item speechd-default-char-priority
Implicitn priorita hlskovanch znak.
@item speechd-default-key-priority
Implicitn priorita znak napsanch na klvesnici.
@end vtable
@node Zkladn mluven, Automatick mluven buffer, Implicitn priority, Konfigurace
@subsection Zkladn konfigurace mluven
@vtable @code
@item speechd-speak-deleted-char
@cindex mazn
Uruje, kter znak m bt peten pi mazn znaku. Je-li hodnotou
nco jinho ne @code{nil}, peti smazan znak, jinak peti sousedn
znak.
@item speechd-speak-buffer-name
@cindex buffery
Pepnte-li se do jinho bufferu a hodnotou tto promnn je nco
jinho ne @code{nil}, je peteno jmno novho bufferu. Je-li
hodnotou promnn symbol @code{text}, te se krom jmna bufferu jet
text jeho dku od pozice kurzoru do konce dku. Je-li hodnotou
promnn @code{nil}, je peten jen text, beze jmna bufferu.
@item speechd-speak-whole-line
@cindex ten dk
Je-li hodnotou promnn nco jinho ne @code{nil}, ti pi pesunu 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 promnn nco jinho ne @code{nil}, speechd-el te
po nvratu z@tie{}minibufferu nebo rekurzivn editan rovn text
okolo kurzoru, nen-li ke ten nic lepho.
@item speechd-speak-read-command-keys
@cindex pkazov klvesy
@cindex klvesy
Tato promnn definuje, v@tie{}jakch situacch jsou teny pkazov
klvesy aktulnho pkazu. Je-li hodnotou promnn @code{t},
pkazov klvesy jsou teny vdy. Je-li hodnotou promnn
@code{nil}, nejsou teny nikdy. Je-li hodnotou promnn seznam, me
obsahovat jeden nebo vce z@tie{}nsledujcch symbol
identifikujcch situace, za kterch maj bt klvesy pkazu
peteny:
@table @code
@item movement
Peti pkazov klvesy, jestlie dolo k@tie{}pesunu kurzoru, ale
nebyl modifikovn obsah bufferu.
@item modification
Byl modifikovn obsah bufferu, nedolo k@tie{}pesunu kurzoru.
@item movement-modification
Byl modifikovn obsah bufferu a dolo k@tie{}pesunu kurzoru.
@end table
Je-li hodnotou promnn @code{t}, pkazov klvesy jsou teny ped
provedenm pkazu. Jinak jsou pekny a po proveden pkazu,
protoe je teba nejprve zjistit, zda dolo k@tie{}modifikaci obsahu
bufferu a pesunu kurzoru.
@item speechd-speak-ignore-command-keys
@cindex pkazov klvesy
@cindex klvesy
Seznam pkaz, u@tie{}nich nemaj bt pkazov klvesy nikdy teny.
@item speechd-speak-read-command-name
@cindex jmno pkazu
Je-li hodnotou nco jinho ne @code{nil}, ti v@tie{}situacch
definovanch promnnou @code{speechd-speak-read-command-keys} msto
klves pkazu jeho jmno.
@item speechd-speak-message-time-interval
@cindex hlen
@cindex opakovn
Minimln poet vtein, po kterch sm bt hlen zopakovno. Je-li
aktuln hlen stejn jako hlen pedchoz, nen pekno, pokud
neuplynul aspo zde definovan as od poslednho pekanho hlen.
@end vtable
@node Automatick mluven buffer, Oznamovn stavu, Zkladn mluven, Konfigurace
@subsection Automatick mluven buffer
@cindex buffery
@cindex vkldan text
Nkdy je uiten zat pemlouvat obsah bufferu i@tie{}bez explicitnho
poadavku uivatele. Napklad je-li vyvoln pkaz npovdy,
uivatel si obvykle chce ihned pot pest jej text. Nsledujc
promnn definuj seznam jmen buffer, kter maj bt automaticky
pemluveny, jestlie jsou viditeln v@tie{}nkterm z@tie{}oken aktulnho rmce
a jejich obsah byl bhem poslednho uivatelskho pkazu zmnn.
@vtable @code
@item speechd-speak-auto-speak-buffers
Obsah tchto buffer je pemluven za ve uvedench podmnek po
proveden pkazu, jestlie nen k@tie{}pemluven nic jinho (napklad
pod kurzorem pi pesunu 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 pemluven vynucen, i@tie{}kdy by mohlo bt pemluveno nco
jinho.
@end vtable
Nsledujc promnn uruj, jak nakldat s@tie{}texty vloenmi bhem
provdn uivatelskch pkaz. Tkaj se pouze nov vloench
text, neovlivuj zpracovn smazanch text. Navc tyto volby
neovlivuj texty vloen bhem provdn pkaz, kter speechd-el
anebo uivatelsk definice zpracovvaj specilnm zpsobem, jako je
napklad ppad pkazu @code{self-insert-command}.
@vtable @code
@item speechd-speak-buffer-insertions
Uruje, zda m bt automaticky ten text vkldan v@tie{}aktulnm bufferu.
Hodnotou promnn me bt nkter z@tie{}nsledujcch symbol:
@table @code
@item nil
Neti dn vloen texty.
@item t
ti vechny vloen texty.
@item one-line
ti pouze prvn dky vloench text.
@item whole-buffer
Pokud byl buffer jakkoliv modifikovn, peti jej cel.
@end table
@item speechd-speak-insertions-in-buffers
Seznam jmen buffer, ve kterch jsou vkldan texty teny automaticky,
bez ohledu na to, zda jde o@tie{}aktuln buffer a bez ohledu na hodnotu
promnn @code{speechd-speak-buffer-insertions}.
@item speechd-speak-priority-insertions-in-buffers
Seznam jmen buffer, ve kterch jsou vkldan texty teny automaticky
okamit po svm vloen, ne a po dokonen provdnho pkazu, jako
je tomu v@tie{}ppad promnn @code{speechd-speak-insertions-in-buffers}.
Tato vlastnost je typicky uiten v@tie{}comint bufferech.
@item speechd-speak-align-buffer-insertions
Je-li hodnotou promnn nco jinho ne @code{nil}, je vkldan text
ped svm petenm rozen k@tie{}zatku prvnho slova, kter je alespo
zsti obsaeno ve vloenm textu. To je uiten zejmna v@tie{}ppad
doplovacch funkc.
@end vtable
Jestlie pkaz modifikoval aktuln buffer a pesunul kurzor na pln
jinou pozici, nov pozice kurzoru nen v@tie{}eovm vstupu
nijak vyznaena. To lze zmnit prostednictvm nsledujc promnn:
@vtable @code
@item speechd-speak-movement-on-insertions
Je-li hodnotou promnn @code{t}, peti text okolo nov pozice
kurzoru, i@tie{}kdy byl aktuln buffer modifikovn. Je-li hodnotou
promnn @code{read-only}, ti jej jen v@tie{}read-only bufferech.
Je-li hodnotou @code{nil}, neti jej.
@end vtable
@node Oznamovn stavu, Signalizace, Automatick mluven buffer, Konfigurace
@subsection Oznamovn zmn stavu
speechd-el me st informaci o@tie{}aktulnm stavu Emacsu, jako
jmno aktulnho bufferu, hlavn a vedlej mdy nebo jin atributy
bufferu, viz @xref{Informujc pkazy}. Zmny stavu Emacsu mohou bt
oznamovny automaticky, v@tie{}zvislosti na uivatelsk konfiguraci:
@vtable @code
@item speechd-speak-state-changes
Seznam identifiktor zmn stavu Emacsu, kter maj bt automaticky
oznamovny. Jako identifiktory zmny stavu lze pout nsledujc
symboly:
@table @code
@item buffer-name
@item buffer-identification
(jen v@tie{}Emacsu 21.4 nebo vym)
@item buffer-modified
@item buffer-read-only
@item frame-name
@item frame-identification
(jen v@tie{}Emacsu 21.4 nebo vym)
@item header-line
(jen v@tie{}Emacsu 21.4 nebo vym)
@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 vedlejch md, u@tie{}nich je msto jejich jmna pekvn
jejich zobrazen etzec. To me bt uiten v@tie{}ppadech, kdy
je zobrazen etzec strunj ne jmno mdu nebo kdy je zobrazen
etzec zmnn, ani by byl zmnn samotn md.
@end vtable
@node Signalizace, Vlastnosti textu, Oznamovn stavu, Konfigurace
@subsection Signalizace
Nkter situace mohou bt signalizovny zvukovmi ikonami.
Nsledujc promnn zapn nebo vypn peddefinovan signalizace.
O@tie{}tom, jak si definovat vlastn signalizace, se mete dost
v@tie{}sekci @ref{Pokroil konfigurace}.
@vtable @code
@item speechd-speak-signal-events
Seznam symbol, obsahujc jmna udlost, kter maj bt
signalizovny zvukovou ikonou. Podporovna jsou nsledujc jmna
udlost:
@table @code
@item start
Start nebo restart speechd-el.
@item empty
@cindex przdn text
Przdn text v@tie{}rznch situacch.
@item beginning-of-line
@cindex dek
@cindex zatek dku
Dosaen zatku dku po pkazech @code{forward-char} a
@code{backward-char}.
@item end-of-line
@cindex konec dku
Dosaen konce dku po pkazech @code{forward-char} a
@code{backward-char}.
@item minibuffer
Vstup do minibufferu.
@item message
Nsleduj hlen 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 chovn speechd-el je takov, e po pkazu, kter zpsob
pesun kurzoru na jinou pozici, pete aktuln dek. Pokud je vak
pozice kurzoru obklopena textem, kter m njak vlastnosti (text
properties), typicky face, ale me jt o@tie{}jakkoliv jin vlastnosti,
speechd-el dovede pest pouze tu st textu pod kurzorem, kter m
shodn vlastnosti.
Pokud je navc zapnut font lock md, faces mohou bt mapovny na rzn
hlasy.
@vtable @code
@item speechd-speak-by-properties-on-movement
Metoda vbru sti textu, kter m bt petena po pesunu kurzoru.
Promnn me nabvat nkter z@tie{}nsledujcch hodnot:
@table @asis
@item @code{nil}
Vlastnosti textu (text properties) nejsou nijak zohledovny.
@item @code{t}
Jsou zohledovny vechny vlastnosti textu.
@item seznam faces
Z@tie{}vlastnost textu jsou zohledovna pouze dan faces.
@end table
@item speechd-speak-by-properties-always
Seznam pkaz, kter vdy zohleduj vlastnosti textu, a@tie{}to
i@tie{}v@tie{}ppad e hodnota promnn
@code{speechd-speak-by-properties-on-movement} je @code{nil}.
@item speechd-speak-by-properties-never
Seznam pkaz, kter nikdy nezohleduj vlastnosti textu, a@tie{}to ani
v@tie{}ppad e hodnota promnn
@code{speechd-speak-by-properties-on-movement} nen @code{nil}.
@item speechd-speak-faces
Tato promnn umouje zajistit vyvoln akc v@tie{}ppad, kdy kurzor po
proveden uivatelskho pkazu skon na uritm face. Hodnotou
promnn je asociativn seznam s@tie{}prvky tvaru @code{(@var{face}
. @var{akce})}.
Jestlie pkaz pesouvajc kurzor zanech kurzor na @var{face} a na
pkaz nen explicitn naveno dn mluven, je vyvolna
@var{akce}. Je-li @code{akce} etzcem, je tento etzec pemluven.
Je-li @code{akce} funkc, je tato funkce zavolna, bez argument.
@item speechd-face-voices
Mapovn faces na hlasy. Hodnotou promnn je asociativn seznam
s@tie{}prvky tvaru @code{(@var{face} . @var{hlas})}, kde @var{face} je face
a @var{hlas} je jmno hlasu definovan v@tie{}promnn
@code{speechd-voices}, viz @xref{Hlasy}. Kad face je pemluveno
odpovdajcm hlasem. Pokud pro njak face nen hlas v@tie{}tto promnn
definovat, je toto face pemluveno aktulnm hlasem.
Pozor, toto mapovn se uplatn jen tehdy, je-li zapnut font lock md.
@end vtable
@node Jazyky, Hlasy, Vlastnosti textu, Konfigurace
@subsection Pouvn vce jazyk
@cindex jazyky
speechd-el je mono pouvat s@tie{}vcero jazyky. Nicmn proces
volby jazyka neme bt snadno automatizovno, protoe bn text
neobsahuje dnou informaci o@tie{}svm jazyce. Take pokud chcete
pouvat speechd-el s@tie{}vstupem ve vce jazycch, muste
speechd-el napovdat.
@vindex speechd-language
@cindex RFC 1766
Zkladnm prostedkem pro sdlen informace o@tie{}aktulnm jazyku je
promnn @code{speechd-language}. Pokad, kdy chce speechd-el ct
njak text, podv se na tuto promnnou, zda neobsahuje kd jazyka.
Pokud jej hodnota nen @code{nil}, mus to bt etzec obsahujc kd
jazyka dle RFC@tie{}1766 a speechd-el pete text v@tie{}odpovdajcm
jazyce.
Vtinou asi budete chtt nastavit tuto promnnou v@tie{}konkrtnm
souboru, viz @ref{File Variables,,,emacs,GNU Emacs Manual}, nebo jako
lokln promnnou bufferu, viz @ref{Locals,,,emacs,GNU Emacs Manual},
v@tie{}rznch mode hooks, see @ref{Hooks,,,emacs,GNU Emacs Manual}.
@findex speechd-language
@cindex text property @code{language}
Pokud m text vlastnost (property) @code{language} obsahujc kd
jazyka dle RFC@tie{}1766, je pemluven v@tie{}odpovdajcm jazyce bez
ohledu na vechna ostatn nastaven. K@tie{}dispozici je funkce
@code{speechd-language}, kter v@tie{}elispovch programech umst
tuto textovou vlastnost na etzec.
Jinou dobrou cestou, jak pouvat vce jazyk, je pouvat vce
spojen pro oddlen jazykov zvislch buffer nebo md, viz
@ref{Vce spojen}, a nastavit pro kad z@tie{}tchto spojen
parametr @code{language}, viz @ref{Hlasy spojen}.
Pokud u nen mon dn lep cesta, je mon jazyky nastavovat
podle aktuln vstupn metody:
@vtable @code
@item speechd-speak-input-method-languages
Asociativn seznam mapujc vstupn metody na jazyky. Kad
z@tie{}prvk seznamu m podobu @code{(@var{input-method-name} .
@var{language})}, kde @var{input-method-name} je jmno metody jako
etzec a @var{language} je ISO kd jazyka akceptovan SSIP. Jestlie
je aktuln vstupn metoda v@tie{}seznamu ptomna, je vybrn
odpovdajc jazyk, nen-li pebit jinm nastavenm.
@end vtable
@node Hlasy, Hlasy spojen, Jazyky, Konfigurace
@subsection Definice hlas
@cindex parametry
Ve speechd-el lze definovat speciln hlasy, kter pak mohou bt
vyuvny v@tie{}rznch situacch, napklad pro pemlouvn rznch
faces rznmi hlasy (@pxref{Vlastnosti textu}) nebo pro nastaven
rznch reim ten interpunkce pro rzn druhy buffer (@pxref{Vce
spojen}). Hlasy ve speechd-el neuruj jen zkladn charakteristiku
hlasu, ale tak vlastnosti ei jako vku i rychlost a zvltn
vlastnosti jako reim ten interpunkce nebo signalizaci velkch
psmen.
Definice hlas je obsaena v@tie{}nsledujc promnn:
@vtable @code
@item speechd-voices
Asociativn seznam identifiktor hlas a jejich parametr.
Kad prvek seznamu m podobu @code{(@var{voice-id} .
@var{parameters})}, kde @var{voice-id} je symbo, pod kterm bude hlas
dostupn a @var{parameters} je asociativn seznam identifiktor
parametr a jejich hodnot. Ppustn jmna parametr jsou nsledujc
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 etzec identifikujc jmno hlasu Speech Dispatcher.
Nen-li uveden, pak jsou pro volbu hlasu rozhodujc parametry
@code{gender}, @code{age} a @code{style}. @code{gender} me bt
jeden ze symbol @code{male}, @code{female}, @code{neutral}.
@code{age} me bt jeden ze symbol @code{middle-adult},
@code{child}. @code{neutral}. @code{style} me bt jedno
z@tie{}sel @code{1}, @code{2}, @code{3} (hodnoty parametru
@code{style} se v@tie{}budoucnu pravdpodobn zmn).
Parametr @code{message-priority} nastavuje prioritu vech zprv
kanch danch hlasem. Jeho hodnotou me bt kterkoliv ze symbol
identifikujcch prioritu zprvy.
Pro povolen hodnoty ostatnch parametr viz odpovdajc
@code{speechd-set-*} funkce.
Hlas pojmenovan @code{nil} je zvltn, definuje implicitn hlas.
Explicitn definice jeho parametr je nepovinn.
@end vtable
@node Hlasy spojen, Vce spojen, Hlasy, Konfigurace
@subsection Hlasy spojen
@cindex hlasy
S@tie{}pomoc nsledujc promnn si mete nechat automaticky
nastavit rzn parametry spojen, jako rychlost ei, jazyk, atd.
speechd-el me mt na Speech Dispatcher oteveno vce spojen,
definovanch dle rznch kritri (@pxref{Vce spojen}). Rznm
spojenm pak mete nastavit rzn parametry, v@tie{}zvislosti na
jmnu spojen, a@tie{}mete tak nastavit implicitn parametry
spolen pro vechna spojen.
@vtable @code
@item speechd-connection-parameters
Asociativn seznam jmen spojen a odpovdajcch hlas. Kad prvek
seznam m podobu @code{(@var{connection-name} . @var{voice})}, kde
@var{connection-name} je jmno spojen ve form etzce a
@var{voice} je identifiktor hlasu definovanho v@tie{}promnn
@code{speechd-voices}.
Pro spojen, kter nejsou v@tie{}tto promnn definovna se pouv
implicitn hlas, jeho jmno je @code{nil}.
@end vtable
Aby se nastaven hodnoty tto promnn pln projevilo, mus bt
oteven spojen znovuotevena. Nepouvte-li konfiguran rozhran
Emacsu (customize), muste pro zajitn znovuoteven spojen zavolat
pkaz @kbd{C-u M-x speechd-speak}.
Jako malou pomcku pro nastaven hlasu spojen a jeho parametr je
mon pout tento pkaz:
@table @kbd
@item C-e C-a
@kindex C-e C-a
@findex speechd-add-connection-settings
Ulo aktuln parametry spojen do zadanho hlasu v@tie{}promnn
@code{speechd-voices} s nastav tento hlas pro aktuln spojen
v@tie{}promnn @code{speechd-connection-voices}.
Nezapomete, e pokud chcete zachovat nov obsah tchto promnnch,
muste si je sami uloit, pkaz to nedl.
@end table
@node Vce spojen, Klvesy, Hlasy spojen, Konfigurace
@subsection Vce spojen
@cindex spojen
speechd-el mete ct, aby pro urit buffery nebo hlavn mdy
pouvalo oddlen spojen na Speech Dispatcher. To v@tie{}zsad umouje
nezvisl nastaven rznch parametr eovho vstupu pro tyto
buffery a hlavn mdy, jak run, tak prostednictvm konfigurace
(@pxref{Hlasy spojen}).
Kad spojen na Speech Dispatcher m sv vlastn jedinen jmno.
speechd-el implicitn pouv spojen nazvan @code{"default"}. Pro
vytvoen oddlenho spojen sta pouze nechat v@tie{}uritch situacch
speechd-el vybrat jin jmno spojen. Zpsob vbru spojen je
definovn promnnou @code{speechd-speak-connections}.
@vtable @code
@item speechd-speak-connections
Asociativn seznam mapujc hlavn mdy a buffery na spojen. Kad
prvek seznamu je tvaru @code{(@var{md-nebo-buffer}
. @var{jmno-spojen})}.
Kdy chce speechd-el poslat zprvu, porovnv momentln prosted
s@tie{}@var{md-nebo-buffer}. @var{md-nebo-buffer} sm bt jednm
z@tie{}nsledujcch objekt, od nejvy priority po nejni:
@itemize @bullet
@item
seznam, reprezentujc voln funkce, kter mus vrtit jinou hodnotu
ne @code{nil}, prv kdy m bt pouit pslun prvek asociativnho
seznamu
@item
jmno bufferu
@item
symbol @code{:minibuffer}, reprezentujc minibuffer
@item
symbol hlavnho mdu
@item
@code{nil}, reprezentujc nebufferov objekty, nap. echo area
@item
@code{t}, reprezentujc implicitn hodnotu, kdy nen aplikovateln
dn jin prvek
@end itemize
Jestlie urit situaci odpovd vce prvk, je pouit prvek
s@tie{}nejvy prioritou.
@var{jmno-spojen} je libovoln neprzdn etzec urujc jmno
poadovanho spojen. Nen-li oteveno dn spojen danho jmna, je
automaticky vytvoeno v@tie{}okamiku, kdy do nj m bt nco zaslno.
@end vtable
@node Klvesy, Mdy, Vce spojen, Konfigurace
@subsection Klvesy
@cindex klvesy
@cindex prefixov klvesa
@cindex klvesov mapa
Pkazov klvesy speechd-el jsou definovny promnnou
@code{speechd-speak-prefix} a klvesovou mapou
@code{speechd-speak-mode-map}.
@vtable @code
@item speechd-speak-prefix
Tato promnn definuje prefixovou klvesu pkaz speechd-el, kterou
je implicitn @kbd{C-e}. Jestlie tuto promnnou zmnte a po
nastartovn mluven prostednictvm pkazu @code{speechd-speak} a
nenastavujete ji prostednictvm konfiguranho rozhran Emacsu
(customize), muste, aby se zmna projevila, pkaz
@code{speechd-speak} spustit znovu.
@item speechd-speak-mode-map
Tato klvesov mapa uruje mapovn klves speechd-el nsledujcch za
prefixovou klvesou. Mete v@tie{}n klvesy nastavovat obvyklm
zpsobem, nap.
@lisp
(define-key speechd-speak-mode-map "t" 'speechd-say-text)
@end lisp
piad pkaz @code{'speechd-say-text} klvese @code{C-e t} (je-li
prefixovou klvesou @code{C-e}).
@end vtable
@node Mdy, Debugger, Klvesy, Konfigurace
@subsection Hky ve vedlejch mdech
@cindex vedlej mdy
@cindex hky
speechd-el poskytuje vedlej md, kter zapn a vypn mluven,
@xref{Sputn eovho vstupu}. Prostednictvm nsledujcho hku
si mete nechat provst vlastn akce pi vstupu do tohoto mdu:
@vtable @code
@item speechd-speak-mode-hook
Hek sputn pi zapnut vedlejho mdu speechd-speak.
@end vtable
@node Debugger, , Mdy, Konfigurace
@subsection Ladn speechd-el
@cindex debugger
@cindex ladn
Pokud se pokoute eov vstup ladit, mete narazit na problm
rekurzivnho vyvolvn ladnch funkc v@tie{}elispovch debuggerech.
Tomu lze ve speechd-el zabrnit zkazem mluven v@tie{}debuggerech:
@vtable @code
@item speechd-speak-in-debugger
Je-li hodnotou promnn nco jinho ne @code{nil}, funkce
automatickho eovho vstupu nemluv v@tie{}elispovch debuggerech.
@end vtable
@node Pokroil konfigurace, Pote, Konfigurace, Uivatelsk pruka
@section Definice vlastnch reakc na pkazy
@cindex rozen
Psan vlastnch reakc na pkazy obecn vyaduje znalost programovn
v@tie{}Elispu. Nemuste se vak dsit, zkladn vci si mete nastavit
i@tie{}bez toho, sta se dit zde uvedenmi instrukcemi.
speechd-el umouje ct text, pehrt zvukovou ikonu nebo zavolat
libovoln elispov vraz ped nebo po proveden pkazu nebo funkce.
Pro tyto ely jsou k@tie{}dispozici dv makra, kter zajist, e se krom
vlastn akce provede ve, co je nutno:
@ftable @code
@item speechd-speak-command-feedback @var{pkaz} @var{pozice} @var{reakce}
Definuj reakci na @var{pkaz}. @var{pkaz} je jmno interaktivn
funkce (pouijte @kbd{C-h C-c} pro zjitn jmna pkazu navzanho
na uritou klvesu).
@var{pozice} me bt jeden ze symbol @code{before} nebo @code{after}
pro vyvoln reakce ped (@code{before}) nebo pot (@code{after}), co
je pkaz proveden.
@code{reakce} me bt etzec nebo jakkoliv elispov vraz.
Jedn-li se o@tie{}etzec (text uzaven v@tie{}uvozovkch), definuje text
k@tie{}pekn nebo zvukovou ikonu k@tie{}pehrn. Jestlie etzec zan
hvzdikou (@code{*}), uruje jmno zvukov ikony (hvzdika nen
soust jmna), jinak se jedn o@tie{}normln text.
Pklad:
@cindex @code{suspend-emacs}
@lisp
(speechd-speak-command-feedback suspend-emacs before "Suspenduji Emacs!")
@end lisp
Tento dek elispovho kdu mete vloit do svho @file{~/.emacs},
m si zajistte upozornn o@tie{}vyvoln pkazu @code{suspend-emacs}
(obvykle navzanho @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 vyvolna kdykoliv je vyvolna @code{funkce}, a u
interaktivn i nikoliv. Navc @code{funkce} me bt jakkoliv
funkce, nejen interaktivn pkaz.
@end ftable
@emph{Prosm pozor:}
@itemize @bullet
@item
Kvli uritmu nedostatku Emacsu nemus popsan mechanismus reakc
sprvn fungovat pro vestavn funkce.
@item
Pokud si definujete vlastn reakce na funkce bez pouit uvedench
maker, bute opatrn. Uveden makra definuj kd zajiujc, e se
nic nek v@tie{}ppad vypnutho @code{speechd-speak-mode}, a@tie{}podobn
opaten. Pokud tato makra nepouvte, muste si tato opaten
zajistit sami.
@end itemize
@node Pote, Tipy, Pokroil konfigurace, Uivatelsk pruka
@section Pote, se ktermi se mete setkat
@cindex pote
@itemize @bullet
@cindex Info
@item
@emph{Pro se nepekvaj nkter poloky menu v@tie{}Info?}
Je to zpsobeno tm, jakm zpsobem Emacs umisuje faces na poloky
menu. Problm lze obejt nastavenm hodnoty promnn
@code{Info-fontify-maximum-menu-size} na @code{0}.
@cindex upozornn na udlosti
@cindex di
@item
@emph{Jakm zpsobem lze Emacs pimt k@tie{}pekvn upozornn na
udlosti (appointments)?}
Nastavte promnnou @code{appt-msg-window} na @code{nil}. Takt me
bt uiten pidat do promnn @code{speechd-speak-auto-speak-buffer}
etzec @code{"diary"}.
@cindex w3m-el
@cindex URL
@item
@emph{Jak zabrnit vypisovn URL pi pohybu po lincch ve w3m-el?}
Pidejte si do svho @file{~/.emacs} nsledujc kd:
@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{}nkterch situacch, kdy je po proveden pkazu ten
modifikovan text, je tento text ten po kusech a nkter
z@tie{}tchto kus jsou opakovny.}
Obsah bufferu se v@tie{}elispovch programech me mnit mnoha rznmi
zpsoby. speechd-el neme uspokojiv oetit vechny mon takov
postupy. Pokud mte rozumn npad, jak v@tie{}njak situaci vylepit
ten zmn textu v@tie{}bufferu, eknte nm o@tie{}tom.
Pokud na tento problm narazte u@tie{}nkterho asto provdnho
pkazu, mete si pro tyto pkazy definovat svoji vlastn eovou
odezvu. Vce informac o@tie{}monostech definic vlastn eov
odezvy naleznete v@tie{}sekci @ref{Pokroil konfigurace}.
@item
@cindex prodlevy
@cindex garbage collection
@cindex @code{gc-cons-threshold}
@emph{Pedtm, ne se po pkazu nco ekne, se obas objevuje mal
prodleva (piblin jednosekundov).}
Mon, e Emacs bhem prodlevy provd garbage collection. Zkuste
zvit hodnotu promnn @code{gc-cons-threshold}, teba na 4000000.
Me to celkov vkon zvit nebo snit, v@tie{}zvislosti na vaem
prosted a konkrtnch poadavcch.
Jste-li zkuenm elispovm hackerem a dokete zjistit, pro
speechd-el produkuje vznamn mnostv dat zpsobujcch zven
frekvence provdn garbage collection a jak nco v@tie{}tomto smru
vylepit, vae pomoc je vtna!
@item
@emph{Pi pidren klvesy @kbd{C-n} obrazovka na chvli zamrzne a
kurzor se nepohybuje.}
Je-li Emacs zamstnan njakou innost, nen obecn provdna
aktualizace obrazovku. speechd-el je v@tie{}kombinaci s@tie{}vy rychlost
automatickho opakovn klves schopno doshnout takovho stavu
pomrn snadno. Pedstavuje-li to pro vs skuten problm, mete si
snit rychlost autorepeatu nebo podit rychlej pota.
Samozejm jsou vtny jakkoliv tipy, jak zvit rychlost speechd-el.
@end itemize
@node Tipy, Oznamovn chyb, Pote, Uivatelsk pruka
@section Uiten emacsov tipy
Nezapomete, e Elisp vm umouje definovat si spoustu uitench
funkc. Typicky si mete definovat pkazy oznamujc njak
informace, kter jsou snadno identifikovateln na emacsov obrazovce,
ale kter nejsou tak dobe rozpoznateln v@tie{}eovm vstupu.
Nkolik pklad:
@itemize @bullet
@item
@emph{Oznamovn aktulnho data v@tie{}kalendi:}
@cindex den v@tie{}kalendi
@lisp
(defun report-day ()
(interactive)
(message "%s" (calendar-date-string (calendar-cursor-to-date t))))
@end lisp
@item
@emph{Vpis aktulnch upozornn na udlosti z@tie{}die:}
@cindex upozornn na udlosti
@lisp
(defun report-current-appointments ()
(interactive)
(let ((appt-now-displayed nil))
(appt-check)))
@end lisp
@end itemize
@node Oznamovn chyb, , Tipy, Uivatelsk pruka
@section Jak oznamovat chyby speechd-el nebo Speech Dispatcher
@cindex chyby
Narazte-li na chybu speechd-el, mete pro jej oznmen pout
nsledujc pkaz. Ale ne tak uinte, pette si prosm cel text
tto sekce, aby vmi oznmen chyba mohla bt eena co
nejefektivnji.
@ftable @kbd
@item M-x speechd-bug
@findex speechd-bug
Oznam chybu speechd-el nebo Speech Dispatcher. Pkaz se zept na
urit informaci a pak se zept, zda chybu dokete zreprodukovat.
Pokud dokete, odpovzte @kbd{y} a zante chybu reprodukovat.
Ihned, jakmile je chyba zreprodukovna, stisknte @kbd{C-e C-f}.
Potom mete (a@tie{}mli byste) dle zeditovat vygenerovan e-mail a
odeslat jej obvyklm zpsobem.
@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
okamiku jsou sledovny vechny akce uivatele a Speech Dispatcher.
Reprodukce chyby se ukon stiskem klves @kbd{C-e C-f}. Pot, co je
ukonena, jsou do bufferu, kde byl pkaz @code{speechd-bug-reproduce}
vyvoln, vloeny informace o@tie{}reprodukci chyby.
Tento pkaz je uiten v@tie{}ppad, kdy chcete poskytnout
informace o@tie{}chyb bez generovn novho oznmen o@tie{}chyb.
@end ftable
Kdy oznamujete chyby, mjte prosm vdy na pamti nsledujc pokyny:
@itemize @bullet
@item
Napite o@tie{}chyb co nejvce informac. Popite, co nefunguje,
jak je vmi oekvan chovn, jak akce chybu vyvolaly, co je
zvltnho na vaem Emacsovm prosted nebo konfiguraci Speech
Dispatcher, atd. Nesnate se pli pemlet nad tm, kter
informace je dleit a kter nen --- pro vvoje me bt dleit
kad informace, take nezapomete uvst cokoli, co me bt
potenciln dleit. Radji uvdjte informac vce ne mn.
Chybjc informace me znamenat, e vvoji nebudou schopni
s@tie{}chybou nic udlat.
@item
Bute co nejpesnj. Neoekvajte, e vvoji znaj kontext nebo
e v, jakm zpsobem Emacs a speechd-el pouvte. Pouvejte pesn
popisy --- msto pouhho ``kdy zavolm foo'' pite lpe ``kdy
stisknu klvesy `M-x foo RET', m se vyvol pkaz `foo' ''. Nebo
msto ``nek, co by mlo'' pite ``k `bla bla' msto oekvanho
`ble ble ble', piem `ble ble ble' je text celho tenho dku''.
@item
Kdy reprodukujete chybu, snate se mt zapnuto logovn Speech
Dispatcher na co nejvy rove --- nastavte v@tie{}konfiguranm
souboru @file{speechd.conf} volbu @code{LogLevel} na hodnotu @code{5}.
@item
Kdy reprodukujete chybu, neprovdjte dn nadbyten akce a
provete @kbd{C-e C-f} hned jak je chyba zreprodukovna. Zabrnte
tak tomu, aby se podstatn informace zskan z@tie{}logovacch soubor
utopily v@tie{}nadbytenm balastu.
@item
Mete se tak podvat na pokyny pro oznamovn chyb Speech Dispatcher,
viz @ref{Reporting Bugs,,,speechd,Speech Dispatcher}.
@end itemize
@c ****************************************************************************
@node Elispov knihovna, Kontaktn informace, Uivatelsk pruka, Top
@chapter Elispov knihovna speechd-el
Momentln nen ke knihovn k@tie{}dispozici dn skuten programtorsk
manul. Podvejte se tedy prosm na dokumentan etzce dostupnch
promnnch, funkc a maker.
Nicmn se mete (a@tie{}mli byste) dit nsledujcmi radami:
@itemize @bullet
@item
Nepouvejte dn funkce, promnn nebo jin lispov objekty, jejich
jmna zanaj prefixem @code{speechd--} nebo @code{speechd-speak--}.
Tyto objekty jsou povaovny za privtn a mohou se kdykoliv bez
upozornn zmnit nebo bt zrueny.
@item
@vindex speechd-client-name
Jestlie chcete vybrat nebo vytvoit konkrtn spojen, udlejte to
prostednictvm nastaven hodnoty promnn @code{speechd-client-name}:
@lisp
(let ((speechd-client-name "nco"))
... kd pouvajc spojen "nco" ... )
@end lisp
Mjte prosm na pamti, e obvykle nen dobrm npadem otevt
souasn dv spojen na Speech Dispatcher se shodnm klientskm
jmnem.
@item
Jinak by na vs nemly hat dn zvltn pekvapen a jakkoliv
rozumn kd by ml bt bezproblmov.
@end itemize
Mon vs jet me zajmat @ref{Pokroil konfigurace}.
@c ****************************************************************************
@node Kontaktn informace, Koprovn tohoto manulu, Elispov knihovna, Top
@chapter Kontaktn informace
@cindex autoi
@cindex chyby
@cindex kontakty
Pokud chcete oznmit chybu speechd-el, zalete nm kompletn informaci
o@tie{}chyb na adresu @email{speechd-discuss@@nongnu.org}. Pokud
nm chcete poslat zplatu speechd-el, mete pout tut adresu.
@emph{Prosme}, ped zaslnm oznmen o@tie{}chyb si pette pokyny
pro oznamovn chyb, see @ref{Oznamovn chyb}. Budete-li se dret
uvedenmi radami, umonte nm zpracovat vae oznmen o@tie{}chyb
efektivnji a tm pdem s@tie{}lep a rychlej odezvou.
Mte-li jakkoliv otzky, nmty nebo cokoliv dalho, co nm chcete
sdlit, nevhejte se obrtit na adresu @email{speechd-discuss@@nongnu.org}.
@c ****************************************************************************
@node Koprovn tohoto manulu, 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, , Koprovn tohoto manulu, 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 elispovch chapter emacsov
@c LocalWords: itemize bullet Elispovou emacsov emacsovch 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 elispovm autorepeatu client protect
@c LocalWords: appendix November include unnumbered bye
speechd-el-2.9/speechd-version.el 0000644 0001750 0001750 00000000160 13612131732 015133 0 ustar pdm pdm (defconst speechd-version " pdm@brailcom.org--pdm/speechd-el--main--2.0--patch-25 ")
(provide 'speechd-version)
speechd-el-2.9/mmanager.el 0000644 0001750 0001750 00000022210 13612131732 013624 0 ustar pdm pdm ;;; mmanager.el --- Message manager
;; 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)
;;; 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
(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))
(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)
(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*)
(let ((queue (mmanager--manager-queue manager)))
(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)
(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)))
(ecase which
(current
(find cursor history :test #'eq))
(next
(let ((next (rest (member* cursor history :test #'eq))))
(when next
(setf (mmanager--manager-history-cursor manager) (first next)))))
(previous
(let ((pos (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) (first history)))
(last
(setf (mmanager--manager-history-cursor manager)
(car (last history)))))))
;;; Announce
(provide 'mmanager)
;;; mmanager.el ends here
speechd-el-2.9/speechd-bug.el 0000644 0001750 0001750 00000023355 13612131732 014236 0 ustar pdm pdm ;;; speechd-bug.el --- reporting speechd-el and speechd bugs
;; Copyright (C) 2003, 2004, 2005 Brailcom, o.p.s.
;; Copyright (C) 2012 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:
(eval-when-compile (require 'cl))
(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-start)
(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-start)
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" (first time) (second time) (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)
(require 'reporter)
(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.9/speechd-speak.el 0000644 0001750 0001750 00000254562 13612131732 014572 0 ustar pdm pdm ;;; speechd-speak.el --- simple speechd-el based Emacs client
;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010 Brailcom, o.p.s.
;; Copyright (C) 2012, 2013, 2016, 2019 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 .
;;; Commentary:
;; This is an Emacs client to speechd. Some ideas taken from the Emacspeak
;; package (http://emacspeak.sourceforge.net) by T. V. Raman.
;;; Code:
(eval-when-compile (require 'cl))
(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-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)
(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
(defconst speechd-speak--c-buffer-name "*Completions*")
;;; 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)))
(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)
(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)
"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."
(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))))
(speechd-speak--text text :cursor cursor)))))))
(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 (line-end-position)))
(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)))))
(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))))
(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)
(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)
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 ((info (speechd-speak--command-start-info)))
(when info
,@body)))
(defmacro speechd-speak--defadvice (function class &rest body)
(let* ((function* function)
(functions (if (listp function*) function* (list function*)))
(aname (if (listp function*) 'speechd-speak 'speechd-speak-user)))
`(progn
,@(mapcar
(lambda (fname)
`(defadvice ,fname (,class ,aname activate preactivate compile)
(if (not speechd-speak--started)
,(when (eq class 'around) 'ad-do-it)
,@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*
ad-do-it)
`(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 ad-do-it
(speechd-speak--speak-piece start)))))
(defun* speechd-speak--next-property-change (&optional (point (point))
(limit (point-max)))
(next-char-property-change point limit))
(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
(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--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))
;;; Basic speaking
(speechd-speak--command-feedback (next-line previous-line) after
(speechd-speak-read-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 (ad-get-arg 0) 1))
(point-min))
(point)))))
ad-do-it
(speechd-speak--store-deleted-chars (if speechd-speak-deleted-char
speechd-speak--deleted-chars
(format "%c" (preceding-char))))))
ad-do-it))
(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 (ad-get-arg 0) 1))
(point-max))))))
ad-do-it
(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))
(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 ad-do-it
(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 "en"))
(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 (ad-get-arg 6) speechd-language)))
ad-do-it))
(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 "en")
(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 "en")
(speechd-speak-input-method-languages nil))
(apply #'speechd-speak--text prompt args)))
(speechd-speak--command-feedback minibuffer-message after
(speechd-speak--minibuffer-prompt (ad-get-arg 0) :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 (ad-get-arg 0))
(speechd-speak--emulate-minibuffer t))
(when prompt
(speechd-speak--minibuffer-prompt prompt :priority 'message))))
(speechd-speak--defadvice read-event before
(let ((prompt (ad-get-arg 0)))
(when prompt
(let ((speechd-speak--emulate-minibuffer t)
(speechd-language (if (ad-get-arg 1) speechd-language "en")))
(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)
ad-do-it
(setq char ad-return-value)
(let ((command (lookup-key speechd-speak-read-char-keymap
(vector char))))
(when command
(setq char nil)
(call-interactively command))))
char)
ad-do-it))
;;; 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 (info beg end)
(let ((last (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 (info old new)
(speechd-speak--add-command-text
info
(+ (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 (beg end len)
(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
info 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 beg end len))
(speechd-speak--add-command-text info 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 (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)
(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 (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 (first changes)) 1))
(setq text (concat text " " (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)))
(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 "en")
(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 (buffer completion-reference-buffer))
(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)))
ad-do-it))
;;; 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)
(defmacro* speechd-speak--watch (name get-function
&key on-change info info-string key)
`(locally
(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 "en")
(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 ()
(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)
(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.9/speechd-out.el 0000644 0001750 0001750 00000020761 13612131732 014266 0 ustar pdm pdm ;;; speechd-out.el --- Alternative output interface
;; 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:
(eval-when-compile (require 'cl))
(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?
(destructuring-bind
(,$error . ,$error-data) (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))
(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
(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))
(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)))))
(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)
(lexical-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%)))))))
(defun* speechd-out-keys (keys &key (priority speechd-default-key-priority)
text)
(speechd-out--loop-drivers (driver)
(speechd.set driver 'priority priority)
(lexical-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)))))))
(defun* speechd-out-text (text &key (priority speechd-default-text-priority)
icon cursor)
(let ((icon-name (speechd-out--icon-name icon)))
(speechd-out--loop-drivers (driver)
(speechd.set driver 'priority priority)
(lexical-let ((icon-name% icon-name)
(driver% driver)
(text% text)
(cursor% cursor))
(speechd.block driver (lambda ()
(when icon-name%
(speechd.icon driver% icon-name%))
(speechd.text driver% text% cursor%)))))))
(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
(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.9/speechd-el-pkg.el 0000644 0001750 0001750 00000001737 13612131732 014640 0 ustar pdm pdm ;;; speechd-el-pkg.el --- speechd-el package definition
;; Copyright (C) 2013, 2016 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.9"
"Client to speech synthesizers and Braille displays.")
;;; Announce
(provide 'speechd-el-pkg)
;;; speechd-el-pkg.el ends here
speechd-el-2.9/AUTHORS 0000644 0001750 0001750 00000000177 13612131732 012573 0 ustar pdm pdm Milan Zamazal
Hynek Hanke
Christopher Brannon
speechd-el-2.9/gpl.texi 0000644 0001750 0001750 00000104416 13612131732 013201 0 ustar pdm pdm @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.9/brltty.el 0000644 0001750 0001750 00000053051 13612131732 013364 0 ustar pdm pdm ;;; brltty.el --- Interface to BRLTTY
;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Brailcom, o.p.s.
;; Copyright (C) 2012, 2013, 2020 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 .
;;; Commentary:
;;; Code:
(require 'cl)
(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)))
(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 '()))
(lexical-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)
(destructuring-bind (type . data) (brltty--read-packet connection)
(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 (reduce #'+ data-list :initial-value 0
:key #'(lambda (data)
(cond
((integerp data) 4)
((consp data)
(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
(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)
(destructuring-bind (n1 n2 n3) (cdr data)
(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 (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 (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.9/speechd-braille.el 0000644 0001750 0001750 00000014670 13612131732 015073 0 ustar pdm pdm ;;; speechd-braille.el --- Emacs braille emulator driver
;; Copyright (C) 2004, 2005, 2006, 2008 Brailcom, o.p.s.
;; Copyright (C) 2012 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 '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)
(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.9/NEWS 0000644 0001750 0001750 00000015003 13612131732 012214 0 ustar pdm pdm User-visible changes to speechd-el:
* 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.9/fdl.texi 0000644 0001750 0001750 00000050543 13612131732 013165 0 ustar pdm pdm @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.9/README 0000644 0001750 0001750 00000005447 13612131732 012410 0 ustar pdm pdm 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.
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.9/speechd-ssip.el 0000644 0001750 0001750 00000004707 13612131732 014437 0 ustar pdm pdm ;;; speechd-ssip.el --- SSIP driver
;; Copyright (C) 2004, 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 '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)
(speechd-say-text text))
(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.9/speechd-el.info 0000644 0001750 0001750 00000454633 13612131732 014423 0 ustar pdm pdm This is speechd-el.info, produced by makeinfo version 6.5 from
speechd-el.texi.
This manual is for speechd-el, 2.9.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010 Brailcom,
o.p.s. Copyright (C) 2012, 2013, 2016 Milan Zamazal
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.9.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010 Brailcom,
o.p.s. Copyright (C) 2012, 2013, 2016 Milan Zamazal
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.
'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.
* 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.
'speechd-spdsend'
If non-'nil', it is a string naming the _spdsend_ binary (normally
'"spdsend"') to use for communication with Speech Dispatcher. If
'nil' or if you use Emacs 22 or higher, spdsend is not used.
Usually you shouldn't care about this variable.
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: Languages, 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: Languages, Next: Voices, Prev: Text Properties, Up: Customization
2.4.9 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.
File: speechd-el.info, Node: Voices, Next: Connection Voices, Prev: Languages, Up: Customization
2.4.10 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.11 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.12 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.13 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.14 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.15 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.16 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 62)
* brltty-coding: Connection Setup. (line 67)
* brltty-default-host: Connection Setup. (line 52)
* brltty-default-port: Connection Setup. (line 56)
* brltty-timeout: Connection Setup. (line 80)
* brltty-tty: Connection Setup. (line 73)
* 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 42)
* C-e .: Reading Commands. (line 32)
* 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 15)
* C-e b: Reading Commands. (line 12)
* C-e c: Reading Commands. (line 46)
* 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 50)
* C-e C-p: Reading Commands. (line 53)
* C-e C-r: Reading Commands. (line 26)
* 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 64)
* C-e l: Reading Commands. (line 7)
* C-e m: Reading Commands. (line 56)
* C-e o: Reading Commands. (line 19)
* C-e p: Control Commands. (line 24)
* C-e q: Control Commands. (line 7)
* C-e r: Reading Commands. (line 23)
* C-e RET: Reading Commands. (line 59)
* C-e s: Control Commands. (line 11)
* C-e SPC: Control Commands. (line 29)
* C-e w: Reading Commands. (line 29)
* C-e x: Control Commands. (line 17)
* C-e z: Other Commands. (line 19)
* C-e [: Reading Commands. (line 39)
* C-e {: Reading Commands. (line 35)
* C-x C-c: Other Commands. (line 6)
* capital character mode: Parameter Setting Commands.
(line 26)
* character reading prompts: Reading Commands. (line 68)
* 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)
* 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)
* 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 59)
* 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 68)
* 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)
* spdsend: Connection Setup. (line 44)
* 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-spdsend: Connection Setup. (line 43)
* 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 84)
* 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-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-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 64)
* speechd-speak-last-insertions <1>: Reading Commands. (line 78)
* speechd-speak-last-message: Reading Commands. (line 56)
* speechd-speak-last-message <1>: Reading Commands. (line 74)
* 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 12)
* speechd-speak-read-char: Reading Commands. (line 46)
* 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 59)
* speechd-speak-read-next-line: Reading Commands. (line 50)
* speechd-speak-read-other-window: Reading Commands. (line 19)
* speechd-speak-read-page: Reading Commands. (line 39)
* speechd-speak-read-paragraph: Reading Commands. (line 35)
* speechd-speak-read-previous-line: Reading Commands. (line 53)
* speechd-speak-read-rectangle: Reading Commands. (line 26)
* speechd-speak-read-region: Reading Commands. (line 23)
* speechd-speak-read-rest-of-buffer: Reading Commands. (line 15)
* speechd-speak-read-sentence: Reading Commands. (line 32)
* speechd-speak-read-sexp: Reading Commands. (line 42)
* speechd-speak-read-word: Reading Commands. (line 29)
* 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-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)
* 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: Top1238
Node: Introduction2763
Node: Design Goals3964
Node: Feature List6264
Node: Components8744
Node: speechd-el User Manual9988
Node: Installation11478
Node: Starting Alternative Output12872
Node: Commands14759
Node: Reading Commands15856
Node: Informatory Commands18306
Node: Control Commands19234
Node: Parameter Setting Commands20747
Node: Spelling23373
Node: Other Commands24008
Node: Customization24680
Node: Driver Selection25970
Node: Connection Setup26841
Node: Default Priorities30595
Node: Basic Speaking31693
Node: Auto-Reading Buffers34573
Node: Reading State37461
Node: Signalling38827
Ref: Signalling-Footnote-140000
Node: Text Properties40106
Node: Languages42315
Node: Voices44689
Node: Connection Voices46996
Node: Multiple Connections48526
Node: Keys50664
Node: Braille Display Keys51646
Node: Modes55669
Node: Debugging56096
Node: Advanced Customization56537
Node: Problems58826
Node: Tips62065
Node: Bug Reporting63388
Node: speechd-el Elisp Library66449
Node: Contact Information68241
Node: Copying This Manual69034
Node: GNU Free Documentation License69306
Node: GNU General Public License91762
Node: Index129333
End Tag Table
speechd-el-2.9/speechd-brltty.el 0000644 0001750 0001750 00000024274 13612131732 015002 0 ustar pdm pdm ;;; speechd-brltty.el --- BRLTTY output driver
;; 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 .
;;; Commentary:
;;; Code:
(eval-when-compile
(require 'cl))
(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)
(lexical-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)
(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
(max (- scrolling (or (car (brltty-display-size connection)) 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)
(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.9/Makefile 0000644 0001750 0001750 00000004211 13612131732 013154 0 ustar pdm pdm # Makefile for speechd-el
# Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Brailcom, o.p.s.
# Copyright (C) 2012, 2013, 2016 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 .
EMACS = emacs
NAME = speechd-el
VERSION = 2.9
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.9/speechd-speak.pdf 0000644 0001750 0001750 00000100501 13612131732 014722 0 ustar pdm pdm %PDF-1.2
%쏢
6 0 obj
<>
stream
xun0EYR ?]Y.
! Rc"bMQ k˖tA3t50jo봂bbjvqJ[,'7OZLDM--NUUn?#]!_gӟKPȅ:@<->L%:cM"_oW*1Sӫrsw)d~@4:'ɹ
Ԙg]tI(Ch@
wJK"{I8Hf@ijCO~XƁ'.)5 }6byz;<82ics10>
stream
xT[o0~C"y7`sm,4 nV_.ǹǔ0L'6GX11"nQ0F <9E
?|(ޡ{̎COaOĚ;hRCsmƥ]|j^E(3YoȈ+x] }J M.HO1APɈ6B_[~ʓRP _Y ]p<
~tS½TV#:6 gBpʛBM~Lg"DˈGRdSw`h́+ľ$˄I;)܍ջM2A?sRaV
m↪2U6C27|ۦ^ڡ8M=4