Domanda

So I have a working setup for Emacs (v23.3.1) on Windows 7 using hunspell after following the instructions in the wiki.

http://www.emacswiki.org/emacs/InteractiveSpell

When I spell check a document (M-x ispell), emacs gives me the options to insert a flagged word into the personal dictionary using either the keystroke 'i' or 'u'. At the end, it asks me if I want to save the modified personal dictionary and I choose yes.

Problem is the personal dictionary is not saved to disk, and the words highlighted earlier are again flagged again in a new session.

Tried the following things recommended elsewhere to no avail:

(setq ispell-personal-dictionary (expand-file-name "~/personal-dictionary.txt") )

Anybody have a solution or workaround for this? If you are able to save to the personal dictionary, kindly post the relevant bits from your .emacs

È stato utile?

Soluzione

I think the problem may be that while you have told ispell where your personal dictionary is stored, you have not provided this information to hunspell.

From the man page:

-p dict

Set path of personal dictionary. Default is $HOME/.hunspell_default. Setting -d or the DICTIONARY environmental variable, personal dictionary will be $HOME/.hunspell_dicname

I am using hunspell compiled with Cygwin, and am using the en-GB dictionary. If I set the value of ispell-personal-dictionary to "c:/cygwin/home/luke.girvin/.hunspell_en_GB", any words I add to my personal dictionary using ispell are saved correctly.

So, the easiset way to fix your problem is to change the name of your personal dictionary file to whatever hunspell expects by default.

Alternatively, you could use the -p option to tell hunspell which dictionary file you want to use, perhaps by customizing ispell-cmd-args.

Also, does your dictionary file actually exist? I found that Emacs would not create this file for me, but it would update an existing empty file.

Altri suggerimenti

Try using a personal folder for "special" Windows programs. The problem is that only users with administrator rights are able to write in C:\Program Files and if you saved emacs in there and invoked with your usual user chances are you cannot write in there.

Solution: Just create a new folder like C:\Programs\ and put emacs there. This way your user will have the rights to write into the folder.

This is more of a workaround, but for some applications it is just easier this way.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top