COMP1800, COMP2800, COMP3800: EMACS Ispell and Word Counting Notes

The emacs command M-x ispell-buffer (M-x means pressing the ESC key followed by the x key)) will invoke a spelling checker (alternatively, use the Edit->Spell menu for this and other spell checking options).

Once invoked, emacs will then use the ispell utility to search the file for words which it can find no valid spelling for (~80% of mis-spellings are of this type).

When it comes across such a word, it will highlight the word. At the top of the screen, it will give numbered alterative choices; typing that number will replace the word with the choice; otherwise type r to replace the word with a new spelling of your own; type a to accept the current spelling. Type ? for a list of responses.

Once you are used to it, it is very quick to use. Running the spell checker once just before you submit your report should suffice.

Note that because of such tools there is no longer a good excuse for obviously mis-spelled words! We are not just talking about this unit, we are talking about any context.

Emacs can also be used to give a word count of any region of text. To define a region, type "C- " (press Ctrl key and the space bar simultaneously) to mark the start of the region at the point of the cursor. Now move the cursor to the end of the region. The region is the area between this place and where you marked the start.

Via the M-| wc -w command (M-| CMD invokes the Unix command CMD using the current region as input), Emacs will display in its mini-buffer (at the bottom) the count of words in the region. This is a lot more convenient and accurate than trying to count them yourself!