unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tor Kringeland <tor.a.s.kringeland@ntnu.no>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 52179@debbugs.gnu.org
Subject: bug#52179: Highlighting a word in `ispell' using `enchant'
Date: Mon, 29 Nov 2021 21:46:05 +0100	[thread overview]
Message-ID: <m2lf16vgfm.fsf@ntnu.no> (raw)
In-Reply-To: <83k0grui9h.fsf@gnu.org>

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Tor Kringeland <tor.a.s.kringeland@ntnu.no>
>> Date: Mon, 29 Nov 2021 15:44:39 +0100
>> 
>> Using `ispell' with `enchant' on macOS yields the following problem.  If
>> a word contains some non-ASCII character, said character will not be
>> considered part of the word and will split it (like a digit would).  For
>> example in "naïve" both "na" and "ve" are considered two words.  This
>> does not happen if I use `aspell' instead of `enchant', and if I run
>> 
>>   echo -n "naïve" | enchant-2 -a
>> 
>> it registers that this is one word, and that it is valid (using an
>> English dictionary).
>> 
>> I'm using Enchant version 2.3.1 and an Emacs 29 build from 24 November
>> on macOS Catalina.
>
> Which dictionary do you use, and what encoding does that dictionary
> require?

In Emacs, the relevant entry in `ispell-dictionary-alist' is

  ("en" "[[:alpha:]]" "[^[:alpha:]]" "" t nil nil utf-8)

I installed `aspell' and `enchant' from Homebrew.  The installation of
`aspell' included a bunch of dictionaries downloaded from gnu.org.  In
particular, the "en" dictionary is downloaded from [1].  It is in some
kind of binary format after installation (see [2] for details).

The weird part is that it works fine in a command line, and switching
`ispell-program-name' to use `aspell' fixes the issue, so the problem
seems to be somehow in how Emacs interacts with the `enchant-2' binary.
It's doing the same for non-ASCII characters as one would expect from
numbers: the string "one0two" is valid, as "one" and "two" are treated
as separate words and "0" is ignored.

- [1] https://ftp.gnu.org/gnu/aspell/dict/en/aspell6-en-2018.04.16-0.tar.bz2

- [2] https://github.com/Homebrew/homebrew-core/blob/master/Formula/aspell.rb





  reply	other threads:[~2021-11-29 20:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 14:44 bug#52179: Highlighting a word in `ispell' using `enchant' Tor Kringeland
2021-11-29 14:51 ` Eli Zaretskii
2021-11-29 20:46   ` Tor Kringeland [this message]
2021-11-30  3:22     ` Eli Zaretskii
2022-05-24 15:49 ` Tor Kringeland
2022-05-24 19:11   ` Eli Zaretskii
2022-05-24 19:27     ` Tor Kringeland
2022-05-24 19:36       ` Eli Zaretskii
2022-05-24 21:34         ` Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-25  2:28           ` Eli Zaretskii
2022-05-25  7:39             ` Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-25 13:23               ` Eli Zaretskii
2022-05-27 13:45                 ` Tor Kringeland
2022-05-27 14:22                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2lf16vgfm.fsf@ntnu.no \
    --to=tor.a.s.kringeland@ntnu.no \
    --cc=52179@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).