开发者

Emacs on Win32 with hunspell - personal dictionary does not get saved

开发者 https://www.devze.com 2023-04-10 22:44 出处:网络
So I have a working setup for Emacs (v23.3.1) on Windows 7 using hunspell after following the instructions in the wiki.

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 开发者_如何学JAVAfor this? If you are able to save to the personal dictionary, kindly post the relevant bits from your .emacs


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消