Next: , Previous: , Up: speechd-el User Manual   [Contents][Index]


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:


Next: , Previous: , Up: speechd-el User Manual   [Contents][Index]