On Mon, 2 Nov 2020 at 16:10, Eli Zaretskii wrote: > > From: Reuben Thomas > > Date: Mon, 2 Nov 2020 15:49:19 +0000 > > Cc: dinkonin , 44318@debbugs.gnu.org > > > > So I, as upstream maintainer, am telling you that indeed, it is not > correct that Emacs should take > > enchant-lsmod's stderr as part of its output! (As I said above, it would > be possible to capture stderr > > separately and display it to the user, though I don't recommend that > currently, because the warnings are not > > written for users. Other programs that use Enchant do not show these > warnings, they simply omit providers > > that do not load from the list of languages/spelling checkers that are > available.) > > OK, I agree to this change, under protest. > Thanks Eli, I have installed it; of course, contact me if it causes any problems. After installing that patch, I discovered that in ispell--call-enchant-lsmod, it did need to use with-current-buffer, so I have installed a patch that restores the use of with-current-buffer; apologies for getting that wrong first time. In fact, this change is not sufficient to fix the original problem, because the enchant program outputs the same warning when a provider module cannot be loaded. In this case, stderr is added to the list of suggested words. Again, I believe Enchant is correct to output a warning, and again, I believe Emacs is wrong to amalgamate stderr and stdout. I attach three patches that do the following: 1. Simplify ispell-call-process{,-region} by factoring out the macro ispell-with-safe-default-directory. 2. I also found that ispell-check-version can be simplified slightly: aspell has accepted -vv since 2004, so use it always. 3. When spell-checking, collect only standard output. This leaves some spell-checker-specific calls to ispell-call-process to collect stderr as well, which as far as I can tell is needed in only one case, ispell-find-hunspell-dictionaries; but it doesn't hurt to leave the rest unchanged. I have tested this patch with all supported spellcheckers (ispell, aspell, hunspell, enchant).