emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#31344: closed (26.1; ispell enchant support genera


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#31344: closed (26.1; ispell enchant support generates invalid regexp for empty extra chars)
Date: Fri, 19 Oct 2018 13:58:02 +0000

Your message dated Fri, 19 Oct 2018 09:56:58 -0400
with message-id <address@hidden>
and subject line resolved in master
has caused the debbugs.gnu.org bug report #31344,
regarding 26.1; ispell enchant support generates invalid regexp for empty extra 
chars
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
31344: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31344
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 26.1; ispell enchant support generates invalid regexp for empty extra chars Date: Wed, 02 May 2018 20:05:02 +0000
G'day.  With the new Enchant support in 26 I was motivated to try it out.
Turns out that some languages generate an empty "extra characters" report
for languages I use, which is turned into the (invalid, says `looking-at`)
regular expression "[]".

This triggers in this function in ispell.el:

(defun ispell--get-extra-word-characters (&optional lang)
   "Get the extra word characters for LANG as a character class.
If LANG is omitted, get the extra word characters for the default language."
   (concat "[" (string-trim-right (apply 'ispell--call-enchant-lsmod
                                         (append '("-word-chars") (if lang
`(,lang))))) "]"))

Obviously, when the result of that call is an empty string we get `[]`; in
my case:

] enchant-2-lsmod -word-chars en_US | xxd
00000000: 0a                                       .

...which causes that.  (Error is: `(invalid-regexp "Unmatched [ or [^")`)

I have attached a patch which correctly handles this case, though I feel
there must be a cleaner way to handle this modification of the return.

In any case, Google (and I personally) have papers on file with the FSF
covering this contribution, if it is non-trivial enough for that to matter.

Attachment: emacs-ispell-enchant.patch
Description: Binary data


--- End Message ---
--- Begin Message --- Subject: resolved in master Date: Fri, 19 Oct 2018 09:56:58 -0400
this issue has been resolved in the master branch, but the bug was not closed.  cleaning up.

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]