Toggling of aspell's --run-together option is inconsistent
- Dominant language
- Emacs Lisp
- Stars
- 22.7k
- Forks
- 3.1k
- Avg merge
- 10h 46m
- Merged PRs (30d)
- 4
Description
This is a follow up to #3592, where I pretty confused on what the actual problem was.
**What did you expect to happen?**
I would expect:
- Words like "timezoneapple" (a run-together of "timezone" and "apple") to be spelling errors in text modes.
- Personally, I think run-together words should always be spelling errors, and `--run-together` should be dropped entirely.
- I would expect consistent behavior whether it's the first or second time I've opened the same buffer.
- I would expect `+spell/correct` to honor changes to `ispell-extra-args` (by restarting `aspell` or similar).
- I would expect Spell-Fu highlighting to be consistent with `+spell/correct` results.
**What actually happened?**
First of all, toggling of `--run-together` seems to be bugged. After reading the code, it looks like it's supposed to be toggled off in `text-mode-hook`. But it doesn't get toggled the first time I open `test.txt`:
`ispell-extra-args` -> `("--sug-mode=ultra" "--run-together")`
It does get toggled if I kill and reopen `test.txt`:
`ispell-extra-args` -> `("--sug-mode=ultra")`
Second, `+spell/correct` doesn't seem to respect/detect changes to `ispell-extra-args` anyway. Even with `--run-together` removed, it still says some bogus words are correct:
`M-x +spell/correct` -> `TIMEZONEAPPLE is correct`
This is probably due to the previous problem, and that the `aspell` process hasn't been restarted. To make it work I have to manually kill the Ispell process:
`M-x ispell-kill-ispell`
`M-x +spell/correct` -> `Corrections for "timezoneapple": ...`
Finally, `--run-together` does not really pair well with Spell-Fu. I read some of the Spell-Fu code, and if I understand it correctly, it dumps the `aspell` dictionary and matches against that. Which is a reasonable thing to do: if the word is not in the dictionary, it's considered a spelling error. But it's also fundamentally incompatible with using `aspell` with `--run-together`, because run-together words don't actually exist in the dictionary.
This creates an annoying experience where Spell-Fu highlights some word, but then `+spell/correct` tells you it's actually correct because it's a run-together word.
**Additional details:**
Config is the default except the `spell` module is uncommented.
**Steps to reproduce:**
(See above.)
**System information:**
SYSTEM type gnu/linux
config x86_64-pc-linux-gnu
shell /bin/bash
uname Linux 5.3.0-46-generic #38~18.04.1-Ubuntu SMP Tue Mar 31 04:17:56 UTC 2020 x86_64
path (~/.local/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games /snap/bin /usr/lib/x86_64-linux-gnu/emacs/28.0.50/x86_64-linux-gnu)
EMACS dir ~/.emacs.d/
version 28.0.50
build Nov 07, 2020
buildopts --build=x86_64-linux-gnu --prefix=/usr '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var --disable-silent-rules '--libdir=${prefix}/lib/x86_64-linux-gnu' '--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr --sharedstatedir=/var/lib --program-suffix=-snapshot --with-modules=yes --with-x=yes --with-x-toolkit=gtk3 --with-xwidgets=yes 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs-snapshot-QzJL2y/emacs-snapshot-102398=. -fstack-protector-strong -Wformat -Werror=format-security' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'
features XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD JSON PDUMPER LCMS2
traits (server-running)
DOOM dir ~/.doom.d/
version 2.0.9
build HEAD -> develop, origin/develop, origin/HEAD 92c9127b8 2020-11-07 00:20:07 -0500
elc-files 0
modules (:completion company ivy :ui doom doom-dashboard doom-quit hl-todo modeline ophints (popup +defaults) vc-gutter vi-tilde-fringe workspaces :editor file-templates fold snippets :emacs dired electric undo vc :checkers syntax spell :tools (eval +overlay) lookup magit :lang emacs-lisp markdown org sh :config (default +bindings +smartparens))
packages (n/a)
unpin (n/a)
elpa (n/a)
Contributor guide
Assessment
This issue has not been assessed yet.