24

In Emacs, where is ispell's personal dictionary stored?, the documentation http://www.gnu.org/software/emacs/manual/html_node/emacs/Spelling.html says

Your personal dictionary is specified by the variable ispell-personal-dictionary. If that is nil, the spelling program looks for a personal dictionary in a default location.

But where is this default location? In general, how to find out this?

3
  • 1
    Here is an example command-line to dump the aspell configuration from the terminal into output to the terminal screen: aspell --lang=en dump config You can setup an aspell.conf in the etc directory and then store your personal dictionaries wherever you want.
    – lawlist
    Commented Oct 9, 2015 at 14:16
  • Ask Emacs: C-h v ispell-personal-dictionary (as @Lompik said). If that doesn't tell you all you need to know, click the link that takes you to the source code, and see what it uses as the default value.
    – Drew
    Commented Oct 9, 2015 at 14:30
  • 1
    See ispell-process-directory. I found this by following @Drew's advice, then diving into the code to see how ispell-personal-dictionary was being used. Time-order that dir listing and you'll find your file.
    – petermao
    Commented Aug 14 at 14:47

2 Answers 2

28

C-h v ispell-personal-dictionary

"File name of your personal spelling dictionary, or nil.
If nil, the default personal dictionary, (\"~/.ispell_DICTNAME\" for ispell or
\"~/.aspell.LANG.pws\" for aspell) is used, where DICTNAME is the name of your
default dictionary and LANG the two letter language code."
4
  • 5
    Any idea what does "pws" stands for?
    – qazwsx
    Commented Oct 9, 2015 at 14:51
  • 1
    I'm not sure what it stands for but it's just the extension of the file. aspell.net/man-html/…
    – Lompik
    Commented Oct 9, 2015 at 15:29
  • 4
    "Personal Word Set"? (i have no clue) Commented May 10, 2019 at 2:50
  • What if there are multiple languages? In hunspell each language has its own ~/.hunspell_es_AR personal dictionary for each language. Is there still only one personal dictionary for this variable?
    – sinekonata
    Commented Apr 6, 2020 at 2:42
0

TL;DR:

On Fedora 40, 19th of June 2024, using American English it is:
$HOME/.config/enchant/en_US.dic

$HOME/.config/enchant/en_US.dic
#or
$HOME/.config/enchant/$LANG #Read Warning Below
# Warning: True $LANG value is en_US.UTF-8, so it's not true LANG

# If it's not the above, you can still use the method below to find it

Using a Rare Word to Identify Dictionary File Locations

  1. Add a long word that is unlikely to be found in other files to the personal dictionary:
  • type the word aldsjadsdaads in an Emacs buffer with flyspell-mode active in it, and type space
  • middle-click the word that should be marked as an error and click save word to add it to the dictionary
  1. Run a grep -r command to find the word on your computer.
  • grep -r aldsjadsdssds ~/

Background & long story:

Looks like the location of dictionaries varies greatly and is not always under the default location, even location declared by the manuals. On Fedora, according to hunspell's manual (intentionally not marked as code) it's $HOME/.hunspell_default, but it's wrong.

Because I thought I checked everywhere in $HOME, I run the grep command on all the directories in root. It went for half a day at first (10 year old laptop), and still didn't leave /proc. Afterwards I typed !BUT NOT TYPED ENTER! grep -r asdljasldja $(ls /) and without pressing Enter, I typed (works only in bash!) Ctrl+Alt+e (all at the same time), which expands shell expansions in currently edited command without executing the line. And then !STILL WITHOUT PRESSING ENTER, Ctrl+x Ctrl+e (Holding Ctrl press and release x and then e), which opened the command in the editor. And in the editor I added missing forward slashes on all the directories inside root that should have showed up after expanding the $(ls /). I also removed the proc dev boot lost+found media mnt and opt. Resulting command looked like this:

sudo grep -r \
"ewpjpwjdpewijdpewijdpiewjpiewjdpijjde" \
/bin /etc /home /lib /lib64  /opt /root \
/sbin /srv /sys /tmp /usr /var \
> dict_poison_word_grep.out

The result was sent to an .out file, because I run the grep in the background expecting another few hours before it finishes.

Hope you can find your dictionary :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.