GNU bug report logs - #31344
26.1; ispell enchant support generates invalid regexp for empty extra chars

Previous Next

Package: emacs;

Reported by: Daniel Pittman <slippycheeze <at> google.com>

Date: Wed, 2 May 2018 20:06:02 UTC

Severity: normal

Found in version 26.1

Done: Daniel Pittman <slippycheeze <at> google.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31344 in the body.
You can then email your comments to 31344 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31344; Package emacs. (Wed, 02 May 2018 20:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Pittman <slippycheeze <at> google.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 02 May 2018 20:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daniel Pittman <slippycheeze <at> google.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1;
 ispell enchant support generates invalid regexp for empty extra chars
Date: Wed, 02 May 2018 20:05:02 +0000
[Message part 1 (text/plain, inline)]
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.
[emacs-ispell-enchant.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31344; Package emacs. (Wed, 02 May 2018 20:09:01 GMT) Full text and rfc822 format available.

Message #8 received at 31344 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Pittman <slippycheeze <at> google.com>
To: 31344 <at> debbugs.gnu.org
Subject: additional note: error triggers due to flyspell package using the
 extra chars regexp
Date: Wed, 02 May 2018 20:07:51 +0000
Sorry, I forgot to mention in my original post that `flyspell-buffer` is
the trigger for this; it uses the extra character regular expression.  I
have not verified if it can be reproduced with only ispell.el commands,
though I assume it must be possible; it will trigger anywhere that regexp
is used.




Reply sent to Daniel Pittman <slippycheeze <at> google.com>:
You have taken responsibility. (Fri, 19 Oct 2018 13:58:02 GMT) Full text and rfc822 format available.

Notification sent to Daniel Pittman <slippycheeze <at> google.com>:
bug acknowledged by developer. (Fri, 19 Oct 2018 13:58:02 GMT) Full text and rfc822 format available.

Message #13 received at 31344-done <at> debbugs.gnu.org (full text, mbox):

From: Daniel Pittman <slippycheeze <at> google.com>
To: 31344-done <at> debbugs.gnu.org
Subject: resolved in master
Date: Fri, 19 Oct 2018 09:56:58 -0400
[Message part 1 (text/plain, inline)]
this issue has been resolved in the master branch, but the bug was not
closed.  cleaning up.
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 17 Nov 2018 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 158 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.