3

I'm using flyspell mode with aspell under the hood. Emacs 27.1 installed using Homebrew on macOS Mojave. This behavior happens both with my normal configuration as well as emacs -Q.

I looked through M-x customize as carefully as I could in the flyspell and ispell sections, but did not find anything useful.

When I right-click on a misspelled word, I get way more suggestions than I want:

screenshot of Emacs with giant menu of spelling suggestions

I want maybe a dozen suggestions.

M-x ispell-buffer similarly gives too many suggestions.

This seems like an Emacs thing because running aspell on the same file in the terminal manually gives a much more reasonable number of suggestions (here, 8):

screenshot of aspell

2
  • @Drew, thanks for the suggestion. I do see it both ways. Question edited.
    – Reid
    Sep 17, 2020 at 19:07
  • Similar question on Stack Overflow with no solutions other than a block of LISP code: stackoverflow.com/questions/19186305
    – Reid
    Sep 17, 2020 at 22:24

2 Answers 2

3

Emacs is invoking aspell as:

aspell -a -m -B --encoding=utf-8

-a is “pipe mode”. Given this information, I can reproduce the behavior in the terminal:

$ echo dbux | aspell -a -m -B --encoding=utf-8
@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.8)
& dbux 47 0: DBUS, Dix, debugs, dubs, debug, box, tux, DBMS, ibex, bxs, daubs, dibs, debuts, deluxe, dybbuks, Durex, Debs, boxy, bugs, dabs, debs, dobs, dub's, dybbuk, tubs, dab's, deb's, DCS, TWX, TeX, Tex, tax, tbs, tex, DC's, TB's, Tb's, daub's, debut's, dybbuk's, Debs's, dibs's, bug's, BC's, Bk's, tub's, Doug's

Using the “ultra” suggestion mode rather than the default “normal” gives five suggestions rather than 47:

$ echo dbux | aspell -a -m -B --encoding=utf-8 --sug-mode=ultra
@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.8)
& dbux 5 0: DBUS, debugs, dybbuks, dybbuk's, debarks

This can be configured in Emacs by adding --sug-mode=ultra to Ispell Extra Args in M-x customize; it works for me:

5-item ispell menu

I would still prefer to get the top dozen or so from normal mode, but this is probably better than it was.

1
  • So far this is the best answer. I'll self-accept but if anything better turns up I'll change it.
    – Reid
    Sep 23, 2020 at 20:43
0

Make sure you've installed aspell dictionary. I use apt install aspell aspell-end on Debian/Ubuntu.

Then use M-x flyspell-buffer to spell check the current buffer. Flyspell is a independent packages which uses a few APIs from ispell. Most user use flyspell instead of ispell these days.

See https://blog.binchen.org/posts/what-s-the-best-spell-check-set-up-in-emacs.html for the details.

You can create a plain text personal dictionary ~/.aspell.en.pws for aspell,

Here is content of sample~/.aspell.en.pws,

personal_ws-1.1 en 3
ABN
AC
ACN
1
  • I do use flyspell (the menu above is from flyspell) and I do have a personal aspell dictionary. I skimmed the link but it's a general how-to on setting up spell checking in Emacs. I don't follow how this answer addresses my issue of too many suggestions.
    – Reid
    Sep 18, 2020 at 15:06

Your Answer

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

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