Subject: Re: bug#42248: 27.0.91; With enchant-2.2.8 from Guix, Flyspell errors out or gives lots of false positives

From: Jorge P. de Morais Neto <[email-masked]>
Date: Mon, 24 Aug 2020 11:30:18 -0300

Em [2020-08-20 qui 21:26:14+0300], Eli Zaretskii escreveu:

> I have two comments about this:
>
>   (a) isn't this because Enchant invocation fails as you've
>       established, due to the -B switch?
>
>   (b) are you sure the above at all matters? e.g., with Hunspell
>       (which is what I have here) it doesn't
>
> Bottom line: someone who has Enchant installed will have to step
> through the code which invokes it and sets up spell-checking, and see
> what goes wrong with that version of Enchant that uses Aspell.

OK, so in the weekend I started stepping trough the Enchant setup code
in ispell.el.  I have already made two small but important corrections.
The provisional patch is at the end of this message, but it is not
enough to fix the problem, so you may want to wait until I finish the
job---maybe next weekend?

In order to step though the Enchant setup code, I:
1. Open a new Emacs instance
2. Invoke M-x edebug-all-defs
3. Open ispell.el
4. Invoke M-x eval-buffer twice

Is this the best way to step though the setup code?

And I have found weird behavior of enchant-lsmod-2 on the command line.
See:

$ enchant-lsmod-2 -word-chars en_us
0123456789

Shouldn't the output above include the apostrophe?  And this happens
both on Guix's enchant 2.2.8 and on a locally compiled enchant 2.2.9.  I
have asked the #abiword channel on irc.gnome.org and also subscribed to
the abiword-dev mailing list---I'll ask there if there is no answer in
IRC.

Best regards

--8<---------------cut here---------------start------------->8---
--- 27.1/ispell.el	2020-08-24 11:09:38.429199892 -0300
+++ lisp/ispell.el	2020-08-23 16:49:07.134580642 -0300
@@ -1237,11 +1237,12 @@
   "Find Enchant's dictionaries, and record in `ispell-enchant-dictionary-alist'."
   (let* ((dictionaries
 	  (split-string
-	   (ispell--call-enchant-lsmod "-list-dicts" (buffer-string)) " ([^)]+)\n"))
+	   (ispell--call-enchant-lsmod "-list-dicts")
+	   " ([^)]+)\n"))
          (found
           (mapcar #'(lambda (lang)
                       `(,lang "[[:alpha:]]" "[^[:alpha:]]"
-                              ,(ispell--get-extra-word-characters) t nil nil utf-8))
+                              ,(ispell--get-extra-word-characters lang) t nil nil utf-8))
                   dictionaries)))
     ;; Merge into FOUND any elements from the standard ispell-dictionary-base-alist
     ;; which have no element in FOUND at all.
--8<---------------cut here---------------end--------------->8---

-- 
- <https://jorgemorais.gitlab.io/justice-for-rms/>
- If an email of mine arrives at your spam box, please notify me.
- Please adopt free/libre formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z.
- Free/libre software for Replicant, LineageOS and Android: https://f-droid.org
- [[https://www.gnu.org/philosophy/free-sw.html][What is free software?]]