all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* ispell/hunspell/Windows: a fully-worked example
@ 2014-04-03  7:39 djc
  2014-04-04  7:41 ` djc
  0 siblings, 1 reply; 13+ messages in thread
From: djc @ 2014-04-03  7:39 UTC (permalink / raw)
  To: help-gnu-emacs

Thanks to several people, especially Eli Zaretskii, I now have ispell with hunspell working with GNU emacs 24.3.1 under Windows 7.  Here is a full explanation of my setup.

==== Step 1: install hunspell

hunspell doesn't require installation in the Windows sense: you only need to place it somewhere, anywhere.  Except as in step 2 below, it has no effect at all on Windows.

    a. Download the hunspell installation kit from

       http://sourceforge.net/projects/ezwinports/files

       I have hunspell-1.3.2-2-w32-bin.zip.

    b. Extract the contents of the zipfile to any directory. I chose

       D:\hunspell

==== Step 2: add hunspell to Windows PATH

This step may be unnecessary, and I'll probably try removing it.  But here's how:

    a. Start --> Control Panel --> System --> Advanced system settings -->
       "Advanced" tab --> Environment Variables

    b. In the "System variables" window select "Path" and click "Edit..."

    c. A window "Edit System Variable" will pop up showing the current
       value of "Path".  At the end of that string add

       ;{folder for hunspell.exe}

       which on my system is

       ;D:\hunspell\bin

    d. Click your way out: OK --> OK --> OK --> close the control panel
       window.

==== Step 3: add the dictionaries you want

There are many sources of dictionaries.

    a. Put the dictionaries where hunspell expects to find them, in

       ...\share\hunspell

       On my system that is

       D:\hunspell\share\hunspell

    b. I added these dictionaries:

       de_DE_frami (de_DE_frami.aff and de_DE_frami.dic)
       en_US (en_US.aff and en_US.dic)
       fr-classique (fr-classique.aff and fr-classique.dic)

==== Step 4: set up ispell initialization in emacs, for instance in ".emacs"

    a. Tell emacs and ispell where to find the executable.  I have

       (add-to-list 'exec-path "D:/hunspell/bin/")

       (setq ispell-program-name (locate-file "hunspell"
                exec-path exec-suffixes 'file-executable-p))

    b. Initialize "ispell-local-dictionary-alist".  I have

       (setq ispell-local-dictionary-alist '(

       (nil
           "[[:alpha:]]"
           "[^[:alpha:]]"
           "[']"
           t
           ("-d" "en_US" "-p" "D:\\hunspell\\share\\hunspell\\personal.en")
           nil
           iso-8859-1)

       ("american"
           "[[:alpha:]]"
           "[^[:alpha:]]"
           "[']"
           t
           ("-d" "en_US" "-p" "D:\\hunspell\\share\\hunspell\\personal.en")
           nil
           iso-8859-1)
       ("deutsch"
           "[[:alpha:]ÄÖÜéäöüß]"
           "[^[:alpha:]ÄÖÜéäöüß]"
           "[']"
           t
           ("-d" "de_DE_frami" "-p" "D:\\hunspell\\share\\hunspell\\personal.de")
           nil
           iso-8859-1)
       ("francais"
           "[[:alpha:]ÀÂÇÈÉÊËÎÏÔÙÛÜàâçèéêëîïôùûü]"
           "[^[:alpha:]ÀÂÇÈÉÊËÎÏÔÙÛÜàâçèéêëîïôùûü]"
           "[-']"
           t
           ("-d" "fr-classique" "-p" "D:\\hunspell\\share\\hunspell\\personal.fr")
           nil
           utf-8)
        ))

       The first -- nil -- sub-list defines the default dictionary, which
       on my system is American English, so except for the names (nil and
       "american") those sub-lists are identical.

       You will use the names in the sub-lists "american", "deutsch" and
       "francais" with "ispell-change-dictionary" in ispell.

    c. After (a) and (b) above, require ispell:

       (require 'ispell)

==== Step 5: use ispell

    a. Select a dictionary for the buffer you want to check:

       M-x ispell-change-dictionary

       and select one of the names in "ispell-local-dictionary-alist".
       Otherwise ispell will use the default dictionary under the "nil" list.

    b. Invoke ispell.

Voilà!


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-04-05  9:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-03  7:39 ispell/hunspell/Windows: a fully-worked example djc
2014-04-04  7:41 ` djc
2014-04-04 10:29   ` AW
2014-04-04 10:42     ` Eli Zaretskii
2014-04-04 12:47       ` AW
2014-04-04 13:03         ` Eli Zaretskii
2014-04-04 14:00           ` AW
2014-04-04 14:30             ` AW
2014-04-04 21:56               ` Robert Thorpe
2014-04-05  6:49                 ` Eli Zaretskii
2014-04-05  9:43                   ` Robert Thorpe
     [not found]                 ` <mailman.18956.1396680552.10748.help-gnu-emacs@gnu.org>
2014-04-05  6:59                   ` David Masterson
2014-04-05  8:13                     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.