DragonDictate extension for emacs. Version 0.1 Oct 1996.
Written by Thomas Rene Nielsen.


The use of a speech-recognition system for writing text, is becoming more and
more usual.  The speech-recognition systems are pretty tuned for that.
Using them for programming or latex-writing is an entirely different matter.

The following utilities are actually the result of my masters-degree project
in computer-science:  A study of how to improve the user-interface, with
regard to the use of speech. Here's the result of my work.

Introduction to the utilities.
In my work I have concentrated primary on programming in Lisp and C and on
writing latex, but have also worked a lot with more general useful stuff.
To improve the usefulness of speech-guidance, I supplement the speech with
use of the mouse.  Mouse-clicks will be performed by verbal command.
The idea for this speech-mouse combination, originates from  Nils Klarlund.
Notice that you should be able to use all be commands by voice alone, also.  

Look in the 'dictate.dcm' file, to see how I use the commands.  

General stuff
paran-body,normal-quotes,quote-body,brace-body,bracket-body,single-quotes
Pairs of brackets, braces...

nice-newline
The use of a 'nice' newline, allowing shift to the next line, from the middle
of the current line, without disturbing the current line.

copy-word
The copying of words from the mouse-pointer position to the cursor position.

delete-word
Deletes the word below the cursor.

cursor-list-select
Used to select verbally from a list.

several-lines-up,several-lines-down
To move several lines up or down by specifying a number.

skip-forward,skip-backward
Skips to the next logical place to write, depending on the emacs mode.

collect-function,collect-identifiers,clear-identifiers,open-identifier-list,
open-var-identifier-list,open-function-identifier-list,
collect-all-identifiers-buffer
The 'collect-..' functions are used to 'parse' a lisp or C buffer for
identifiers, that this, to collect the function and variable names and gather
them in a list.  The list can be opened with the 'open-..' functions.  A mouse-
click in the list will place the chosen identifier in the kill-ring, for
pasting into a buffer.

goto-next-frame,goto-previous-frame
Cycles between frames.

middle-of-buffer, top-of-buffer, upper-part, lower-part
For scrolling the buffers. The middle-of-buffer goes to the middle of the
current buffer, counting lines and prepares the buffer for at kind of manual
binary search. It sets the bounds for the search to the top of the buffer and
the end of the buffer. upper-part will move to the middle line, between upper
bound and the current cursor position. Lower bound will be set to the cursor
position before running upper-part. And os on ... Similar with lower-part :
middle line between current cursor line and lower bound and upper bound set to
cursor pos, before running command.
Used for quickly zero'ing in on a wanted line. The idea for these, comes from
Peter Kornerup.

insert-remark
Inserts a remark of a form that depends on the major-mode.
Words for C, lisp and tex.

no-space-mode
A minor-mode I found useful in programming.   Switches off the space-bar,
to avoid DragonDictate's spaces after each word.  Use 'space-bar' to make
spaces in no-space-mode.


Speak-list
open-speak-list
This function opens a list of the available speak-commands found in your
DragonDictate dcom-file.  Set the variable 'speaklist-file' to your
DragonDictate dcom-file.


File-list
open-file-list
Opens a list of the last ten files that has been opened.
Mouse-click in the list to select. Remember 'mouse-clicks' are verbally made.
 
Work-pad
insert-word-pad,delete-word-pad,open-word-pad,clear-word-pad,save-word-pad,
load-word-pad
The word-pad is used to hold often used words, which isn't included in the
speech-command data-base.  Call 'insert-word-pad' to add the word under the
cursor to the word-pad. 'delete-word-pad' works the same way. You can save
different word-pads for each application with save-word-pad and load with
load-word-pad. Open list with 'open-word-pad'. 'clear-word-pad'

Lisp-mode
I have made a few basic forms to make programming easier:
lisp-make-defun,lisp-make-setq,lisp-make-let,lisp-make-alist,
lisp-make-alist-part
These makes the basic form of the given construction and places the cursor
on the next logical place to write.


C-mode
I have included most of Simon Crosby's C-macros, made a kind of
parser, as mentioned earlier in this text and made a skip forward/backward.


Latex-mode
The main thing here, is a 'menu' system (open-latex-main-list), that allows you
to select macros.  You can place the macros in logical groups.  The file
'latex.dat' is the data file.  Take a look at this file. 
In the main menu you can select a group.  This will open another window,
from which you select the macro.  The macro is placed in the kill-ring,
for pasting.  You can select function-forms from the menu too.  When you run
'paste', the function will activate.  Take a look in the group 'special',
for some examples. Only a few macros has been included in the data file,
because I'm still working on latex-mode.

Undo
To be able to undo commands, I have made a undo-part.  This undo works by the
backspaces DragonDictate sends to undo mistakes.  It compares the last given
command with a paired undo file 'undo.dat'.  This file consist of functions and
their undo-functionss (like a2x undo).  The undo-function can have a single
argument. If undo doesn't find the function in the list, it just relays the
backspaces.



Installing the utilities.
The package consist of this textfile, dictate.dcm, emacs , .el, .dat
and .pad files.
You will need these files, so keep them together.
First you must make a few changes to you '.emacs' file.  Just insert the
'load' instructions, shown in the included 'emacs' file.  Remember to
change the paths to reflect your system.

To make the undo part work, a few changes has to be done.
You should make sure that none of the a2x-undo pairs, are the same as in
undo.dat, to avoid double undoing.  Another important thing is to
include the '-b' flag in the call to a2x. The 'b' flag means that a2x won't
convert backspace characters to del characters. My undo needs backspaces to
work.
Unfortunately a backspace-character has the same key-sequence as the
'ctrl-h' key-sequence.  This key-sequence calls the emacs help function.
To make the undo work, I had to move this sequence.  The 'undo.el' file
moves the help to 'meta-h', instead.

I have included my '.dcm' file, to show how I call the functions.
Notice that I have only got the dos version of DD.


Hope you will find some of my utilities useful.  Please let me know your
thoughts about my work, bugs and stuff.


		Thomas Rene Nielsen
		trn@imada.ou.dk






