s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre |
Next
Previous
Contents
5. IspellIf you want to spell-check your document from within Emacs, you may use the Ispell package and its Emacs mode.
5.1 Choosing your default dictionariesYou can set up Emacs so that upon loading a file, it chooses automatically which dictionaries to use (you can use several). The first one, certainly the most important, is the main dictionary, distributed with Ispell. You can choose among several languages. The second one is your personal dictionary, where Ispell will insert words it couldn't find in the main dictionary but you told it to remember. If you wish to use as a default dictionary the French dictionary
that comes with Ispell, and if you wish to use the file
(setq sgml-mode-hook '(lambda () "Defauts for SGML mode." (setq ispell-personal-dictionary "~/.ispell-dico-perso") (ispell-change-dictionary "francais") ))
5.2 Selecting special dictionaries for certain filesYou may have a little problem if you do not spell-check documents in the same language at all times. If you translate documents, it is very likely that you swap languages (and dictionaries) very often.
I don't know of any Lisp way of selecting, either automatically, or with a single mouse click, the main and personal dictionaries associated to the language currently being used. (If you do, please tell me!)
However, it is possible to indicate, at the end of the file, which dictionaries you want to use for the current file (and only this one). It suffices to add them as commentaries, so that Ispell can read them upon launching a spell-check:
<!-- Local IspellDict: english --> <!-- Local IspellPersDict: ~/emacs/.ispell-english --> If you have previously defined, in your
5.3 Spell-checking your documentTo spell-check the whole of your document, use, from anywhere in
the document the
Emacs then runs Ispell. Upon meeting an unknown word, this one shows you said word (usually highlighted) and prompts you for a key:
If ispell finds one or several words close to the unknown one, it will show them in a little window, each one of them preceded by a digit. Just type this digit to replace the misspelled word with the corresponding word.
5.4 Personal dictionary versus local file dictionaryThe i key will let you insert a word in your personal dictionary, whereas A will let you insert a word in the local file dictionary.
The local file dictionary is a sequence of words inserted at the end of the file, as comments, reread by Ispell each time it is run on the file. This way, you can accept some words, acceptable in this file, but not necessarily acceptable in other files.
As far as I am concerned, I think it is better that the personal dictionary be reserved for words the main dictionary doesn't know but which belong to the language (like hyphenated words), plus some common words like proper nouns or others (like Linux), if they don't look too much like a real word of the main dictionary; adding too many words in the personal dictionary, such as first names, may be dangerous, because they may look like a word of the language (one can imagine Ispell being mystified on the following: `When the going gets tof, the tof get going Tof is a French abbreviation for the first name Christophe.'!).
5.5 Typing spell-checkingIspell can spell-check your file while you're typing. You need to
use ispell-minor-mode for this. To start it or stop it, type
If those beeps hassle you (or your roommate
is taking a nap), you can replace those annoying beeps
with a flash on the screen, with
the command
(setq visible-bell t)
Next Previous Contents |